Re: Fallbacks in Euphoria
- Posted by Ekhnat0n Jan 13, 2015
- 1528 views
I will go and GOOGLE Lua and the way it implements these fallbacks
You might also have a look at Python, since it implements a similar mechanism.
The more I consider it, the more this seems to me as something that would be better implemented as a special type of sequence.
That is, if the meta flag is set, it executes the user-defined fallback (as in Python or Lua), rather than only being triggered on a failure.
That still leaves the question of how the meta information gets updated when Euphoria passes the sequence by copy, which strikes me as the real problem here.
- David
I do know a thing or two about Python already, but will have to read up on it
to refresh knowledge I acquired some odd 25 or more years ago.
As to implemnting it as a sequence: you are absolutely right
because it gives most freedom for the programmer Again for the meta-flag you hit the bulls'eye.
And now for your problem:
There will be no problem at all because EXACTLY WHILE Euphoria PASSES IT BY COPY
you can compare it to any sequence in the variable area
and find out exactly which sequence is meant
AND what the differences are
AND correct those in the actual variable.
It is not that hard isn't it