[gPXE-devel] More Scripting Discussion
Shao Miller
Shao.Miller at yrdsb.edu.on.ca
Wed Mar 17 23:43:23 EDT 2010
Lynus Vaz wrote:
> Hi Shao,
Hello Lynus!
> I think it would be nice to have at least equal and not-equal
> operators in <condition>, to check variable values.
Discussion with Joshua Oreman revealed an opinion that operators could
be used as part of the expansion syntax. I believe that your code did
something like this, too. ${ val1 != val2 }. I'm not sure if operators
belong in the 'if' command or not, but they certainly would be handy to
have! I'm sure they would most often be used with 'if'.
> So does 'deferred execution' mean stopping code execution till the
> label is found? I found it a bit difficult to follow the terms
> yesterday.
Basically a strategy was to store a routine's offset in the script as
soon as the routine was passed by, but the routine would not be
executed. Code after of the routine's terminator would be executed. If
executed code issued a 'goto', it would jump to the routine and execute
the routine's code. A challenge here was that only routines which has
already been passed by were available to 'goto', which meant all
routines had to be "declared" before being used. This made the if-else
construct particularly tricky. Anyway, this strategy seems unpleasant
and I've abandoned it.
A more pleasant strategy is for all routines to be available at all
times, and to simply execute every line of code as it is passed. Stefan
and I both have patches which do this, with different implementations.
Thanks for your consideration, Lynus. :)
- Shao Miller
More information about the gPXE-devel
mailing list