[erlang-questions] erlang improvement - objective c (or smalltalk) syntax
David Mercer
dmercer@REDACTED
Thu Jun 4 16:11:47 CEST 2009
> I recommend an approach where all exported functions have typespecs
> and that the possibility to
> assign a Mnemonic name to each function-argument is used.
I agree. And I also think typespecs should be allowed to be recursive.
E.g.:
-type t1() :: {t1, t2()}.
-type t2() :: {t2, t1()} | t2.
This doesn't work currently. Is there a restriction in the static analyzer
that makes these types of structures intractable?
> -----Original Message-----
> From: erlang-questions@REDACTED [mailto:erlang-questions@REDACTED] On
> Behalf Of Kenneth Lundin
> Sent: Thursday, June 04, 2009 7:36 AM
> To: Vlad Dumitrescu
> Cc: Alin Popa; Joe Armstrong; Erlang
> Subject: Re: [erlang-questions] erlang improvement - objective c (or
> smalltalk) syntax
>
> It would be easy to implement tab-completion of functions with
> argument names and types based on the
> type specifications which are in place in many of the modules in
> kernel and stdlib.
> The typespec info can easily be retrieved from the beam files without
> need for documentation.
>
> The typespec notation will be used in edoc and in the ordinary
> Erlang/OTP documetation as well.
>
> I recommend an approach where all exported functions have typespecs
> and that the possibility to
> assign a Mnemonic name to each function-argument is used.
>
> When having that in place it will be easy to support tab-completion in
> the shell as well as in IDE's.
>
>
> /Kenneth Erlang/OTP Ericsson
>
> On Thu, Jun 4, 2009 at 2:21 PM, Vlad Dumitrescu <vladdu55@REDACTED>
> wrote:
> > On Thu, Jun 4, 2009 at 14:04, Alin Popa <alin.popa@REDACTED> wrote:
> >> Please correct me if I'm wrong, but
> >> string:substring(String)from(Start)length(Length) does not look more
> like an
> >> actual multiple function calls ( substring(String) - one function
> call,
> >> from(Start) - other one, and so on ... ) ?
> >> I don't know that this solution may keep backward-compatibility with
> the old
> >> syntax.
> >>
> >> Or maybe I'm missing something here.
> >
> > Since there's no comma between the "calls", it is an illegal syntax
> > today. That was only a suggestion for syntax (and I might even
> > remember it wrong), there might be better alternatives.
> >
> > Could I dare throw in a sales pitch?
> >
> > erlIDE shows the function's documentation beside the list with
> > completion suggestions, so the docs are never too far away. At the
> > moment, only the standard libraries' docs are shown prettily
> > formatted; one's own code is just the raw comments before the function
> > definition.
> >
> > regards,
> > Vlad
> >
> > ________________________________________________________________
> > erlang-questions mailing list. See http://www.erlang.org/faq.html
> > erlang-questions (at) erlang.org
> >
> >
>
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
More information about the erlang-questions
mailing list