|
|
|
|
|
by pklausler
3809 days ago
|
|
I don't know about scaring people, but many programming languages have concepts that are best demonstrated with small examples that make people say "whoa". For example, it's amazing that append() in Prolog can be run "backwards" from the concatenated result to yield all the lists that can be concatenated to produce it. Or that the monadic bind operator in Haskell (>>=) can be defined in terms of join and fmap, or that ($) = id. Programming languages have idiomatic expressions, and learning why they do what they do can produce enlightenment. It's no accident that C supports syntax like 3["hello"]. It looks mysterious, but not when you know that x[y] == *((x)+(y)) by definition. APL was especially rich in idiomatic expressions; I suppose that it's a sign of having easily composed primitives. |
|
I see now why it's true, but still... Whoah!! Thanks for that!
I think your suggestion would make a terrific online book.