Re: 4.1 multiple assign sequence items?

new topic     » goto parent     » topic index » view thread      » older message » newer message
_tom said...

I expected that this would work:

sequence m = { 10, 20 } 
{ m[1], m[2] } = { m[2], m[1] } 
? m 

Instead I get:

<0132>:: Syntax error - expected to see possibly ',', not '[' 
{ m[1], m[2] } = { m[2], m[1] } 
   ^ 

Using one of the 4.1 recently available:

Euphoria Interpreter v4.1.0 development 
   32-bit Linux, Using System Memory 
   Revision Date: 2014-01-11 22:35:01, Id: 5777:944d3dd7b349 

_tom

Hallo

I never tried to use the multiple assign this way...\ Becouse of this in the manual.

Variables may only appear once on the left hand side, however, they may appear on both the left and right hand side. For instance, to swap the values of two variables: 

In your example 'm' appears 2 times on the left side

But i really like to have this option...

This would be really great..

Andreas

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

Search



Quick Links

User menu

Not signed in.

Misc Menu