[erlang-questions] string:lexeme/s2 - an old man's rant

Richard O'Keefe raoknz@REDACTED
Thu May 9 13:34:00 CEST 2019

Do not eat a lot of Chinese Gooseberries (the fruit whose name was changed
the company Turners and Growers for marketing reasons, back before Ping-Pong
Diplomacy) unless you want to lose weight by running frequently to the small
room.  Actinidia deliciosa wants its fruit eaten but not fully digested, for
the sake of the seeds.
explains the name change.  I still use the old name.)

To be honest, the first time I saw the function name 'tokens', I expected
something returning *Erlang* tokens, then when I saw 'lexemes', I said to
myself "NOW they have a function that does what I thought tokens did".
Wrong again.

Here's an apropos example from the ANSI Smalltalk standard.

aString subStrings: separators

The first thing to note is that this actually violates Smalltalk naming
conventions: internal capitals are only to be used at *word* boundaries,
not *morpheme* boundaries.  And 'sub-' as used here is a prefix, not a
word.  Some Smalltalk implementations have changed it to 'substrings'.
One has renamed it to
aString asCollectionOfSubstringsSeparatedByAnyOf: separators

The second thing to note is that the description given for it is
hopelessly vague.  If anyone thinks that the Erlang library documentation
needs improving -- as I do -- at least it isn't an actual *standard*!
This operation does pretty much the same thing as string:tokens/2, but
you would never guess it from the text in the standard.  Oh, did I
mention that the Erlang documentation is free but the ANSI Smalltalk
standard is not?  The Erlang documentation is definitely value for money.

One of these days I must really ask to be allowed to edit some of the
Erlang documentation, but I'm afraid that if I do people will discover
that I'm better at criticising than writing.

On Wed, 8 May 2019 at 22:36, <empro2@REDACTED> wrote:

> On Wed, 8 May 2019 00:27:41 -0400
> "Lloyd R. Prentice" <lloyd@REDACTED> wrote:
> > Richard, you’re a star in the Erlang firmament.
> Not at all limited to Erlang, not even to all the
> languages he has ever mentioned; so it is at least the
> programming languages firmament ... oh, and the unicode
> firmament, it appears ...
> I sometimes wonder whether I should eat more kiwis, sorry!
> kiwi fruit, of course ... then again ... ;-)
> ~Michael
> --
> If a *bank* in need of money is systematically important,
> then that system is not important.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20190509/754f1b3b/attachment.htm>

More information about the erlang-questions mailing list