REPL working directory?

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
borgauf
Posts: 3
Joined: Thu May 09, 2013 1:55 am

REPL working directory?

Post by borgauf »

When in Emacs, if I start newlisp mode, then call up a NL REPL, how can I find out what the REPL's "working directory" is? For example,

Code: Select all

 (load "link.lsp")
gives an error, but if I copy link.lsp to a ./newlisp directory, and give the full path:

Code: Select all

 (load "/home/myhome/Programs/newlisp/link.lsp")
it works. Will I always have to tell it the entire path?

rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Re: REPL working directory?

Post by rickyboy »

borgauf wrote:When in Emacs, if I start newlisp mode, then call up a NL REPL, how can I find out what the REPL's "working directory" is?
Like this:

Code: Select all

newLISP v.10.4.5 on OSX IPv4/6 UTF-8 libffi, execute 'newlisp -h' for more info.

> (real-path)
"/Users/rickyboy"
(λx. x x) (λx. x x)

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Re: REPL working directory?

Post by cormullion »


rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Re: REPL working directory?

Post by rickyboy »

Nice, cormullion! I'm almost sure you wrote this. Great job, I'm freely stealing code from this page and I'm going to pawn it off as my own. :) Seriously, nice resource and I have already plugged in some of it in my own stuff (e.g. I needed a dirname function of which you provided the guts). Thanks!
(λx. x x) (λx. x x)

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Re: REPL working directory?

Post by cormullion »

Yes, I did the bad bits, and some of the good bits, the rest of the good bits are from other contributors... And the examples ran correctly for one version of newLISP, even if they've broken since then... :)

Locked