RE: Strange behavior in sequence handling

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

it gives an interesting insight into the underlying implementation of 
euphoria.

in the first assignment of L (L[1] = L), the values of L are all 
integers and assigned (apparently) by value.

in the second assignment of L (L[1][1] = L), the right side is a nested 
sequence, which euphoria assigns by a pointer to the sequence structure 
(in this case, itself). no problem with the actual assignment (no 
error), but when you try to access the contents of the first element, it 
points back to its own structure recursively in an infinite loop.

so it's a feature after all - recursive variables, to go with types that 
act like functions! euphoria has hidden powers.

cheers all

tacitus

sephiroth _ wrote:
> interesting...:) i inserted a few print statements(for each assignment 
> to L after the "weird" comment) and got this:
> 
> {97,98,122}
> {{97,98,122},98,122}
> {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
> {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
> {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
> {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
> {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
> CauseWay DOS Extender v3.45 Copyright 1992-99 Michael Devore.
> blah blah blah...
> 
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu