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

Bengt Kleberg bengt.kleberg@REDACTED
Thu Jun 4 12:56:10 CEST 2009


Does the "canonical form" concept mean that the (hypothetical, new,
improved) string module would have both substring/3 and
substring_string_start_length/3 exported?

And that I could either call
string:substring( string:S start:I length:J )
string:substring_string_start_length( String, Start, Length )

But neither
string:substring( String, Start, Length )
string:substring_string_start_length( string:S start:I length:J )
would not work?


On Thu, 2009-06-04 at 12:32 +0200, Christian wrote:
> On Thu, Jun 4, 2009 at 12:08, Bengt Kleberg <bengt.kleberg@REDACTED> wrote:
> > 1) I would still need to look in the documentation. No longer to find
> > the position, but to find out the names/spelling of the arguments. Is it
> > string: or str:, start: or first: and is it length: or chars:?
> >
> > 2) I do not find it more beneficial to write
> > string:substring( string:S start:I length:J ), instead of
> > string:substring( String, Start, Length ).
> You would still have to look it up, not necessarily though the
> documentation, a listing of exported functions from the string module
> is enough. If you would see the function in its canonical form you
> would know the names and their spelling.
> This reminds me about another useful feature that "we have the
> techology" for: one-liner documentation strings that could be
> displayed in the shell when tab-completing. Richard Carlsson once
> mentioned that one-line summaries was fully within his intention with
> edoc.
> An advantage of having code be self-documenting (as in joe's objc
> appraoch) is that you don't risk having documentation that was not
> updated when code was updated. But docstrings are more free form and
> could point out other useful facts.

More information about the erlang-questions mailing list