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

Re: NR (no ruler)



Carl wrote:
Here's a routine that sets default NW
Yes, that's just what I gathered from the pseudo-code. I guess I've been
using PV for so many years only to *display* a s/g's value that I forgot it
can also execute it. I think GT has a double role in that regard, too, IIRC.
If the program has a single EXit point, simply writing
BX d nw=Q2  is fine, perhaps preferable. If the routine has
multiple EXit points, though, it's more efficient to manufacture the
subroutine and do wherever necessary. There are, of course, other ways to skin the cat. . . .
What I do for multiple exit points is define a LaBel  with all the
cleaning up needed and an . Then I make all the exit points go to it
(GLzz). This strategy also allows for economically having levels of
"cleanup" depending on what triggered the exiting--just add more labels.
Usually one LaBel suffices, but occasionally I need two. I give three here
(baroquely) just to illustrate.

E.g.,
PR
BX d nw=Q2>
BC 
and execute it with  -- or , take your pick. (The reverse
does not hold, however. If you use  to manufacture your
code, you MUST use  to execute it;  would simply print the
code to screen.) More conventional still (and wasteful of resources)
would be to save the current value to one S/G, >, and use
another S/G for the SUbroutine, thus: Q2 >. But
that needlessly multiplies the number of S/Gs (two versus one) and
bloats the code. Ockham's razor skins the cat best.
Yes, I'm writing in my book now about the need for "unit
economy"--extremely important in Objectivist epistemology.
> I'm confused about what's inside or outside a S/G--and why.

I hope this helps. But, really, Harry, to get a firm grasp on these
basic -- and powerful -- concepts, there's no substitute for the
horse's mouth: you've got to peruse Robert's ground-breaking texts,
CTRLCHAR.TXT

God, read that ages ago.
and KBD-PM.TXT

I don't recall that one, but I'll check it.
 -- especially CTRLCHAR.TXT. They're the
magna carta of XPL technique, and they've been around for two decades,
yet it never ceases to amaze me how many serious XyWriters are
unfamiliar with these essential texts.
Thanks. I think my issue was, as I said at the beginning, never using PV to
execute only to display--I faintly recall from the 80s, back when I learned
XPL, that PV executes, but I've never used it that way. When I want to
execute, I just drop the command into the code. But storing 3-byte function
calls in S/Gs and then using  seems equivalent to doing a
subroutine--with the SU ... GT pair

I'm wondering what the difference is between:
>+Q2 >
and
>Q2 >
AHA--you can't use 01 twice in the latter, and that's why you say it saves a S/G assignment. Now why can't you have SU01 refer to S/G 01? Is it something about subroutines not having the same "pointers" or "handles" as the S/Gs? I guess it's not really that important. What's important is that your SaVed version runs and my SUbroutine version doesn't (without introducing a new S/G).
BTW, I couldn't get your version of the SUbroutine to work. Is there a typo
or something in this:
XPLeNCODE v2.0
b-gin [UNTITLED]
[BX_]d nw=3[Q2_];*;[cr|lf]{<}SX01,{<}VA$NW{>}{>};*;[cr|lf][BX
_]d nw=1[Q2_];*;[cr|lf]{<}SX03,{<}VA$NW{>}{>};*;[cr|lf]{<}SX1
1,"The old is "+{<}IS01{>}+" and the new is "+{<}is03{>}{>};*
;[cr|lf]{<}PR@11{>};*;[cr|lf][BX_]p 3[Q2_];*;[cr|lf]{<}SU15,"
[BX_]d nw="+{<}IS01{>}+"[Q2_]"{>};*;[cr|lf]{<}GT15{>};*;[cr|l
f]{<}SX03,{<}va$nw{>}{>};*;[cr|lf]{<}SX11,"now should be back
 to "+{<}is01{>}+"--it's "+{<}is03{>}{>};*;[cr|lf]{<}PR@11{>}
;*;[cr|lf]
-nd
XPLeNCODE

This is all fascinating. Thanks so much, Carl.


Harry Binswanger
hb@xxxxxxxx