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

Tony Arcieri tony@REDACTED
Thu Jun 4 19:47:33 CEST 2009

On Thu, Jun 4, 2009 at 3:10 AM, Joe Armstrong <erlang@REDACTED> wrote:

> Imagine a function like string:substring/3. A call to this looks like:
>        string:substring(Str, I, J)
> The problem with this is that it's difficult to remember the argument order
> and you have to consult the documentation *to find out the order of
> the arguments*
> I *know* what the arguments are (a string, a start index and a length)
> but I have to
> consult the documentation to find the order.
> Solution: write the call like this.
>       string:substring( string:S start:I length:J)

I'm a big fan of keyword arguments and plan on adding them to Reia as well,
with a similar syntax

Tony Arcieri

More information about the erlang-questions mailing list