Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C > Haskell

Name: Anonymous 2015-10-17 14:21

C can do arrays and trees. Haskell can do trees but cannot do arrays. C is the winner.

Name: Anonymous 2015-10-18 23:58

>>15
How would you propose writing an expression like (+ 1 2 3 (* 4 5 6) 7 8 9) without parens?

+ 1 2 3 * 4 5 6 7 8 9 does not work

+ 1
2
3
* 4
5
6
7
8
9

works but cannot be on one line.

+ 1 2 3 * 4
5
6
7 8 9
just looks extraordinarily strange to me, and would get worse with more complicated expressions.

In Lisp, you could write the expression with the original spacing, or like this:
(+ 1
2
3
(* 4
5
6)
7
8
9)


or like this:
(+ 1 2 3 (* 4
5
6)
7 8 9)


and it is simple to write an interpreter -- the spacing does not matter. Writing an interpreter to work without parens would be much more complicated and error prone. The parens allow the programmer to choose whatever indentation style makes the most sense for the application.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List