[erlang-questions] Erlang/YAWS vs Free Pascal/Xitami

Vlad Dumitrescu vladdu55@REDACTED
Fri Mar 28 09:31:27 CET 2008


On Fri, Mar 28, 2008 at 5:32 AM, Richard A. O'Keefe <ok@REDACTED> wrote:
>  It's now about 10 years since I proposed
>         <name>[(<args>)] ... <name>[(<args>)]
>  as Erlang syntax, with the idea that
>         (1) you sort the packets after the first stably by <name>
>         (2) you concatenate the <names> with "_" separators
>         (3) you concatenate the argument lists
>  so something like
>         extend(G) with_edge labelled(L) to(T) from(F)
>  becomes
>         extend(G) from(F) labelled(L) to(T) with_edge
>  becomes
>         extend_from_labelled_to_with_edge(G, F, L, T)

>  This is, to my mind, a syntactically simpler approach than keyword
>  arguments.  It is completely decoupled from the names of the function
>  parameters, which is particularly important for Erlang because Erlang
>  function arguments as such don't *have* names.  But it serves the same
>  ends as keyword arguments, and leaves little work for a type checker.

This is an interesting suggestion, I think the result looks very nice.
It's not very difficult to implement, either. Well, almost.

The trouble I ran into was when the function call isn't literal. It's
easy to do
    Fun = extend_from_labelled_to_with_edge,
    Fun(G, F, L, T),
But you would need to remember the order of the arguments anyway and
since their order is determined by the lexical worting of the name
chunks, it might be even more non-intuitive than the order used now.
Not even the complete name of the function would be very intuitive...

Another small issue is that if I want to write
  somefun(X), otherfun(Y)
but forget or delete the comma, the error will be seen only at
runtime. Hopefully there is no somefun_otherfun/2 that could give
extra weird errors.

Maybe one could use something like

OT: What is Te Reo Engarihi? I deciphered the rest of the sig, but
this I can't find any reference to.

best regards,

....( )/ ( )...

More information about the erlang-questions mailing list