Skip to content

Commit

Permalink
v0.7 notes and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vito committed Jul 4, 2022
1 parent f4aee8f commit 8bc8572
Show file tree
Hide file tree
Showing 7 changed files with 2,807 additions and 2,588 deletions.
1,864 changes: 932 additions & 932 deletions docs/bassics.html

Large diffs are not rendered by default.

886 changes: 444 additions & 442 deletions docs/guide.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html

Large diffs are not rendered by default.

2,627 changes: 1,416 additions & 1,211 deletions docs/stdlib.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions notes/v0.7.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
More tweaks and polish on the path towards stability.
5 changes: 4 additions & 1 deletion pkg/bass/ground.go
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,10 @@ func init() {

Ground.Set("binds?",
Func("binds?", "[scope sym]", (*Scope).Binds),
`returns true if the scope has a value bound to the given symbol`)
`returns true if the scope has a value bound to the given symbol`,
`=> (binds? {:x 1} :x)`,
`=> (binds? {} :x)`,
`=> (binds? (current-scope) :binds?)`)
}

type primPred struct {
Expand Down
10 changes: 9 additions & 1 deletion std/root.bass
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,16 @@
(defn run [thunk]
((start thunk (fn [err] (and err (err))))))

; runs the body if test returns true
; evaluates the body if test returns true
;
; Returns the body's result, or null if the test is false.
;
; => (when true (def x :a) (log "hello") (log "world") x)
;
; => x
;
; => (when false (def x :b))
;
; => x
(defop when [test & body] scope
(eval [if test [do & body] null] scope))

0 comments on commit 8bc8572

Please sign in to comment.