1. [phix] number niggle

( 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

new topic     » topic index » view message » categorize

2. Re: [phix] number niggle

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

new topic     » goto parent     » topic index » view message » categorize

3. Re: [phix] number niggle

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...

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu