Re: Motion 46: NO
On 2013-07-19 15:00:22 -0400, Ian McIntosh wrote:
> I like "_" but if C++ and Fortran are in the list of commonest
> languages it is awkward.
> - In Fortran, "_" is a separator between value digits and kind digits.
> You could write "123_4" meaning the same as "123" but of kind 4, which
> typically is a 4 byte / 32 bit integer.
But there would be no ambiguities, because what follows "_" would
be letters (not digits) in a decorated interval literal.
> - In C++ 11, "_" may be the first character of a user defined suffix for a
> user defined literal. You could write "123_xx" to mean the same as "123"
> but to be processed by the user defined literal function that handles
> literals with "_xx" suffixes, which could for example return a value of
> type "xx". One could define suffixes and functions so that 1.5_feet +
> 6_inches equalled 2_feet, or that 0.1down was converted with rounding
> towards negative infinity and 0.1up towards positive infinity. Interesting
> opportunities, but for 1788 with interesting interactions.
In C++ 11, can you write literals of the form [123]_xx ?
> Since there are conflicts between common languages it's impossible to
> define one literal syntax common to them all, and using "_" for a 1788
> meaning when it already has two meanings for common language literals may
> cause additional confusion. If we use it, we might need a statement that
> our meaning overrides any language meanings.
"_" was mainly for text2interval(). "Real" literals of interval type
in a language may need some transformation. Indeed I don't expect all
"commonest languages" to accept literals like [1,2] directly.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)