From: minforth@gmx.net   
      
   Am 24.09.2025 um 08:38 schrieb Anton Ertl:   
   > minforth writes:   
   >> Am 23.09.2025 um 19:23 schrieb Anton Ertl:   
   >>> minforth writes:   
   >>>> FWIW I also use suffixes for recognizers:   
   >>>> let M be a matrix   
   >>>> M´ auto-transposed   
   >>>> M~ auto-inverted   
   >>>   
   >>> Can you give an example of a matrix with your matrix recognizer?   
   >>>   
   >>   
   >> To be fair, here MinForth displays the matrix/vector stack in the   
   >> QUIT prompt:   
   >>   
   >> MinForth 3.6 (64 bit) (fp matrix)   
   >> # 0 0 matrix mat ok   
   >> # m[ 1 2 3 ; 4 5 6 ] ok   
   >   
   > Given this syntax, a parsing word M[ suggests itself to me (although I   
   > generally dislike parsing words and probably would choose a different   
   > syntax); or maybe a word that switches to a matrix interpreter   
   > (possibly implemented using the recognizer words, with ] switching   
   > back. Why did you choose to use a recognizer?   
      
   M[ ... pushes a matrix literal onto the matrix stack.   
   MATRIX (or VECTOR) define a persistent matrix/vector value.   
      
   M[ is not really parsing, it just sets a flag for the forth   
   interpreter. You could write   
   M[ 1 fdup ] instead of M[ 1 1 ] or M[ 1. 1. ] or M[ 1e 1e ]   
      
   IOW M[ does not use a recognizer.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|