list of loaded mac files



On 8/7/07, sen1 at math.msu.edu <sen1 at math.msu.edu> wrote:

> mload(filename):= block([s_1, fl_1],
>                   fl_1: opena("loaded_file_names"),
>                   s_1: load(filename), printf(fl_1, "~s", s_1),
>                   close(fl_1))$
> /* 'loaded_files()' is a command which reads the contents of
> 'loaded_file_names' into a list */

> (%i9) mload("file_name.mac");
> Hello
> (%o9)                                true
> (%i10) loaded_files();
> (%o10)                        [file_name, ., mac]

Sheldon, sorry for the late reply. I am puzzled by this.
The ~s in printf is supposed to print strings (both Lisp strings
and Maxima strings) enclosed in double quotes,
and read_list is supposed to read a quoted string as a single atom.
What is the content of loaded_file_names ?

Just to maintain a list of loaded files, it seems like it might
be enough to have something like s_1 : load(...),
loaded_files_list : cons(s_1, loaded_files_list)
i.e. maintain the list in memory instead of as a file.

best

Robert Dodier