Newbie question on REPL prompt

Notices and updates
Locked
ski
Posts: 6
Joined: Fri Sep 22, 2006 6:11 am
Location: Kirkland, WA, USA
Contact:

Newbie question on REPL prompt

Post by ski »

Hi,

Is there any way to get readline functionality in the REPL prompt (e.g. so I could press the arrow key to get the last command and so I can edit a line without the left and right arrow keys (like in the bash shell)). In many cases I find it easier to try things out from the command line with newlisp -e just because I can easily correct my mistakes.

cheers,

ski

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

Post by cormullion »

Which platform are you using? I know that there's "readline" available, since I have it on my (MacOS X) system.

pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Post by pjot »

Hi ski,

If you are using Linux, you can recompile newLisp with READLINE support. For this, you have to edit the file 'makefile_linux' as follows:

Code: Select all

OBJS = newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o \
	nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o pcre.o

CFLAGS = -Wall -pedantic -Wno-uninitialized -Wno-long-long -c -O2 -g -DREADLINE -DLINUX

CC = gcc

default: $(OBJS)
	$(CC) $(OBJS) -g -lm -ldl -lreadline -lncurses -o newlisp
	strip newlisp
Now run 'make clean; make' and you'll have what you want.

Peter

ski
Posts: 6
Joined: Fri Sep 22, 2006 6:11 am
Location: Kirkland, WA, USA
Contact:

Post by ski »

Perfect. I am using linux. I will recompile the source.

Thanks.

Locked