home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.forth      Forth programmers eat a lot of Bratwurst      117,927 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 116,475 of 117,927   
   Anton Ertl to dxf   
   Re: Numeric string output - conspicuousl   
   07 May 24 16:07:11   
   
   From: anton@mips.complang.tuwien.ac.at   
      
   dxf  writes:   
   >On 7/05/2024 3:58 am, Anton Ertl wrote:   
   >> I assume you mean <<# and #>>.  If you use standard code, you do not   
   >> use <<# nor #>>, and the code works as specified in the standard.  In   
   >> the example above, it's the standard word <# (inside the +COMMA) that   
   >> adversely affects the usage of the HOLD buffer stack.   
   >   
   >And it's in support of this concept of a HOLD buffer stack (that doesn't   
   >exist in Standard Forth or any other AFAIK) that Gforth won't provide (.)   
   >et al that's been present on virtually all desktop forths?   
      
   It certainly is a reason why "(.)" with the meaning you seem have in   
   mind is not a factor of "." in Gforth.   
      
   >ISTM Gforth has a choice to make.  It can do it its own thing - or it can   
   >adopt what has been common practice.  For it's clear that when there's no   
   >common practice, nor moves towards it, there can't be a Standard.   
      
   According to you it is common practice already, and I think someone   
   has also claimed that words like (.) are used often, not that I have   
   missed them.  If it is common practice, and you want to see it   
   standardized, make a proposal; documenting the common practice in   
   systems and programs would be useful to support such a proposal.   
      
   I see that in SwiftForth 4.0.0-RC87 there are the following number of   
   uses:   
      
    6 (.)   
    3 (U.)   
    3 (D.)   
    3 (DU.)   
    0 (U.R)   
    4 #S   
   10 #>   
   10 <#   
      
   Not defined: (.R) (D.R) (DU.R)   
      
   Mostly indepenently of this, I find figForth's factoring of .-related   
   words (inherited by Gforth) more elegant than the SwiftForth ones:   
      
   fig-Forth (reformatted to be more comparable to SwiftForth):   
      
   : D.R   
          >R  SWAP  OVER  DABS  <#  #S  SIGN  #>   
          R>  OVER  -  SPACES  TYPE  ;   
   : D.     0  D.R  SPACE  ;   
   : .R     >R  S->D  R>  D.R  ;   
   : .      S->D  D.  ;   
      
   SwiftForth:   
      
   : (D.)  (  d -- addr len )  TUCK DABS <# #S ROT SIGN #> ;   
   : (.)  ( n -- addr len )  S>D (D.) ;   
   : D. ( d -- )   (D.) TYPE  SPACE ;   
   : . ( n -- )   (.) TYPE  SPACE ;   
   : D.R ( d n -- )   >R (D.)  R> OVER - SPACES TYPE ;   
   : .R ( n n -- )   >R (.)  R> OVER - SPACES TYPE ;   
      
   In the fig-Forth variant you could factor out (D.), but it would be   
   used only once.  Likewise, with a fig-Forth-like factoring, the usage   
   numbers for the (.)-like words would be somewhat lower.   
      
   BTW, wouldn't you recommend that Gforth should do its own thing?  At   
   least that's how I read many of your messages over the years.   
      
   - anton   
   --   
   M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html   
   comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html   
        New standard: https://forth-standard.org/   
      EuroForth 2023: https://euro.theforth.net/2023   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca