On Tue, 2007-09-18 at 21:04 -0700, Erick Tryzelaar wrote:
> On 9/18/07, skaller <[EMAIL PROTECTED]> wrote:
> Now that would be useful. We might need a prefix to those values
> though, so then we could use this in function declarations. This may
> help to distinguish between a function taking a tuple and a function
> taking an anonymous struct. We could copy ocaml and use '~', or
> lisp/ruby and use ':', or just use a period since that's already an
> operator. Then we'd have:
The question is: why do we need to distinguish?
Python doesn't require this. You can not only use either
positional arguments or named ones, you can mix them.
So if you write:
fun f(a:int, b:int) ..
we might think of this as a function taking a record so that
f (a=1, b=2)
works (assuming the argument syntax here can replace struct { ..}
syntax currently requires).
And then, if we allow records to be initialised by tuples:
X (1,2)
then
f (1,2)
is just an initialisation of the argument record by a tuple ..
Of course there is the issue of overloading to consider etc...
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language