|
 |
Invisible wrote:
> nemesis wrote:
> ML I have at least heard of. The vague impression I have is that it's
> kind of similar to Haskell, but insane.
They both look insane to me. ;)
>> You may eventually learn about Haskell's ancestry...
>
> AFAIK, Haskell is basically Miranda(tm) with a few minor modifications.
> (Oh, and type classes.)
Yes, but ML was the one to really begin it all. OCaml is it's current
popular iteration, as well as F# from Microsoft.
>> Here's an example of Scheme code:
>> (let ((%? (lambda (a b) (zero? (modulo a b)))))
>> (let sum ((i 5) (r 0))
>> (if (= i 100000) r
>> (sum (+ 1 i) (if (or (%? i 5) (%? i 7))
>> (+ r i)
>> r)))))
> I think you'd need to colour code expressions by depth or something to
> really make sense of that. Really deeply nested expressions are
> difficult to parse visually.
Not at all. Prefix syntax makes everything very clear: most everything
in the begining of a list is a function or macro and the rest are
arguments, like
(+ 1 i) or ((lambda (x) (* x x)) 3)
Identifiers can have symbols like "?".
> (I also imagine that without assistence it
> would be very hard to make all the parentheses match up correctly...)
Not at all, if notepad is all you got, just be sure to always open and
close in sequence, then position between and continue typing. Of
course, I won't comment on identation in this case. :D
But any slightly advanced editor gives you parentheses matching for free.
Post a reply to this message
|
 |