1. [phix] number niggle
- Posted by _tom (admin) Jan 20, 2021
- 651 views
( Using 8.3 preview )
'number' as an alias for 'atom' is nice for a beginner's tutorial, but
number number = 3 ? number --> 3
You can use 'number' as an identifier!
number number = 3 number count = 0 // ^ '=' expected
Explaining this error to a beginner is tough!
I generated a warning. Explaining warnings to a beginner is also tough.
number number = prompt_number(prompt) ^Warning: assumed to be a variable_id, not a type
be well
_tom
2. Re: [phix] number niggle
- Posted by katsmeow Jan 20, 2021
- 635 views
Consider "numeral" ?
The numeral is the written representation of the number, but good luck with explaining that. It's like if you write "dog" on a paper, there's likely no dog on the paper, even if there is one there gnawing on your leg.
Literally, "numeral" is a type of word, denoting only quantities.
Kat
3. Re: [phix] number niggle
- Posted by petelomax Jan 20, 2021
- 632 views
Yup, this was always the case, and more than a bit silly:
integer integer = 1 atom atom = 2.3 string string = "four" ...etc
Of course after that (at least until they drop out of scope) you can't declare any more integers, atoms, or strings...
So, in pmain.e there were 30 uses of S_Rsvd, delivering "illegal use of a reserved word", that I thought I may as well piggy-back on, 7 of which should not be altered, and 23 that now have a preceding "N<=T_Asm or", or equivalent, so that sort of nonsense will flatly error out in the next release. No doubt a few things will snap, but it runs p -c p and p -test ok with those changes in.
Thanks.
PS Of course there will probably be a whole raft of programmers utterly outraged that I've taken away their right to dump on their own doorstep...