Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CACHE problems

17 views
Skip to first unread message

Al Arduengo

unread,
Jan 4, 1999, 3:00:00 AM1/4/99
to
Hello everyone,
I have encountered a strange development. Months ago I made some changes to
exAL which dealt with saving the stack during parsing of a string object. My
intent was to preserve the stack contents incase the palparse failed due to an
invalid object. Well, strangely enough, even after this method was successful
for all this time, now it does not work. I received a message from a user who
said he could no longer enter objects into a cell as the program errored out.
I traced the problem to the routine that parses the string object to be used.
The offending piece of code is as follows:

...
DUP
{
LAM EQ_
}
BIND
DEPTH
NULLLAM <-- failure occurs here
CACHE
LAM EQ_
palparse
ITE
...
NULLLAM
DUMP
...
;

I am sure I used the proper syntax for CACHE and I double checked it just now.
But now calling NULLLAM fails with "Undefined Local Variable". I know it
worked before because I just used it a few days ago. And the user who reported
the bug says he was using it all day and all of the sudden it stopped working
correctly. I made NO changes to the code, flags or any other aspect of the
calc prior to this problem. Has anyone had this happen? Or does anyone know of
what might have caused it to suddenly occur? Also, any ideas of a fix?

Thanks in advance,
-Al

--
Al Arduengo
Media Processing and Platforms Division Digital Audio Product Engineering
Motorola, Inc. - Austin TX
Phone: (512) 895-8690 Fax: (512) 895-8719 Pager: 1-800-SKYTEL2 #1386420

werner_h...@my-dejanews.com

unread,
Jan 5, 1999, 3:00:00 AM1/5/99
to
In article <3691027E...@email.sps.mot.com>,
Al Arduengo <ra8...@email.sps.mot.com> wrote:

> But now calling NULLLAM fails with "Undefined Local Variable".

Al,
he switched off LASTARG, no doubt.
If LASTARG is OFF, NULLLAM *does not exist* and you
have to do :
' NULLLAM
CACHE
instead, which you should have done in any case.
Arnold Moy's Matrix 1.2 has exactly the same problem, try launching
it with LASTARG disabled..

--
Best Regards,
Werner Huysegoms
Reply-To: werner.h...@dgx11.cec.be
remove the x before replying

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Mika Heiskanen

unread,
Jan 5, 1999, 3:00:00 AM1/5/99
to

werner_h...@my-dejanews.com writes:

>In article <3691027E...@email.sps.mot.com>,
> Al Arduengo <ra8...@email.sps.mot.com> wrote:

>> But now calling NULLLAM fails with "Undefined Local Variable".

>he switched off LASTARG, no doubt.


>If LASTARG is OFF, NULLLAM *does not exist* and you
>have to do :
> ' NULLLAM
> CACHE
>instead, which you should have done in any case.
>Arnold Moy's Matrix 1.2 has exactly the same problem, try launching
>it with LASTARG disabled..

Any fixed address object will do. We have used system binaries such
as ZERO in Alg48 precisely to avoid using ' before a lambda variable.

--
---
--> Mika Heiskanen mhei...@gamma.hut.fi http://www.hut.fi/~mheiskan

werner_h...@my-dejanews.com

unread,
Jan 5, 1999, 3:00:00 AM1/5/99
to
In article <m4msodq...@opaali.hut.fi>,

? Didn't know you could do that. Thanks, great trick.

Balazs Fischer

unread,
Jan 5, 1999, 3:00:00 AM1/5/99
to Mika Heiskanen
---===> Quoting Mika Heiskanen to werner_h...@my-dejanews.com <===---


>>he switched off LASTARG, no doubt.
>>If LASTARG is OFF, NULLLAM *does not exist* and you
>>have to do :
>> ' NULLLAM
>> CACHE
>>instead, which you should have done in any case.
>>Arnold Moy's Matrix 1.2 has exactly the same problem, try
>>launching it with LASTARG disabled..

MH> Any fixed address object will do. We have used system binaries
MH> such as ZERO in Alg48 precisely to avoid using ' before a lambda
MH> variable.

And why is ' before a NULLLAM bad?

cu

Balazs Fischer

Balazs....@studbox.uni-stuttgart.de
PGP Key: http://pgp5.ai.mit.edu:11371/pks/lookup?op=get&search=0xED7447E5
Fingerprint: 8F EF C0 BA 22 B4 15 B3 56 27 07 04 37 7B D6 00
Encrypted mail preferred

... When all else fails, consult Jack Daniels.

Mika Heiskanen

unread,
Jan 5, 1999, 3:00:00 AM1/5/99
to

Balazs....@studbox.uni-stuttgart.de (Balazs Fischer) writes:

>MH> Any fixed address object will do. We have used system binaries
>MH> such as ZERO in Alg48 precisely to avoid using ' before a lambda
>MH> variable.

>And why is ' before a NULLLAM bad?

It takes 5 extra nibbles as compared to simply using a pointer
to a ROM data class object.

Here are the actual uses of CACHE in Alg48:

a) #TWO#TWO CACHE 4 times

Here we are binding 2 objects. By using TWO has the 'lambda
variable' we have saved 5 further nibbles by being able to
use a single command both for the size and the name. This
saves a total 10 nibbles compared to TWO ' NULLLAM CACHE.

For those interested, one can also bind 5 and 3 objects using
the entries #FIVE#FOUR and #THREE#FOUR.

b) FALSE CACHE 1 time

Checking the timings I once did on a GX:

ZERO 0.391 ticks
%0 0.382
%%0 0.382
C%1 0.390
C%%1 0.389
CHR_A 0.389
NULL$ 0.390
NULLHXS 0.388
NULL{} 0.389

The actual machine language is identical, ignoring the fluctuations
in timings the difference is that %0 and %%0 are at even
addresses, the rest are at odd addresses.

Checking further in the list:

TRUE 0.367 DROPTRUE 0.403
---> FALSE 0.369 DROPFALSE 0.397
FalseTrue 1.711 2DROPFALSE 1.624
TrueFalse 1.708 SWAPTRUE 1.955
TrueTrue 1.706 SWAPDROPTRUE 1.836
FalseFalse 1.711 XYZ>ZTRUE 1.849
failed 1.712

Hmm, since FALSE and TRUE are at even and odd addresses, there
probably is a true difference (won't count the cycles), meaning
I probably should have used TRUE CACHE instead.

werner_h...@my-dejanews.com

unread,
Jan 5, 1999, 3:00:00 AM1/5/99
to
In article <028c...@studbox.uni-stuttgart.de>,

Balazs....@studbox.uni-stuttgart.de (Balazs Fischer) wrote:
>
> And why is ' before a NULLLAM bad?
>

Because it uses up 5 nibbles of Precious Space. If you use NULLLAM to
create an unnamed temporary environment, you must quote it, because it
will fail if LASTARG is off - but apparently any fixed address ob will
do, and ZERO is half as long as ' NULLLAM. Add it to 'Tips and Techniques'.

Al Arduengo

unread,
Jan 5, 1999, 3:00:00 AM1/5/99
to mhei...@alpha.hut.fi
Hi Mika and everyone interested,

Indeed, for some reason I had managed to disable STK mode. Enabling this fixed
the problem. Before doing this I tried to use ' to suspend NULLLAM which
worked for CACHE however when I called NULLLAM followed by DUMP the calc hung
on me. I suppose I just didn't understand how CACHE was supposed to work.
Thanks to all for answering.

-Al

Mika Heiskanen wrote:
>
> Balazs....@studbox.uni-stuttgart.de (Balazs Fischer) writes:
>
> >MH> Any fixed address object will do. We have used system binaries
> >MH> such as ZERO in Alg48 precisely to avoid using ' before a lambda
> >MH> variable.
>

> >And why is ' before a NULLLAM bad?
>

--

NORSISTEMAS

unread,
Jan 5, 1999, 3:00:00 AM1/5/99
to

> ...
> DUP
> {
> LAM EQ_
> }
> BIND
> DEPTH
> NULLLAM <-- failure occurs here
> CACHE
> LAM EQ_
> palparse
> ITE
> ...
> NULLLAM
> DUMP
> ...
> ;

Hi Al,
Have you tried to put a ' before NULLLAM?
If you don't, then NULLLAM is executed, and it tries to recall the contents
of a non-existing variable, thus that "Undefined Local Variable"

try this:

...


{
LAM EQ_
}
BIND
DEPTH
'
NULLLAM <-- failure occurs here
CACHE
LAM EQ_
palparse

...


About the program working fine a few days ago, I don't know the reason, but
in my HP48SX rev J, I can't use some of my programs with NULLLAMs if the
LASTARG is disabled (but some others work fine...), and don't ask me why
because I haven't found the answer in 6 years!!

Hope this helps

Daniel Lopez


> I am sure I used the proper syntax for CACHE and I double checked it just
now.
> But now calling NULLLAM fails with "Undefined Local Variable". I know it
> worked before because I just used it a few days ago. And the user who
reported
> the bug says he was using it all day and all of the sudden it stopped
working
> correctly. I made NO changes to the code, flags or any other aspect of
the
> calc prior to this problem. Has anyone had this happen? Or does anyone
know of
> what might have caused it to suddenly occur? Also, any ideas of a fix?
>
> Thanks in advance,
> -Al
>

0 new messages