Re: Generic symbolic sequence assignment

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

Probably, in this specific case. However, the LHS generic symbolic sequence shows its usefulness when the RHS is a function that returns a generic sequence.

Yes, I was thinking of that, but I'm not yet sure of practical that might be.

Here is an obviously contrived example, but it does highlight problems with functions that return different structures based on the input data.

function FUNC(object x) 
  if x > 0 then 
      return {x, {x * x, sqrt(x)}} 
  elsif x = 0 then 
      return x 
  else 
      return {-x, x * x} 
  end if 
end function 
 
{a,{b,c}} = FUNC( userdata ) 

Yes. The generic symbolic sequence assignment is, basically, practical only when the structure of the returned object is constant and compatible with the structure of LHS symbolic sequence. But I think there are many cases in this situation.

- Fernando

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

Search



Quick Links

User menu

Not signed in.

Misc Menu