Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

in any reasonable implementation of lisp the let is implemented with lexical scoping. This is because it is the transformation of a closed over lambda, and lambda arguments have lexical scoping akin to a stack push/pop.

If it weren't it would just be a def/setf/defvar/defparameter.

In the example given, assuming let has the same properties, we have no idea when the second 'let' statement ends, you would need something to signify the end of the block... there isn't anything in the given example. It could be implicit whitespace or something, but that isn't clear.



This is something other languages do as well. Lisp zealots seem to think every other language is banging rocks together. Lexical scoping/closures/whatever are traditions independent of language or implementation. Nobody but you is having trouble understanding the scope of the algol example.


Nobody but you is having trouble understanding the observation made by ohyes that the Algol syntax is a fragment which can be embedded into a larger scope which could declares more variables. Whereas the parenthesized let is a complete construct which opens and closes its scope. We know where the scope begins and ends, and its full content.

The crystal clear point of ohyes's observation is that the token count is unequal, in a sense: the Lisp expression is defining variables and delimiting the scope, and includes tokens which establish scoping, whereas the Algol-like snippet is only defining variables, letting an unspecified surrounding program delimit their scope. That program is going to require some syntax in order to delimit that scope; that syntax is not shown and so its tokens are not counted.


Um, so fucking what? I could put a pair of braces or parens around the algol program, too, but they are implicit. Or is that too exotic a concept for your lisp-addled mind to accept?

I get that you think having to wrap your entire program in an extra set of delimiters is super special, but it's really fucking not.


The 'algol' example doesn't have enough context to demonstrate that there is a lexically scoped block. The lisp example contains an empty block.

If it were truly algol it would probably have an 'endlet' symbol at the end of the let, for example. If it were C it would require curly brackets, python out-dentation, ocaml something else(!?).

Anyway, I suspect you're a troll,

good day.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: