Typo, in my example (car (file)) of course returns "somepath/" (contains the directory separator '/').

You can easily test the behaviour by creating a file foo.l containing the following single line:
(out NIL (prinl (car (file))))

Then start pil repl and load this file once directly without a path and once with its absolute path:
: (load "foo.l")
/
-> "./"
: (load "/home/user/foo.l")
/home/user/
-> "/home/user/"

Notice here the output is first the print and then -> prefixes the return value of the loaded script, which of course is the same string we just printed.

Am 2018-10-17 22:27, schrieb andr...@itship.ch:
So during execution of (load "somepath/somefile.l") the code (car
(file)) returns "somepath".
For this the (car (file)) has to be placed within somefile.l on top
level (code that gets executed directly during the load, not e.g. as
part of a function definition unless it is called as `read macro).

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to