Sujet : Re: question about nullptr
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 13. Jul 2024, 03:18:06
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v6so4v$3dg3t$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 12.07.2024 14:08, Janis Papanagnou wrote:
On 11.07.2024 01:25, Ben Bacarisse wrote:
[...]
Would you welcome the introduction of the keyword unity -- with the
value 1 and type int -- into C because one could then search for it?
No. [...]
One addition here; you've been asking for a [general available]
literal name for integer constants. Which is of course nonsense
because we have no "specific dedicated semantical values" (as I
wrote) and which is different from 'null', 'true', or 'false',
which all are such dedicated values.
But for specific applications it may make sense to define (for
specific values) 'int' or 'float' literals. I've seen examples
of software doing formal differentiation in Algol 68 and Simula.
Despite the approach of both software versions were completely
different, both code designers defined dedicated objects like
'zero' and 'one', because being neutral elements these objects
serve a special purpose in the software architecture of their
formal differentiation algorithm. 'pi' may be another example.
So even if your statement above had obviously a different more
ludicrous intention [concerning a general availability of such
'int' literals] there's specific applications where it's useful
(or even necessary).
Janis