Search the web
Sign In
New User? Sign Up
iolanguage · Io
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Named Arguments (first attempt)   Message List  
Reply | Forward Message #5604 of 11930 |
Hi Guys,

Someone was wanting named arguments the other day, so I had a quick
first attempt at them tonight. You can see the results at
http://pipapo.org/iowiki/PasteBin/methodWithNamedArgs

o := Object clone
o test := methodWithNamedArgs(a, x, b, y,
assert( (x + y) == 10 )
assert( (a + b) == 31 )
)

o test(13, y=3, x=7, 18)

So who is going to be first to find a bug? ;-)

Jonathan.



Wed Mar 2, 2005 9:22 am

quagath
Offline Offline
Send Email Send Email

Forward
Message #5604 of 11930 |
Expand Messages Author Sort by Date

Hi Guys, Someone was wanting named arguments the other day, so I had a quick first attempt at them tonight. You can see the results at ...
Quag
quagath
Offline Send Email
Mar 2, 2005
9:22 am

... Neat! :) I really like your code; I'm learning from it. 1) That trailing unnamed "b" parameter is interesting. I think most languages disallow that, but...
Kevin Edwards
edwakev
Offline Send Email
Mar 2, 2005
8:28 pm

... I think lua or maybe javascript does it this way. I know python doesn't. I don't like Python's restriction that named arguments must always come after...
Quag
quagath
Offline Send Email
Mar 2, 2005
9:15 pm

... Thanks, for the pointer; I have your old e-mail and found your Assert.io. In case anyone else is interested, I also looked it up at gmane (yahoo doesn't...
Kevin Edwards
edwakev
Offline Send Email
Mar 2, 2005
11:25 pm

... I think I may have said the wrong thing... let me have another attempt. Ok, take the example: outerScope := thisContext someObject someMethod() someObject...
Quag
quagath
Offline Send Email
Mar 3, 2005
1:08 am

... I think I agree. :) Does anyone else know of a case where it would be useful to keep "self" separate from "scope" or "target"? e.g. where we'd want to...
Kevin Edwards
edwakev
Offline Send Email
Mar 3, 2005
2:30 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help