Boost logo

Boost :

From: Greg Colvin (greg_at_[hidden])
Date: 1999-06-21 13:30:08


From: Andy Glew <glew_at_[hidden]>
> >These names are more "fun"<g>, but I'm unconvinced that they're better. The
> >other ones parse like real english.
>
>
> When I have defined similar libraries in other programming languages,
> I have been able to say
>
> '0ary function'
> '1ary function'
> '2ary function'
>
> etc. - but this was in languages that allow arbitrary characters to be in
> names, and are not limited to alphanumeric strings like Algol derived languages
> such as C++. (The above are actual names.)
>
> I would be tempted to say
>
> _0ary_function
> _1ary_function
>
> but I think that leading underscores are discouraged by the C++ standard.

Not just discouraged, but reserved for the implementor and forbidden to the
user.

> I kept trying miscellaneous alphanumeric prefixes, such as
>
> n_1_ary_function
> n_2_ary_function
>
> but this seems clumsy.
>
>
> However, as for the clumsiness of the postfix form not being "English-like"
>
> function_1_arg
> function_2_arg
>
> etc., may I remind you that, if this library is successfull, many non-English speakers
> will use it? Spelling numbers is silly when digits are universally understood.

Perhaps, but "ary" is a proper English suffix, from the Latin, "un", "bin", and
"tern" are proper English prefixes, also from the Latin, and unary, binary, and
ternary are all in my dictionary. So why kludge up ugly names when English has
the names we need? That leaves the 0ary case, which could be nullary or nilary.
Neither appears in my 1985 unabridged dictionary, but nullary is in fact already
used in the funtional programming community, and likely will make it into more
recent dictionaries. So we have perfectly reasonable English words for the
concepts we are implementing, and I don't see a good reason not to use them.

------------------------------------------------------------------------

eGroups.com home: http://www.egroups.com/group/boost
http://www.egroups.com - Simplifying group communications


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk