Is there an equivalent to Lisp's "let*" in Dylan? In my coding style, I like to name intermediate parts of a calculation for documentation or multiple uses of a subexpression.
So in Common Lisp I have:
(let* ((x 2)
(y (/ x 2))
(z (/ x 4)))
z)
in Dylan the best I could come up with is:
let x = 2;
let y = x / 2;let z = x / 4;z
I'm aware of the Dylan "values" syntax, but this isn't really what I need. The multiple "let"s are OK, but I was wondering if there was anything more elegant.
Thanks for any info.
--
You received this message because you are subscribed to the Google Groups "dylan-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dylan-lang+...@googlegroups.com.
To post to this group, send email to dylan...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dylan-lang/a3f83855-54e5-437c-b8e0-b6f0a4981d05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I know in Lisp, let* is commonly transformed by a macro into nested plain lets. Makes me wonder if I could write such a macro in Dylan. My Common Lisp models do have large numbers of let bindings, e.g.:I could also just decompose my models into more functions with Dylan. In any case, thank you (and Carl) for your replies.
Is there an equivalent to Lisp's "let*" in Dylan? In my coding style, I like to name intermediate parts of a calculation for documentation or multiple uses of a subexpression.
So in Common Lisp I have:
(let* ((x 2)
(y (/ x 2))
(z (/ x 4)))
z)
in Dylan the best I could come up with is:
let x = 2;
let y = x / 2;let z = x / 4;z
I'm aware of the Dylan "values" syntax, but this isn't really what I need. The multiple "let"s are OK, but I was wondering if there was anything more elegant.
Thanks for any info.
--
You received this message because you are subscribed to the Google Groups "dylan-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dylan-lang+...@googlegroups.com.
To post to this group, send email to dylan...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dylan-lang/f8f63e06-cbe7-4d75-a46d-13230cea11de%40googlegroups.com.