[Date Prev][Date Next][Subject Prev][Subject Next][
Re: XPL question
- Subject: Re: XPL question
- From: cld@xxxxxxxx
- Date: Thu, 15 Jan 2009 18:49:11 +0000
You have it right. However, it wouldn't be fair, in my view, to characterize this as an
"incompatibility" between Xy 3 and Xy4. "Compatible" in this context means that
features that are common to the two programs work the same in Xy4 as they did in Xy3. That is
undeniably true to a very large extent. Nested IFs, however, are a feature that Xy4 supports and Xy3
doesn't. There are many such features, notably the myriad of functions, commands, command switches,
and XPL operators that were introduced with v4. The fact that these new features work erratically or
not at all in Xy3 doesn't refute the claim that retained features work the same.
To put it another way, nested IFs are a feature in Xy4, but an error in Xy3. Your nested-IF example
works -- to an extent -- in Xy3 because Xy3 tolerates the error. That is, instead of simply
returning "Command entry error", it executes the instructions until it encounters the
first EI. You can exploit the tolerance if you know what you're doing. But standard Xy3 code should
not contain nested IFs, and most of my and Robert's Xy3 code does not.
Speaking of such matters, here's another example of how a feature that exists in Xy4 but not in Xy3
can be exploited to useful effect. The program below is a Xy3 version of the U2 XYENCode-XYDECode
routines for Xy4 that I posted last week. It runs in Xy4, too, but I wanted to tweak a couple of
instructions to make them more idiomatic for Xy4 when the routine is run under Xy4. The "Test
for Xy4" below (SUb 04) takes advantage of the fact that a SUbroutine containing Xy4-only code
(in this case, a string comparison using quoted strings) will run in Xy3 *until* the Xy4 code
crashes the SUb. For this reason, the values that the SUb assigns to S/Gs 05 and 06 after the quoted
strings are encountered will take effect in Xy4, but not in Xy3.
By the way, this program is slightly different from the U2 frames in that the encoded or decoded
material *replaces* the original. I've modified the U2 frames to do that, too. I think, in
practice, this will be the most useful behavior. It's a snap to toggle between encoded and decoded
versions, so I don't think there's any downside to this change.
I'm looking forward eagerly to the update to XYENCode.
- - - - -
- - - - -