Re: Questions

new topic     » goto parent     » topic index » view thread      » older message » newer message

On 11 Mar 2003, at 13:27, Derek Parnell wrote:

> 
> On Mon, 10 Mar 2003 23:07:56 +0000, Gabriella Leveron 
> <gleveron at hotmail.com> wrote:

<snip>

> > Does Euphoria support overloading?
> 
> A little bit. Operator overloading is definitely not possible. By using the
> 'object' or 'sequence' datatypes, function signatures can allow a tiny bit of
> overloading, but its nowhere near as expressive as C++, Java, etc...

Well, you can sneak things by using nested sequences.

function x(object things)

and call like:
z = x( {"yes",34,8.9,{2,3,5}} )
z = x( "no" )
z = x({ {"yes",23},{maybe,98,65} } )
z = x(2)
z = x({2.6.8.12,5})

As long as x can figure out what is sent, it's do-able. I do it in strtok. Most 
functions in that lib can accept a string or a sequences of strings as the first
parameter, an atom or sequence of atoms as the third parameter, and 
parse() can take an atom or string or sequence of chars as the second 
parameter.

Kat

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu