newLISP Fan Club

Forum => newLISP and the O.S. => Topic started by: borgauf on May 10, 2013, 06:29:29 PM

Title: REPL working directory?
Post by: borgauf on May 10, 2013, 06:29:29 PM
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?
Title: Re: REPL working directory?
Post by: rickyboy on May 10, 2013, 06:57:14 PM
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"
Title: Re: REPL working directory?
Post by: cormullion on May 11, 2013, 12:11:49 AM
Here's the tl;dr version:



//http://en.wikibooks.org/wiki/Introduction_to_newLISP/Working_with_files
Title: Re: REPL working directory?
Post by: rickyboy on May 12, 2013, 11:13:37 AM
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 (//http) function of which you provided the guts).  Thanks!
Title: Re: REPL working directory?
Post by: cormullion on May 12, 2013, 12:02:39 PM
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... :)