From: anton@mips.complang.tuwien.ac.at   
      
   peter writes:   
   >On Tue, 23 Sep 2025 17:25:18 GMT   
   >anton@mips.complang.tuwien.ac.at (Anton Ertl) wrote:   
   >   
   >> peter writes:   
   >> >This is the closest I have come   
   >> >   
   >> >s\" \"" rec-string Hej Peter" interpreting cr type   
   >> > Hej Peter ok   
   >> >   
   >> >I still gives me an extra space that is needed to separate rec-string   
   >> >from the continuation of the string.   
   >>   
   >> Yes, if you want to avoid that space, you lose a lot of the   
   >> interactive testing benefit.   
   >>   
   >> But at least that works on lxf64.   
   >   
   >If I do like this it works   
   >s\" \"" drop 0 rec-string Hej Peter" interpreting cr type   
   >Hej Peter ok   
      
   Yes, whereas my similar attempts with Gforth failed. I have now   
   managed to create a version that works:   
      
   :noname parse-name rec-string interpreting ; execute "Hej Peter" cr type   
   \ Hej Peter ok   
      
   But having to go to these lengths is not something that we should be   
   proud of.   
      
   >Honestly I think using the string recognizer outside of recognizing   
   >is difficult.   
      
   In Gforth, the recognizer in isolation works:   
      
   s\" \"" rec-string scan-translate-string = cr . type   
   -1 " ok   
      
   It's only when you then use INTERPRETING (i.e., perform the   
   translation action), that the difficulties appear. However, I think   
   that this is mainly the result of taking a shortcut in the   
   implementation, not a fundamental problem.   
      
   - 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 2025 CFP: http://www.euroforth.org/ef25/cfp.html   
   EuroForth 2025 registration: https://euro.theforth.net/   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|