core: port when-let to the overlay — finishes the Phase 3 macro migration
Last core macro still in Janet. Goes in 00-syntax (not 30-macros with its if-let/if-some/when-some siblings) because 20-coll's not-empty uses it and 20-coll loads before 30. Via `let` so the binding form may destructure, matching Clojure — the old Janet version used let* and wouldn't. Drops core-when-let + the sym* helper + the intern entry, and empties core-macro-names (no seed binding is a macro anymore).
This commit is contained in:
parent
77e3e3afcf
commit
8bc5bd6f61
3 changed files with 16 additions and 20 deletions
|
|
@ -25,6 +25,8 @@
|
|||
`(let [temp# ~tst]
|
||||
(if temp# (let [~form temp#] ~then) ~else))))
|
||||
|
||||
;; when-let lives in 00-syntax (not here): 20-coll uses it, which loads before this tier.
|
||||
|
||||
(defmacro if-some [bindings then & [else]]
|
||||
(let [form (bindings 0) tst (bindings 1)]
|
||||
`(let [temp# ~tst]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue