From: gabriele renzi Date: 2004-04-02T07:24:22+09:00 Subject: Re: deciding between ruby and python il 01 Apr 2004 23:59:59 +0300, Ville Vainio ha scritto:: > Hal> As for the parens: I've never missed first class functions in > Hal> Ruby. Maybe I should. But I prefer the uniform access > Hal> principle if I have to choose between that and fcf. > >But you don't know that yet :). What practical benefits do you get >from the uniform access principle, and what do you mean by it? I *believe* he talks about accessor methods. (I know that as of actual python you can use property() ) BTW I love to avoid parenthesis when it allows me to make stuff look like syntax, say: class My private def private_method end end private is actually a method call. >You can just pass functions directly to anything that wants a callable >object. Functions and methods are objects like everything else, you >can pass them around and store them any way you want. > >You can use higher order functions, which is critical for FP. well, you can use HOF in ruby too, cause you can have Method objects or Proc (lexical closures) objects. You just need to create them explicitly. It's worth noting that near every place where you use a lambda or a generic function argument in python, you use blocks in ruby, so actually there are functional arguments everywhere in ruby, they just look different :) >http://www-106.ibm.com/developerworks/linux/library/l-prog3.html > >if you want to learn more (the article has links to parts 1 and 2). I liked all the functional stuff from David Mertz. I loved usage of HOF in text processing in python, but just to point out some functional ruby stuff: http://www.ping.de/~flori/ruby/programs/functional.html ruby is an infix dialect of lisp ;)