From: Dennis Decker Jensen Date: 2001-05-07T23:40:04+09:00 Subject: [ruby-talk:14769] Re: skipping arguments "Dave Thomas" wrote in message > touch freedom writes: > > now, when calling this method, say i only want to change the value of > > b, while leaving a the same. how can i do this? > > Some future Ruby will support keyword arguments, which means you could > say something like the following (except the syntax is totally > arbitrary: the final syntax will probably look a lot different): > > def addPerson(name, withAge: a=0, withSex: s=FEMALE, withHair: h=UNKNOWN) > # ... > end > > Then these would be valid calls: > > addPerson('Fred', 23, MALE, BROWN) > > addPerson 'Barney' withSex: MALE withAge: 20 > > addPerson 'Wilma' withHair: BLONDE > > > (again, remember the syntax is just made up). > I don't care if it is made up! This syntax is great! I would vote for that syntax if it is possible at all that way! Someone asked about getting rid of commas, which sounded very interesting. I'll ask also: Do you need to type the commas for other reasons than conventional wisdom? Forgive me my excitement... Ruby is just fun to play with, while actually working... Best regards, Dennis Decker Jensen