[erlang-questions] erlang improvement - objective c (or smalltalk) syntax

Daniel Goertzen daniel.goertzen@REDACTED
Thu Jun 4 16:32:45 CEST 2009


On Thu, Jun 4, 2009 at 4:30 AM, Attila Rajmund Nohl <attila.r.nohl@REDACTED
> wrote:

>
>
> $smtp = Net::SMTP->new(
>                                      Host => ’mailhost’,
>                                      Hello => ’my.mail.domain’
>                                      Timeout => 30,
>                                      Debug   => 1,
>                                     );
>


I like this concept, and I use it a lot in Python.  Erlang records can give
you the same thing, but it is less pretty.  Perhaps some of the new
structure/dictionary ideas can help here?

To go on a bit of a tangent, an idea from a language I saw years ago (can't
remember what it was called) is that all functions take only 1 parameter,
but that parameter is understood to be a tuple.  You didn't have to
explicitly pack and unpack them; it all happened automatically behind the
scenes.  I think this is pretty neat, because tuples and function parameters
are already quite similar, and this idea unifies the concepts.  Python also
has convenient ways of interchanging parameter lists, tuples, and
dictionaries.

This idea popped into my head because it feels like something we already
have is being reinvented here.

Dan.


More information about the erlang-questions mailing list