hi Alex,

thanks for your prompt reply and help.

Tried the solution below, but it gave me errors:

Had a few problems with readline.l, on OS X. Posting here in case someone else
needs help.
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/').

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.
Its strange,  but this same error happened whn compiling picolisp.

I added this to the readline.l file.
   PATH=/sw/include/readline:/usr/include/readline:/usr/local/lib/readline:$PATH
   export PATH

This need to be in my ~/.profile:
  MACOSX_DEPLOYMENT_TARGET=10.4
  export MACOSX_DEPLOYMENT_TARGET

When I fired up '$ p readline.l', it seems to work... but
history does not work, as you noted. Can't really help here.

PS Actually I would have been happy with ed.l, I misread/missed the
docs, about ed.l
being in dbg.l! Most of the time I ran picolisp without dbg.l, so I
had no line editing
on the picolisp console, very frustrating.

Thanks again for the help. Would like to try readline.l again once its
working...

On Sat, Nov 29, 2008 at 4:07 PM, Alexander Burger <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Boh Yap asked me a few days ago about using readline() with PicoLisp.
> (He now also subscribed to this list. Welcome, Boh Yap!)
>
> I had never bothered about readline(), as I felt perfectly comfortable
> with "lib/led.l". But, on the other hand, just having an incomplete 'vi'
> mode might not be enough for some people.
>
>
> So I sent him a quick hack:
>
> ################################################################
> # 27nov08abu
> # (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 = readline("");
>   any x = mkStr(p);
>   free(p);
>   return x;
> }
>
> /**/
>
> # Enable line editing
> (de *Led (_led))
>
> # vi:et:ts=3:sw=3
> ################################################################
>
> Make sure that you have a readline development package (like
> "libreadline5-dev") installed.
>
>
> Basically, it works
>
>   $ ./p readline.l
>
> but somehow not as I would expect. Though I can edit and execute lines,
> the history seems not available, and perhaps other things, too.
>
> Does anybody have experiences with readline()?
>
> Any other comments or tips?
>
> If we get it to run fine, I will put it into the official release as
> "lib/readline.l". It could then be used as a replacement for "lib/led.l"
> in "dbg.l", for example.
>
> Cheers,
> - Alex
> --
> UNSUBSCRIBE: mailto:[EMAIL PROTECTED]
>
-- 
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]

Reply via email to