1. Re: Unfolded Expressions, Swap

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

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu