Re: readline()

2008-12-05 Thread Alexander Burger
On Fri, Dec 05, 2008 at 07:24:47AM +0100, Alexander Burger wrote:
 What remains is the nasty feature that readline() does not obey the
 line's starting column. It should start at column 2 (because PicoLisp
 issues its own prompt : ).

OK, found it!

Here is the current implementation:

# 05dec08abu
# (c) Software Lab. Alexander Burger

(load @lib/gcc.l)

(gcc readline '(-lreadline) '_led)

#include readline/readline.h
#include readline/history.h

any _led(any ex __attribute__((unused))) {
   char *p;
   any x;

   rl_already_prompted = YES;
   if ((p = readline(: ))  *p)
   x = mkStr(p);
   return x;


# Enable line editing
(de *Led (_led))

# vi:et:ts=3:sw=3

Implementing TAB-completion is left as an exercise to the user :-)

- Alex

Re: readline()

2008-12-01 Thread Alexander Burger
Hi Boh Yap,

 On Mac OSX, it had problems locating the readline libs. Finally solved that
 by providing the correct path to PATH. (my readline was in

Another possibility might be to include it into the evironment variable
LD_LIBRARY_PATH. Strange that it is not found by default, as at least
the bash will use it.

 Then it encountered another error, something about
 and hence dynamic links do not work. Setting
 MACOSX_DEPLOYMENT_TARGET=10.4 got it to work.

Not sure what the correct setting is. We had this discussion before, in
personal mails in the initial phase of porting to Mac OS, and also in

 I added this to the readline.l file.

export PATH

Where exactly? I would not expect this to have any effect.

I'd also be interested to get readline() to work, now that we have it
partially ;-)

- Alex