4 ms·
Egh, some of those other languages are more Scheme-like than others. In particular, Javascript is certainly more scheme-like than Java, which lacks even first-c
by devinj 17y ago
Egh, some of those other languages are more Scheme-like than others. In particular, Javascript is certainly more scheme-like than Java, which lacks even first-class functions, for example. And, well, Python is basically just Lisp with different syntax (or so Norvig claims; I'm not sure I'd go that far: http://norvig.com/python-lisp.html http://norvig.com/python-lisp.html).
So I can't really agree that it's not any more Scheme-like than anything else out there. I do agree it's not particularly Scheme-like.
- jimbokun 17y agoJavascript's scoping is also closer to Scheme's lexical scoping, I think. If you always use var for local variables, their scope will always be the immediately enclosing function. With Python, the scope of a variable is less clear. To me, the combination of first class functions, anonymous function syntax, and lexical scope are very high on the list of features that make a language "Scheme-like."
- devinj 17y agoHow are Python's scoping rules less clear? They are identical to Javascript's (and Scheme's), except that instead of defaulting to global scope, they default to local scope (which can be overridden with `global foo`). Also, it has one extra kind of scope, class scope. I would agree with you if you said Python's class scope is rather strange, of course.