dirname wanted

Started by scratchy, August 16, 2004, 06:43:38 AM

Previous topic - Next topic

nigelbrown

#15
I note:

[nigel@p800 nigel]$ clisp

  i i i i i i i       ooooo    o        ooooooo   ooooo   ooooo

  I I I I I I I      8     8   8           8     8     o  8    8

  I   `+' /  I      8         8           8     8        8    8

     `-+-'  /       8         8           8      ooooo   8oooo

    `-__|__-'        8         8           8           8  8

        |            8     o   8           8     o     8  8

  ------+------       ooooo    8oooooo  ooo8ooo   ooooo   8

 

Copyright (c) Bruno Haible, Michael Stoll 1992, 1993

Copyright (c) Bruno Haible, Marcus Daniels 1994-1997

Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998

Copyright (c) Bruno Haible, Sam Steingold 1999-2000

Copyright (c) Sam Steingold, Bruno Haible 2001-2004

 

 

[1]>  (directory-namestring *LOAD-PATHNAME*)

""

[2]>



and from newlisp



> (exec "dirname $0")

(".")



both in Mandrake 9.1 - they don't seem to add much?



Nigel



PS re *LOAD-PATHNAME* it looks loke a load into the lisp

environment is needed to set it - not the starting of lisp itself?

viz: from hyperpsec

Variable *LOAD-PATHNAME*, *LOAD-TRUENAME*



Value Type:





The value of *load-pathname* must always be a pathname or nil. The value of *load-truename* must always be a physical pathname or nil.





Initial Value:





nil.





Description:





During a call to load, *load-pathname* is bound to the pathname denoted by the the first argument to load, merged against the defaults; that is, it is bound to (pathname (merge-pathnames filespec)). During the same time interval, *load-truename* is bound to the truename of the file being loaded.

scratchy

#16
Of course, in an interactive session *LOAD-PATHNAME* is meaningless.

nigelbrown

#17
Hi Scratchy,

Could you post clisp code that uses/prints it?

I can't get it to return anything non-interactive viz if test2.lsp



(load "/home/nigel/test.lsp")

 (defconstant *script-dir* (directory-namestring *LOAD-PATHNAME*))

(print "Value is <")

(print *script-dir*)

(print ">")

(exit)



I get



[nigel@p800 nigel]$ clisp test2.lsp

 

"Value is <"

""

">"

[nigel@p800 nigel]$



same if test2.lsp is



 (defconstant *script-dir* (directory-namestring *LOAD-PATHNAME*))

(print "Value is <")

(print *script-dir*)

(print ">")

(exit)



Nigel