From: Tomasz Wegrzanowski Date: 2006-07-25T06:33:37+09:00 Subject: Re: RLisp - Lisp naturally embedded in Ruby On 7/24/06, William James wrote: > > ; Configure the server > > (let config [Hash new]) > > Please don't use "let" for this. "setq" or "define" > would be much better. Now I know perfectly well that let is used in different way in other dialects of Lisp ;-), but I think this is way nicer. And it's less cryptic than setq (a big win); define is a bit too long, but the main problem is that it suggests global assignment, while (let x y) in RLisp rebinds x in local environment. Local environments are introduced by lambda/defsyntax, but I guess RLisp should also provide explicit (local ...) So you can compute let's say length of a vector using: (lambda (x y) (let x2 (* x x)) (let y2 (* y y)) (let z2 (+ x2 y2)) (sqrt z2) ) I find it a lot more readable than Scheme's: (lambda (x y) (let ( (x2 (* x x)) (y2 (* y y)) ) (let ( (z2 (+ x2 y2)) ) (sqrt z2) ) ) ) Even Lisp hardcorer Paul Graham seems to agree that let isn't very nice (althrough he's much less radical than RLisp), so in Arc you'll say (http://www.paulgraham.com/ilc03.html): (let x 'a (cons x 5) ) ; -> (A . 5) So in Arc the code would look like: (lambda (x y) (let x2 (* x x) (let y2 (* y y) (let z2 (+ x2 y2) (sqrt z2) ) ) ) ) What's already much better than Scheme, but still not perfect. And while I don't have much experience with Lisps, I have a lot experience with Objective Caml I really really totally *hate* let introducing extra indentation level and I think it obfuscates many otherwise clean programs for no real gain. I you can easily do have: ; No support for local yet, so let's emulate it (defsyntax local args `((lambda () ,@args)) ) ; Arc-like let (defsyntax local-let args `(local (let ',[args get 0] ,[args get 1])   ,@(tl (tl args)) ) ) And use local-let like Arc's if you really like it. Or even define Scheme-like one, but I think nobody's going to actually defend it against Arc's.