Re: Allow a sequence as a subscript

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

Wishlist item:
When a function returns a location in a multi-dimensioned array, it must return a sequence. It is very messy to use the sequence to access the array.

sequence array, subscript 
array = {{1,2,3},{4,5,6},{7,8,9}} 
subscript = {2,3} 
 
array[subscript[1]][subscript[2]]   -- Current method 
 
array[subscript]   -- Wishlist alternative method 

I suppose that by about Euphoria version 5 or 6 there could be an assignment to a sequence of Euphoria variables, with a very strict format. For example:

sequence array, X, Y 
array = {{1,2,3},{4,5,6},{7,8,9}} 
{X,Y} = {2,3}   -- Or some function returning {2,3} 
array[X][Y]     -- Or you may want array[Y][X] 


I don't think this syntax would conflict with any existing Euphoria syntax.
I am definitely NOT going to put a feature request in for it, even though I would often have found it useful in the past.

Arthur

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

Search



Quick Links

User menu

Not signed in.

Misc Menu