From: William Djaja Tjokroaminata Date: 2002-08-28T03:22:12+09:00 Subject: Re: What New Language After Ruby? Based on the comparison example, is it true that in general Haskell code is relatively shorter than Scheme code? Probably this shorter syntax gives Haskell an advantage (something that I really appreciate knowing how faster I can program in Ruby compared to programming in C). (Well, the first time I switched to Ruby from Python I hated to have to write the "end" keywords as the code becomes longer than that in Python; probably syntax-wise regarding the wording Python is better than Ruby. Also, Python has the motto "there is only one way to do it" whereas Ruby still has some influences from Perl.) Regards, Bill ========================================================================== Nat Pryce wrote: > Exactly. Currying is not supported by the language. Although it can be > implemented by hand, it is not as convenient as when provided by the > language itself. > E.g. in Scheme, a function to add 2 to a number has to be defined as: > (define (add2 x) (+ x 2)) > while in Haskell it's > add2 = + 2 > This example is pretty simple, but the advantages of currying are most > apparent when using higher order functions. E.g. compare: > define (double a-list) (map (lambda (x) (* x 2)) a-list)) > to: > double a_list = map (* 2) a_list