Post #1864715
2026-05-01 20:34 UTC
I am not going to do like C where the type of a literal is written into its notation.
I forget exactly how to write it in Ada but presume it is done with attributes somehow.
Even with C, I have to look up a lot of things like how to write decimal floating point. Especially as there is more than one system for that.
Replies (1)
-
@chemoelectric@masto.ai 2026-05-01 20:41
There is the Fortran method. The Fortran method I can remember roughly. I certainly have used it enough. You define a type designator as an integer constant. Then you append _DESIGNATOR to the numeral. But another method is to have different contexts. One can have different operators. One can have a context set in parentheses. These are roughly methods used in OCaml. Something like that also in Standard ML. In Scheme, I very often use SRFI-143. That gives you small-integer-only math.