![]() |
sponsored links |
|
|
sponsored links
|
|
|
2
10th April 05:10
External User
Posts: 1
|
taltman@noshpam.lbl.government writes:
You should look at this: http://compsoc.dur.ac.uk/whitespace/ They have dispensed with everything *but* the indentation. The code is the clearest I've encountered. -- ~jrm |
|
|
3
10th April 05:11
External User
Posts: 1
|
taltman@noshpam.lbl.government writes:
If you are more generically interested in a "Lisp-like language without parentheses", you could also try Dylan. |
|
|
5
10th April 05:11
External User
Posts: 1
|
taltman@noshpam.lbl.government writes:
Logo (as you should remember from 61A!) is different from most modern Lisp dialects (including Scheme) in one important way: it's dynamically scoped. So "Scheme without parentheses" is only fuzzily true; it would be fairer to say "traditional Lisp without parentheses." Whether the scope rules matter to you depends on what you're trying to do. I don't want to start a dispute about which is better; personally, I find uses for both Scheme and Logo. I'd certainly choose Scheme for a large real-world programming project, but I prefer Logo for teaching young kids. For little quick-and-dirty projects, I've used both, generally deciding on some basis other than the scope rules; for example, if the problem involves tearing words apart into letters, I use Logo, but if the problem requires bignums, I use Scheme. Python's scope rules, iirc, are complicated and kinda ugly, neither fish nor fowl. It has other strengths, such as the use of sets as a primitive data type. Note that I've been talking about semantics, not syntax. If the Python feature you're trying to emulate is the use of indentation to delimit program blocks, Logo doesn't do that. Instead of program blocks, Logo uses instruction lists, as Lisp does in the EVAL procedure. Logo uses square brackets, rather than parentheses, to delimit literal lists, but that isn't much of a difference. The "without parentheses" aspect of Logo is that when a procedure takes a fixed number of arguments, you don't have to enclose the procedure call in parentheses. In some Logo dialects, a procedure call must all be within a single line (and there is some sort of continuation-character mechanism to allow multi-line "lines"); in other dialects, newline is exactly equivalent to space. I think this all feels pretty different from the way whitespace is used in Python. P.S. Making indentation significant is *not* my favorite Python feature. I've had too many experiences moving (C) code from one machine to another, and discovering that the GUI on the new machine has a different idea of how many spaces there are in a tab. In C (and Scheme and Logo) that doesn't matter except for making the program look ugly, but in Python it would matter. |
|
|
8
10th April 05:11
External User
Posts: 1
|
bh@cs.berkeley.edu (Brian Harvey) writes:
There is another important difference: it is *extremely* focused on imperative programmming. Yes, you *can* write in a functional style with Logo, but it is extraordinarily difficult to write any sort of graphics programs in Logo this way. This is the primary reason I don't teach it to my kids. (dynamic scope is the second) -- ~jrm |
|