[erlang-questions] Writing my own REPL

Attila Babo babo.online@REDACTED
Sat Sep 27 23:01:53 CEST 2008


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
>%



More information about the erlang-questions mailing list