[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: v3 xpl buffer

≪	One expression that I've always wished could be manufactured by
concatenation (but can't) is the GoLabel (GL) statement. To take a v4
example, suppose S/G 01 can have three possible values: "red", "blue" and
"green"; you want execution to branch to a different LaBel depending on
the content of 01. How convenient if this were just a matter of

	[LBred][PRHow embarrassing!][EX]
	[LBblue][PRHow depressing!][EX]
	[LBgreen][PRHow charming!][EX]

[...] You're relegated to a prolilx series of IF's ... EndIf's. ≫

Carl--Mmm, I dunno. !.LIB's proc {is33} wouldn't be all *that*
obnoxious in that situation:


	}{if{pv13}>0}{PRHow embarrassing!}{ex}
	{ei}{if{pv13}<0}{PRHow depressing!}{ex}
	{ei}{PRHow charming!}{ex}

I lean heavily on {is33} in a multitude of circumstances.
When {is12} is empty, {is33} evaluates each char input on the fly:

Proc {is33} sorta joins C's getch and strchr:
	{ei}{sx13,@upr({is12})e{is13}}AR XH SI CI NI NO }

But yeah, xpl is imperfect and the string literal technique *is* demanding
with v3's arduous concatenation, but it solves so many problems it's
worth the hassle. When I was starting to push v3.52 xpl to see what
undocumented stuff it would do, I tried a lot of code that resembled
legal v4 concatenations--fruitlessly. I *still* can't believe v3 strings
must be assigned to variables, especially if some va$s needn't be. ...

Incidentally, proc {is34}'s lay-off of {is10} to {is44} was an
afterthought to enable nesting. Reexamining the code, I see that
the way {is34} was called needed editing--

	}{lb_FOR}{sv54,BF {gt44}[o|]}{sv84,1}{pv44}

--which lets proc {is34}'s size be reduced somewhat:

	}{pv39}{sx44,{is10}}{sv10,}NO }

============================= adpFisher  nyc