From: Trans Date: 2005-10-25T07:22:02+09:00 Subject: Re: A comparison by example of keyword argument styles Ara.T.Howard wrote: > i think you cannot ever have both trailing optional arguments AND keywords > with current ruby calling conventions since it will always be impossible to > determine whether the last hash is a value for an optional argument or the set > of keywords. the only way is to have a syntax that calls methods with > keywords that are not an inlines hash, eg > > foo 42, keyword : 42.0 # optional gets default value > foo 42, keyword => 42.0 # optional IS a hash , keyword is not given Ah, at first I was gogin to say "STOP! You've got this all distorted. These are parameters, not hash keys. Related but different. So why are you using strings? It's this: foo 42, keyword => 40 + 2 There is no ambiguity." But now I see you get to this To which I say: Exactly. This is how it ought to be -- IF done this way. Matz implementation actually is NOT like this though and has worse problems some of which you describe above. > when i was coding parseargs all this became apparent very quickly. trying to > write a parser for any proposed syntax is a good exercise that shows how nice > a real keyword syntax might make things. What do you mean by real? T.