REPL working directory?

Started by borgauf, May 10, 2013, 06:29:29 PM

Previous topic - Next topic

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,


(load "link.lsp")

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


(load "/home/myhome/Programs/newlisp/link.lsp")

it works. Will I always have to tell it the entire path?

rickyboy

#1
Quote from: "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?

Like this:


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

#2
Here's the tl;dr version:



http://en.wikibooks.org/wiki/Introduction_to_newLISP/Working_with_files">//http://en.wikibooks.org/wiki/Introduction_to_newLISP/Working_with_files

rickyboy

#3
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 http://en.wikipedia.org/wiki/Dirname">dirname function of which you provided the guts).  Thanks!
(λx. x x) (λx. x x)

cormullion

#4
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... :)