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

Erasing All Variables in a Directory

1 view
Skip to first unread message

Marturo

unread,
Sep 5, 2002, 4:19:14 PM9/5/02
to
Lately when I work with my HP49 I get to many variables like ppar y1
y2 and stuff like that, so i tried to design a program in sysrpl to
erase all the variables but the program it self, but I can't make it
work, it always erases all the variables.

::
Dovars
(here the comand that explodes the list and puts the number of
objects, I don't remeber it now: FPTR 6 158)
Bint0
Do
Dup
' Id CLN (this is the name of the variable where the program is
stored)
EQ
ITE
:: drop ;
:: purge ;

Loop

I think that the problem is the way I compare the variables' name.

Any body has some ideas?

Marturo

"UBI DUBIDUM IBI LIBERTAS"

Steen Schmidt

unread,
Sep 5, 2002, 4:35:16 PM9/5/02
to
> EQ

Use EQUAL. EQ only compares bints, and returns false on all other object
types, even though two may be identical.

Regards
Steen

John H Meyers

unread,
Sep 6, 2002, 6:37:28 AM9/6/02
to Marturo
Marturo wrote:

> when I work with my HP49 I get too many variables like ppar y1 y2
> and stuff like that, so I tried to design a program in sysrpl
> to erase all the variables but the program itself.

Here's a very dangerous user program which can reside in a directory,
which will clear every variable but itself
(so don't store it in HOME, for heaven's sake ;)

\<< 15 TVARS '~' + PGDIR 'ZAP' DUP RCL CLVAR SWAP STO \>> 'ZAP' STO

Like the nitroglycerin which my high school buddies
easily made in chemistry lab, however, or the nuclear cores,
chemical wastes, climate and genetic changes, etc. which governments
and industries have manufactured and now are stuck with,
now the new problem is how to get rid of it,
to prevent the unfortunate destructive consequences of not doing so.

But perhaps we could sidestep this problem
by not creating it for ourselves in the first place,
except only as a [misguided] training exercise.

Note that these calculators permit the creation of subdirectories;
when we work in a subdirectory,
all variables in its parent directory(ies) remain accessible by name,
as with a "path" in Unix or MS-DOS, or a "searchlist" in other systems.

So, create an empty directory, e.g. 'MYDIR' CRDIR

Then go into that empty directory (just press the MYDIR menu key).

Then solve equations and create many variables;
when you want to delete them all, just type CLVAR.

CLVAR deletes all variables in the current directory,
but it leaves all parent directories alone.

This accomplishes the goal that you wanted;
there are many extra tools that we could also make and use
when we don't bother making ourselves a subdirectory,
such as "clean solvers" and the like, which you have to
keep remembering to always use to make them effective,
but to me, the ultimate tool is just to take advantage
of the built-in capabilities, when there's no need to do more.

It is often equally not realized that every living entity
(and society) has native capabilities that can accomplish its goals,
without creating its own obstacles and then losing itself in
the task of making greater efforts to solve the self-created problems.

There is nothing more practical in the world than finding
the best "native" way to accomplish the ultimate goals that
people really want, and that's just what we do at our university.

"I simply say to you that we have the metaphysical mind
apprehending, comprehending, and ordering the physical.
The physical tending to be disorderly and the metaphysical
apprehending, comprehending, and putting together. Man, therefore,
represents the very clearly demonstrated function in the universe
that is essential to the regeneration of the universe."

R. Buckminster Fuller, Approaching the Benign Environment, 1970.
Q171.F96 on your library shelf, if you have a well-stocked library.

A different perspective on all of history; past, present, and future.


Here also are the first paragraphs of Fuller's
"Operating Manual for Spaceship Earth"
http://www.bfi.org/operating_manual.htm

"I am enthusiastic over humanity's extraordinary and sometimes
very timely ingenuities. If you are in a shipwreck and all the boats
are gone, a piano top buoyant enough to keep you afloat that comes
along makes a fortuitous life preserver. But this is not to say that
the best way to design a life preserver is in the form of a piano top.

I think that we are clinging to a great many piano tops in accepting
yesterday's fortuitous contrivings as constituting the only means for
solving a given problem. Our brains deal exclusively with special-case
experiences. Only our minds are able to discover the generalized
principles operating without exception in each and every
special-experience case which if detected and mastered
will give knowledgeable advantage in all instances.

Because our spontaneous initiative has been frustrated,
too often inadvertently, in earliest childhood, we do not tend,
customarily, to dare to think competently regarding our potentials.

We find it socially easier to go on with our narrow, shortsighted
specializations and leave it to others -- primarily to the
politicians -- to find some way of resolving our common dilemmas."

Note that in the second paragraph, Fuller has already distinguished
"mind" (metaphysical, which we call consciousness)
from "brain" (physical), after which I can only think
to repeat the first Fuller quote:

"I simply say to you that we have the metaphysical mind
apprehending, comprehending, and ordering the physical.
The physical tending to be disorderly and the metaphysical
apprehending, comprehending, and putting together. Man, therefore,
represents the very clearly demonstrated function in the universe
that is essential to the regeneration of the universe."

This is exactly what we experience, what we apply to education,
and what we apply to the entire world around us.

G'day!

http://www.mum.edu


.


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----

Thomas Rast

unread,
Sep 6, 2002, 7:30:46 AM9/6/02
to
Marturo wrote:
>
> I think that the problem is the way I compare the variables' name.

Exactly. EQ compares just the memory address of the two objects. I.e.

#5555 DUP EQ ( returns TRUE )
#5555 #5555 EQ ( FALSE )
#5555 #5555 EQUAL ( TRUE )

Note that you cannot do this with built-in BINTs like BINT0.

Greetings
Thomas

--
Thomas Rast <t.r...@freesurf.ch>
"If you cannot convince them, confuse them."
-- Harry S. Truman

0 new messages