1. Re: Unfolded Expressions, Swap
- Posted by Mathew Hounsell <mfh03 at UOW.EDU.AU>
Jul 21, 1999
-
Last edited Jul 22, 1999
The problems with....
{ a, b, c } = func()
are quite simple the language was not designed for this.
In a language I have decided to create I decided early to support multiple
return values and
thanks to the languages it is based this was relatively simple. Consider this
trial syntax
( boolean, int, int ) func ( int j, int k, int l ) {
// ...
return ( true, h, i );
}
boolean a;
int b, c;
( a, b,c ) := func( e, f, g );
This is something I intend to support.
The problem is Euphoria was designed to allow the return of any type of value.
For a Euphoria
function to return values for unwrapping it would probabely tack a lot of run
time checking to
ensure the sequence returned was the right length and the elements had the right
type. The
point is L was designed for this multiple return value style, Euphoria wasn't if
it is added
without restructuring it is a hack, added ad hoc to the language. Euphoria
allows any return
type this unbinding assumes a function returns a set type and so is different to
the defenition
of the language.
-------------------------
Sincerely,
Mathew Hounsell
mat.hounsell at excite.com