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)
  add_history(p);
   x = mkStr(p);
   free(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 :-)

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]


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
 '/usr/local/lib/readline/').

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
 MACOSX_DEPLOYMENT_TARGET=10.1,
 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
http://www.mail-archive.com/picolisp@software-lab.de/msg00053.html


 I added this to the readline.l file.

 PATH=/sw/include/readline:/usr/include/readline:/usr/local/lib/readline:$PATH
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 ;-)

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]