[erlang-questions] Writing my own REPL

Robert Virding <>
Sat Sep 27 23:14:20 CEST 2008


Thank you, that is exactly what I am after.

As an aside, I just googled rlwrap and on the same page as the first
reference to it there was also a description of Emacs midi-input mode for
taking input from a midi keyboard and writing it in a readable form in a
buffer. :-)

Robert

2008/9/27 Attila Babo <>

> This minimal wrapper starts a custom shell as you requested and ^G
> works nicely. With Robert's hacked user_drv it's more convenient to
> start multiple copies of your own shell. With rlwrap it's pretty
> usable. :-)
>
> Is this what are you guys after?
>
> Cheers:
> Attila
>
> -------------
> -module(lfe_wrap).
> -export([start/0]).
>
> start() ->
>    user_drv:start(['tty_sl -c -e',{lfe_shell,start,[]}]).
>
> ---------------
>
> erl -noshell -noinput -s lfe_wrap start  -pa ebin .
> Erlang (BEAM) emulator version 5.6.4 [source] [smp:2]
> [async-threads:0] [kernel-poll:false]
>
> LFE Shell V5.6.4 (abort with ^G)
> >(+ 1 2)
> 3
> >
> User switch command
>  --> s lfe_shell
>  --> j
>   1  {lfe_shell,start,[]}
>   2* {lfe_shell,start,[]}
>  --> c 2
> LFE Shell V5.6.4 (abort with ^G)
> >(+ 3 4)
> 7
> >
> User switch command
>  --> c 1
> (: c q)
> ok
> >%
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080927/ffb1143d/attachment.html>


More information about the erlang-questions mailing list