Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!hp4nl!kunivv1!atcmpe!jc From: jc@atcmp.nl (Jan Christiaan van Winkel) Newsgroups: comp.sys.handhelds Subject: Re: User-defined libraries: how? Message-ID: <573@atcmpe.atcmp.nl> Date: 25 Mar 90 08:56:34 GMT References: <1990Mar24.150025.3405@uwslh.slh.wisc.edu> Organization: AT Computing, Nijmegen, The Netherlands Lines: 35 From article <1990Mar24.150025.3405@uwslh.slh.wisc.edu>, by lishka@uwslh.slh.wisc.edu (Chris Lishka (programmer at large) ): > Currently my HOME holds all of the functions that I need to be > globally accessible. This makes HOME sort of a cluttered mess, and I > use another directory "root" as my "virtual HOME" directory. I have posted the following before, but since you 'problem' can be solved by the things below, I repost it here: For routines that any program may need, I have created a special directory in the top directory called lib. To use the library routine, you push all the routine's arguments and it's name. the call SVC (stands for SerVice Call) which also resides in the top directory. Source for SVC follows: << PATH -> OWD // save the old directory << HOME LIB RCL // push the library routine on the stack 1 OWD SIZE FOR I // now go back to the old directory 'OWD' I GET EVAL NEXT >> EVAL // run the library routine >> If you have defined a function, say weekday, that gets a list with the date (e.g. { 1990 3 26 } ) and returns the day in the week on the stack, you would store the funtion 'WEEKDAY' in the LIB directory and you would call that function as follows: { 1990 3 26 } 'WEEKDAY' SVC Using this strategy, you don't have to store all you 'globally required' functions in the home directory.