Closed reuleaux closed 5 months ago
Doesn't let
already do what you want?
$ janet
Janet 1.33.0-f91e5994 linux/x64/gcc - '(doc)' for help
repl:1:> (let [x 1 y x] (+ x y))
2
Regarding letrec
and friends, it's not the same, but see this discussion.
(def [x y] [1 2])
Hm - my bad then, I guess, and sorry for the noise - I was pretty sure, that I ran in a situation, where this did not work, but now, that you are pushing me, and I am trying again, it seems to work for me.
I have these nested let in a couple of places now, and will get rid of them one by one (and I will shout out, in case of some issue remaining for me, i.e. if I keep quiet, than everything's fine).
Thanks for your feedback. -A
sogaiu @.***> writes:
Doesn't let already do what you want?
$ janet Janet 1.33.0-f91e5994 linux/x64/gcc - '(doc)' for help repl:1:> (let [x 1 y x] (+ x y)) 2
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.
This is on my wishlist: let*
I am currently using nested let instead, which seems a little awkward:
with let* this would be as simple as
Even one step further: recursive defs - with letrec/letrec* - have a look at the (Gauche- Guile-) Scheme src/docs for example. Thanks!