[comp.sys.handhelds] editing HP-48sx directories, and the original copy

peraino@gmu90x.gmu.edu (peraino) (06/14/90)

>From brian@fog.ann-arbor.mi.us Wed Jun 13 23:10:42 1990
>
>On page 124 of the HP48SX manual at the bottom it says "If you recall a
>directory to the stack, and then change that copy on the stack, the
>actual directory object changes, as well."
>
>I interpretted this to mean that if I were to recall a directory to the
>stack and modify the directory object on the stack, then the actual
>directory changes as well.  This makes no sense to me.  Why would it
>do this?  Furthermore, I tried it and it didn't do what I described above.
>
>Brian S. Schang   N8FOG          brian@fog.ann-arbor.mi.us


     Normally, when you recall an object to the stack, the system
creates a pointer to the original object in memory. When you modify the
object (pointer) on the stack, the system is forced to create a new copy
of the original object and change the stack pointer to that new pointer,
to keep the appearance that you were always working with a separate copy.
This is all done in the interest of efficiency. If the system really
had to generate a new copy every time an object is referenced to the stack,
the system would be a dog.
     Directories are a different story because they can be any size, and in
fact temd to be very large. Remember, when you reference a directory, it
includes all of the subdirectories subordinate to it, thus the object
can, and tends to be, quite large. HP probably  made an exception with
the directory object (when you edit the stack you edit the original)
because copying the whole directory (and subordinates), in terms of
space management, efficiency, etc., would be a mess, and 90 percent
of the time you would run out of memory if the structure you were
attempting to edit was large. Combine this with the fact that editing
a directory is probably not something you would do very often, and
I think they made the right decision. When I read that section of the
manual, I remember thinking, "Yes, that makes sense, and that's the right 
thing to do."

     Of course, this is all theory based on observation on my part,
but it sounds damned good to me. Bill?





-----------------------------------------------------------------------------
       Bob Peraino                   UUCP    : uunet!pyrdc!gmu90x!peraino
 George Mason University             INTERNET: peraino@gmuvax.gmu.edu
UCIS, Thompson Hall, rm 2 <-         BITNET  : peraino@gmuvax
  4400 University Drive     \        PHONE   : (703)-323-2549
   Fairfax, VA  22030        \- Yeah, they put us in the basement, too.
-----------------------------------------------------------------------------