Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Motion 31 Suggestions



Ian, Vincent, P1788

On 26 Jan 2012, at 12:48, Vincent Lefevre wrote:
> Ian McIntosh wrote:
>> User defined literals define a function (or functions) to convert some
>> sequence of characters in a program that meet some defined syntax
>> representing a literal into the corresponding internal constant of the
>> specified type.  The constant is not a function, but the conversion from
>> its external form to its internal form is defined by a function.  It is
>> internally represented the same way a variable is and generally treated the
>> same way a variable is, except that it is not allowed to be changed.  Maybe
>> 1788 could use that approach, instead of defining constants as functions?
> 
> The way I see the P1788 text is that constants are regarded as
> functions for the spec, but it is up to the language to decide
> how they are handled.

I agree. Maybe I'm being naive but I don't see that the P1788 spec contradicts a language definition of constants as Ian describes. The concept of "variable", e.g., is beyond P1788's scope. P1788 just says a constant is a value defined purely by its name (denotation), needing no input arguments.

John Pryce