bugGforth - Bugs: bug #65331, `b` is not a good choice for a...

 
 

bug #65331: `b` is not a good choice for a standard word name

Submitter:  Samuel Tardieu <rfc1149>
Submitted:  Mon 19 Feb 2024 01:16:22 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Wont Fix
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 19 Feb 2024 06:52:28 PM UTC, comment #2: 

Yes, I understand why it can happen in a program. I find this unfortunate in the default vocabulary. As far as I can tell, only `b` and `EBADF` (introduced in 2022) exhibit this problem in Gforth, and I noticed this while porting a legacy compiler of mine to the updated version.

Samuel Tardieu <rfc1149>
Mon 19 Feb 2024 06:02:18 PM UTC, comment #1: 

Gforth follows SwiftForth in using this name for this word.

The traditional recommendation has been to avoid conflicts by starting all numbers with digits, with the traditional example being 0add.  IIRC there is some text in Thinking Forth to that effect.

Of course, with the newfangled number prefixed, we can use those, as you suggest, i.e., $add and $b.  And that's the way I recommend unless you want to port to an old-school system.

If really want to use 'b' as number against all recommendations, you can define

$b constant b

Anton Ertl <anton>
Group administrator
Mon 19 Feb 2024 01:16:22 PM UTC, original submission:  

`b` is defined in "locate1.fs". It is quite common to work with an hexadecimal base, and this it impossible to enter the `b` digit without prefixing it with `0` or `$`.

One could add that `n` has a similar problem, but bases greater than 16 are much less common than hexadecimal.

Samuel Tardieu <rfc1149>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by anton (Posted a comment)
  • -email is unavailable- added by rfc1149 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-02-19 anton StatusNone Wont Fix
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-04b1.
    Corresponding source code