[erlang-questions] Some ideas for the shell.
Radosław Szymczyszyn
lavrin@REDACTED
Mon Dec 4 13:58:16 CET 2017
> One of the comments on it was asking for documentation access too, as the Python REPL has been offering for some time.
"Some time" like, hmmm, almost 20 years? ;) There's a PEP on docstring
conventions from 2001 [1]. I assume that docstrings as a language
feature predate the conventions PEP, but I don't really know when they
had been introduced.
[1]: https://www.python.org/dev/peps/pep-0257/
Anyway, I've authored a shell documentation access tool for erl, which
currently is "good enough" for my daily use:
https://github.com/erszcz/docsh
It provides EDoc docs, function specs, and type definitions with
one-letter helper functions. It can be installed directly with an
install.sh or with kerl which now has an 'install-docsh' subcommand.
The cost is sacrificing one's own user_default.erl and $HOME/.erlang
customizations (or, if one really wants to, doing some work on merging
the stuff required by docsh with personal modifications - and there's
documentation telling exactly what needs to be done).
The caveat is that it doesn't (yet) work with Erlang 20 due to new
Abst chunk format. Alas, my time is finite, and I'm working on this
thing outside my job.
2017-12-04 11:48 GMT+01:00 Pierre Fenoll <pierrefenoll@REDACTED>:
> On the REPL enhancements wishlist train, I have opened an issue on the bug
> tracker a while ago to add tab completion for variable names.
> One of the comments on it was asking for documentation access too, as the
> Python REPL has been offering for some time.
>
> Since some things may be undesirable on production REPLs, maybe a flag that
> can be set from a rebar3 profile can help toggle some features thus allowing
> more enhancements for dev REPLs.
>
> On Mon 4 Dec 2017 at 08:22, bengt e <cean.ebengt@REDACTED> wrote:
>>
>> Greetings,
>>
>> Is 2) similar enough to file:consult/1, to maybe warrant it to be called
>> 'consult' instead?
>>
>> bengt
>>
>> On Mon, Dec 4, 2017 at 1:09 AM, Richard A. O'Keefe <ok@REDACTED>
>> wrote:
>>>
>>> There are two things that would make life easier for me using the
>>> Erlang shell, and I thought I'd ask for thoughts here before writing
>>> them up as EEPs.
>>>
>>> (1) import(Module, Functions)
>>> where Functions is a list of {Name,Arity} pairs.
>>> Effect: calls to that function from the shell don't need a
>>> Module prefix, just like -import directives in files.
>>>
>>> Reason: I often want to call a function or a small number of
>>> functions many times to explore it or test it.
>>>
>>> (2) include(FileName)
>>> Effect: reads FileName as a sequence of Erlang expressions and
>>> interprets them as if typed into the same shell.
>>>
>>> Reason: set up constants and imports.
>>>
>>>
>>>
>>> _______________________________________________
>>> erlang-questions mailing list
>>> erlang-questions@REDACTED
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>
> --
>
> Cheers,
> --
> Pierre Fenoll
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
More information about the erlang-questions
mailing list