nptcl / npt

ANSI Common Lisp implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LOAD-PATHNAME*, *LOAD-TRUENAME*

snmsts opened this issue · comments

reference http://www.lispworks.com/documentation/HyperSpec/Body/c_system.htm

;;;load.lisp
(print *default-pathname-defaults*)
(print *load-pathname*)
(print *load-truename*)
$ npt --quit --load load.lisp 

#p"" 
NIL 
NIL 
$ ros -L sbcl-bin --load load.lisp --quit

#P"/home/snmsts/work/npt/Loop/" 
#P"/home/snmsts/work/npt/Loop/load.lisp" 
#P"/home/snmsts/work/npt/Loop/load.lisp" 
$ ros -L ccl-bin --load load.lisp --quit

#P"" 
#P"load.lisp" 
#P"/home/snmsts/work/npt/Loop/load.lisp" 

for scripting purpose it is nice to have *load-pathname* set. :)

commented

Now making Variable *LOAD-PATHNAME*, *LOAD-TRUENAME* code,
but Function LOAD is not completely implemented yet.
There might be more issues in Function LOAD.

Testcase
https://github.com/nptcl/npt/blob/master/test/rt-system.lisp

$ npt --quit --load load.lisp

#p""
#p"load.lisp"
#p"load.lisp"

Thank you.
hmm... for me this feature is how to find the script file's absolute path... so this implementation is not so helpful...

commented

Fix the TRUENAME and LOAD function.
LOAD function set the absolute pathname or NIL to *LOAD-TRUENAME* variable in POSIX mode and Windows mode.

$ npt --quit --load load.lisp

#P""
#P"load.lisp"
#P"/usr/home/nptcl/git/npt/src/load.lisp"

$ npt
* (truename "load.lisp")
#P"/usr/home/nptcl/git/npt/src/load.lisp"
Testcase
  test/rtsystem-load1.lisp
    *load-truename*.4
  test/rtsystem-load2.lisp
    *load-truename*.7

sorry to keep it open..