Forums

Default type for arguments

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Default type for arguments

Postby Charles » Tue Jul 08, 2008 12:37 am

In "def foo(x, y)" the types for "x" and "y" are dynamic. However, since the default type for arguments is not dynamic? (note the question mark for "nilable"), you cannot pass nil or a nilable expression to the arguments.

But my original intent was that untyped arguments be as flexible and late bound as possible. So I'm planning to change the default argument type to dynamic?. Of course, if that disagrees with your needs, you can explicitly use the dynamic type as in "def foo(x as dynamic, y as dynamic)".

This would also affect untyped vars and untyped properties.

If you have any feedback, please speak up soon.

Thanks,
Chuck
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Default type for arguments

Postby Charles » Thu Aug 28, 2008 2:23 am

This is done in development.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Default type for arguments

Postby relez » Tue Sep 02, 2008 12:50 pm

Very interesting idea... this is a very flexible approach, maybe the most flexible....
relez
 
Posts: 69


Return to Discussion

Who is online

Users browsing this forum: No registered users and 106 guests

cron