From: Daniel Berger Date: 2005-10-23T23:57:49+09:00 Subject: Re: A comparison by example of keyword argument styles Trans wrote: > List is great but I don't program in Lisp because of my eyes become > crossed in looking at it. I don't what the same thing in Ruby. > > def foo( c: ) # looks bad > > foo( c: :many ) # horrible!!! > > I don't understand why this is acceptable. Symbols are common > arguments. Space significance is poo-poo'd everywhere else. I could live with this particular exception. Seriously, what are our alternatives for keyword syntax in method calls? "foo(x: 1)" Pros: Probably easiest to parse. Familiar to Smalltalkers and Lispers. Cons: Symbols force space, look ugly. Aside: I don't expect to see a lot of folks passing symbols to keywords arguments in practice. "foo(x => 1)" Pros: Familiar syntax, fairly intuitive. Cons: More verbose, difficult (impossible?) to distinguish from a Hash. "foo(x = 1)" Pros: Clean, simple, intutive. Familiar to Pythonistas. Cons: May very well be impossible to implement because '=' is an expression. "foo(x := 1)" Pros: Avoids the SSW issue with symbols. Cons: Unfamiliar syntax, smells like Ada. If Evan can, by some wizardry, get '=' to work in Sydney, that is the proposed syntax I would favor. Otherwise, I can certainly live with ":" and a forced whitespace for symbols. > This is terrible. Why do you not care about this Matz? Why do so many > not seem to care about this? He does care. That's why he's joined this discussion in public, and probably has some interest in seeing how Sydney does things. Regards, Dan