# This file makes our library packages from the Maple source # the directory containing the libraries libpath := `/afs/eos.ncsu.edu/users/k/kaltofen/www/courses/LinAlgebra/Maple`; # the root directory for the source files srcpath := cat(libpath , `/refpkg/Src`); # initialize the Maple library management global variables libname := libpath , libname; savelibname := libpath; readlib(makehelp): # the refpkg package print(`Making refpkg...`); refpkg := table([]): # guard against previous assignment # generic procedure for generating the package definitions make_pkg_procs := proc() global refpkg; local proc_name, # name of the procedure to be saved file, # name of the source file nr_procs, i; # used for processing multiple args # process argument list if nargs < 2 then # it is assumed that args[1] is the proc name # and that its def is in src_path . `/` . args[1] . `.mpl` file := args[1]; nr_procs := 1; else # it is assumed that the last argument contains the file name # in the source directory without .mpl and .mws and that # args[1],...,args[nargs-1] are the procedures defined there file := args[nargs]; nr_procs := nargs-1; fi; read(cat(srcpath , `/` , file , `.mpl`)); for i from 1 to nr_procs do proc_name := args[i]; if type(proc_name, list) # proc has separate *.mws documentation # must come in order after those with default doc file then file := proc_name[2]; proc_name := proc_name[1]; fi; # convert assigned procedurs to customary refpkg/proc_name.m procedures `refpkg/` || proc_name := eval(refpkg[proc_name]); save `refpkg/` || proc_name, cat(libpath , `/refpkg/` , proc_name , `.m`); # reassign package table to readlib command refpkg[proc_name] := evaln(readlib(`refpkg/` || proc_name)); print(`Made ` || proc_name); # store help ws in handbook makehelp(cat(`refpkg,` , proc_name), cat(srcpath , `/` , file , `.mws`), libpath); makehelp(proc_name, cat(srcpath , `/` , file , `.mws`), libpath); print(cat(`Made help for ` , proc_name)); od; end: make_pkg_procs(`ref`); make_pkg_procs(`mysolve`); make_pkg_procs(`xref`); make_pkg_procs(`E_I`, `E_II`, `E_III`, `elem_mats`); make_pkg_procs(`myinverse`, [`mydet`, `mydet`], `myinverse`); # store package table save refpkg, cat(libpath , `/refpkg/refpkg.m`); protect(refpkg): print(`Finished with refpkg`);