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]

Reply via email to