Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Under any Scheme standard, is (let (x y z) x) valid code?

In both Emacs Lisp and Common Lisp, the following returns nil

(let (x y z)
  x)

yet in every Scheme that I’ve tried, it throws an error.

Has the above been acceptable under any Scheme standard?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

No, the posted code was never legal in standard Scheme. For all Scheme standards since R1RS (1978) let has had the syntax: (let ((var1 form1) ...) expr1 expr2 ...). The original Scheme paper by Sussman and Steele (1975) did not even use let.

Note that, e.g., (let () 42) is legal in both Scheme and in Common Lisp, i.e., it is legal to have a let form with no bindings.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading