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

Re: XY and Memory Weirdness



≪	So with a small file open my working available memory is 439k.
I'm no memory wizard, but I do thing[s] that I know will conserve it. ≫	--me

≪	(I'd dearly love to take a peek at your [500-byte] MAIL.PR3 file,
if you're willing to show it.) ≫ --Stephen A. Carter

Hi, Stephen. I can do better than that. Stripped of all commentary,
MAIL.PR3 is 181 bytes (MAIL.UUE below). It's loaded now. You and Bob
also inspired me to pare ALITTLE.HL3 to 5716 bytes.

≪	I'm having a hard time understanding how you can do so much
without more programming and save/gets. I suppose the secret is in two
runtime libraries you use. ≫

Nope. My launch state ldpms and big .kb3 allow my use of other ldpms to
be so spare. I run virtually all xpl from .kbd, and every xpl .kb3
sequence begins with &C, which records launchtime ...
	CMline-text cursor location
	CMline cp
	TI state
	va$ws &
	guillemets		 	--> 	{is111}
	CMline 				--> 	@C
&C uses two >99 s/gs and the Help frame CMline library I mentioned.
When needed,
	{is105} 			unpacks {is111}
	&0 				@C --> CMline
Come to it, &C is the only ldpm I really, really need.

≪	They're XPL code? Or XPL with PostScript? [... W]ould you mind
giving me a quick once-over of the mechanics of how these libraries work?
Or point me toward some resource where I could find out on my own? I'm
intrigued! ≫

The heavyweights use Help or (as v4 renamed it) U2 xpl. Nobody else
I know of uses the approach I do. My runtime libraries--yes, xpl--are
*functionally* equivalent to a PostScript prolog (a/k/a xyW PS driver
fb< ), or libraries "include"'d at the beginning of a C program. They
eliminate the need to write the same routine over and over, or even once,
in the same or various programs. One library is exclusively for xpl that
opens and closes files: One procedure, e.g., compares the length of a
file as reported in a dir list vs the displayed length. The other library
is general-purpose. Actually, it calls the Help CMline library frame,
retains some procedures, and overwrites those that are &C-specific. These
procs are not really a big deal. One that's retained is a partial for
loop (a true for would have a step variable and operator flexibility, but
never mind). {is24} is about as basic as programming gets:

	{sv24,{LB4}{if{pv14}>0}{pv12}{sx14,{pv14}-1}{GL4}{ei}NO }

When {is24} is pv'd, {is12} can be anything from empty, as in a sleep
loop that displays a msg briefly before exiting ...

	{sv14,640}{sv12,}{pr? unsuitable for save }{LB_4}{pv24}

... to a single char or func, as in {is21}, where {is20} is the CMline cp
and @C has just been pv'd ...

	{sx14,@siz({is00})-{pv20}}{sv12,CL }{LB_4}{pv24}

... to a complex routine to be repeated {is14} times. Rare is the program
I write that doesn't {pv24} at least once. Thus, many of my programs
start ...

	BC run !.LIB {pv00} XC
	{pv105}{lb        unpacks {is111}, getting
	}{if{pv86}>

begin 644 mail.pr3
M.U!2.PT*3$4\_S!$_S!!#0I013S_,$3_,$$-"E!'/`T*340@3DT\#0I-1"!"
M3SP-"DU$($)//@T*340@54P\#0I-1"!53#X-"DU$(%)6/`T*340@4E8^#0I-
M1"!"53P-"DU$($)5/@T*340@0E(\#0I-1"!"4CX-"DU$(%-5/`T*340@4U4^
M#0I-1"!31#P-"DU$(%-$/@T*5E4],2PQ+#$P,`T*0U<],0T*1$8@5$(],0T*
!&@
`
end
sum -r/size 10615/277 section (from "begin" to "end")
sum -r/size 57169/181 entire input file

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