Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #133643

Re: Roman numerals , recognizer "0r".

Newsgroups comp.lang.forth
References <nnd$3b511631$511bab64@a22533c0c24c276e> <2025Jun8.183524@mips.complang.tuwien.ac.at>
From albert@spenarnc.xs4all.nl
Subject Re: Roman numerals , recognizer "0r".
Message-ID <nnd$250ea32f$3fb998ef@fcebcb1d9b9cbb97> (permalink)
Organization KPN B.V.
Date 2025-06-09 12:20 +0200

Show all headers | View raw


In article <2025Jun8.183524@mips.complang.tuwien.ac.at>,
Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
<SNIP>
>Because conflicts can be avoided, there is no need to use a prefix
>like your Or, so I do not use that.  Here are some examples:

The use of Roman numerals prefix 0r has the same advantages as using
the prefix $.
Remember ciforth recognizes A as introducing a hex number A01 .
I could put the introducing Roman recognizers in the ONLY wordlist,
and the result would be that Roman numerals are directly recognized.

This is how numbers are handled in ciforth (7 sits in the minimum search
order)  The parse pointer has to backed up one character to include 7.
: 7 -1 PP   +!   (NUMBER)   POSTPONE SDLITERAL ; IMMEDIATE  PREFIX
: A -1 PP   +!   (NUMBER)   POSTPONE SDLITERAL ; IMMEDIATE  PREFIX
I could easily add the following in the minimum search order, replacing
the 0r prefix :
: M -1 PP   +!   (ROMAN-NUMBER)   POSTPONE SDLITERAL ; IMMEDIATE  PREFIX
(this is the ONLY wordlist). And the same for C X I D L V .
However this creates a conflict between CC (200) and HEX CC or HEX D000FFFF .

P.S.
If you want to reject DD VV LL it suffices to add
    : DD 1001 THROW ;
etc. to the ROMAN vocabulary.
This testifies to the advantage of leaving interpreting to the Forth
interpreter.

>
>- anton

Groetjes Albert
-- 
Temu exploits Christians: (Disclaimer, only 10 apostles)
Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
And Gifts For Friends Family And Colleagues.

Back to comp.lang.forth | Previous | NextPrevious in thread | Find similar


Thread

Roman numerals , recognizer "0r". albert@spenarnc.xs4all.nl - 2025-06-08 13:26 +0200
  Re: Roman numerals , recognizer "0r". zbigniew2011@gmail.com (LIT) - 2025-06-08 14:41 +0000
    Re: Roman numerals , recognizer "0r". dxf <dxforth@gmail.com> - 2025-06-09 02:07 +1000
      Re: Roman numerals , recognizer "0r". zbigniew2011@gmail.com (LIT) - 2025-06-08 16:23 +0000
        Re: Roman numerals , recognizer "0r". dxf <dxforth@gmail.com> - 2025-06-09 11:46 +1000
          Re: Roman numerals , recognizer "0r". zbigniew2011@gmail.com (LIT) - 2025-06-09 09:23 +0000
          Re: Roman numerals , recognizer "0r". albert@spenarnc.xs4all.nl - 2025-06-09 12:39 +0200
            Re: Roman numerals , recognizer "0r". zbigniew2011@gmail.com (LIT) - 2025-06-09 12:16 +0000
            Re: Roman numerals , recognizer "0r". albert@spenarnc.xs4all.nl - 2025-06-09 17:44 +0200
      Re: Roman numerals , recognizer "0r". dxf <dxforth@gmail.com> - 2025-06-09 13:42 +1000
        Re: Roman numerals , recognizer "0r". zbigniew2011@gmail.com (LIT) - 2025-06-09 09:26 +0000
          Re: Roman numerals , recognizer "0r". dxf <dxforth@gmail.com> - 2025-06-09 21:04 +1000
            Re: Roman numerals , recognizer "0r". zbigniew2011@gmail.com (LIT) - 2025-06-09 12:14 +0000
              Re: Roman numerals , recognizer "0r". dxf <dxforth@gmail.com> - 2025-06-09 23:55 +1000
        Re: Roman numerals , recognizer "0r". zbigniew2011@gmail.com (LIT) - 2025-06-09 09:58 +0000
  Re: Roman numerals , recognizer "0r". anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2025-06-08 16:35 +0000
    Re: Roman numerals , recognizer "0r". anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2025-06-09 06:23 +0000
    Re: Roman numerals , recognizer "0r". anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2025-06-09 07:15 +0000
    Re: Roman numerals , recognizer "0r". albert@spenarnc.xs4all.nl - 2025-06-09 12:20 +0200

csiph-web