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

Tony Arcieri tony@REDACTED
Fri Jun 5 00:36:04 CEST 2009

On Thu, Jun 4, 2009 at 4:24 PM, Steve Davis

> But then -- won't you now have to remember (or consult the docs for)
> the valid tagnames?

Yes, to which I responded:

"Personally I think it's a lot easier to remember text labels for arguments
than it is specific (and inconsistent) orderings."

> Also, taking a looking at the example given:
> string:substring(Str, I, J)
> ...isn't this a straw man with intentionally badly named variables?

Yes, that's true when you're passing variables.  That's why I gave an
example with values instead.

With my example:

  do_something(true, true, 360, 120)

you *COULD* get the same effect by binding to throw-away variables:

  do_something(_Scale=true, _PreserveAspect=true, _Width=360, _Height=120)

but oh my is that tedious and ugly compared to:

  do_something(scale:true preserve_aspect:true width:360 height:120)

which has the added benefit of arbitrary argument ordering.

Tony Arcieri

More information about the erlang-questions mailing list