back to working on TM
authorThomas Walker Lynch <eknp9n@reasoningtechnology.com>
Fri, 28 Mar 2025 16:30:33 +0000 (16:30 +0000)
committerThomas Walker Lynch <eknp9n@reasoningtechnology.com>
Fri, 28 Mar 2025 16:30:33 +0000 (16:30 +0000)
developer/cc馃枆/FG.lib.c
developer/cc馃枆/TM.lib.c
developer/cc馃枆/cpp_ext.c
developer/cc馃枆/cpp_ext_0.c
developer/cc馃枆/cpp_ext_1.c
developer/cc馃枆/xi.c [deleted file]
developer/example/cpp_ext_0.c
developer/example/cpp_ext_1.c
developer/example/try_6_list.c
developer/tool馃枆/makefile

index 566460e..6d659fa 100644 (file)
@@ -1,12 +1,14 @@
 /*
 Template parameters:
 
-FG路Type - Type of FG table, will be used to name the binding struct.
+  FG路Type - Type used to name the binding struct. Binding struct instances get passed as arguments to functions etc.
 
-Note that template variables are _use once_ per #include. (They are #undef at the bottom of this file.)
+Template variables are _use once_ per #include. (They are #undef at the bottom of this file.)
        
 */
 
+#include "cpp_ext.c"
+
 #ifndef FACE
 #define FG路IMPLEMENTATION
 #define FACE
@@ -15,60 +17,50 @@ Note that template variables are _use once_ per #include. (They are #undef at th
 //--------------------------------------------------------------------------------
 // Interface 
 
-#ifndef 螢(FG路FACE ,FG路Type)
-#define 螢(FG路FACE ,FG路Type)
-
+// once per translation unit
+#ifndef FG路TYPE_LIST
+#define FG路TYPE_LIST
 
   #define FG路DEBUG
   #ifdef FG路DEBUG
     #include <stdio.h>
   #endif
 
-  #define FG路ALL  ( defined(FG路Type) )
-  #define FG路NONE ( !defined(FG路Type) )
-  #if !( FG路ALL || FG路NONE )
-    #error "FG template inconsistency: must define all or none of: FG路Type"
-  #endif
-
-  //----------------------------------------
-  // Macro to call a function in the FG table with debug checks
-  // Usage: FG路call(tm, function_name, arg1, arg2, ...)
-  // Expands to: (tm.fg->function_name)((tm)->t, arg1, arg2, ...)
-  // With debug checks for NULL pointers when FG路DEBUG is defined
-  //----------------------------------------
-  #if FG路ALL
-
-    //#define  ALL_VAL V0路路V1路路V2 ...
-    // the double cdot underscore non aliasing across identifiers
-    #define  FG路ALL_VAL FG路Type
-    // FG is not yet a type, so we don't have this
-    // #define FG_t 螢(FG_t ,FG路ALL_VAL)
-
-    // a simplifying naming convention
-    #define FG路Binding 螢(FG路Type)
-    #define FG路FG      螢(FG路Type ,FG)
-    #define FG路Tableau 螢(FG路Type ,Tableau)
-
-    // as a convention, we name the binding after the type
-    typedef struct{
-      FG路FG *fg;
-      FG路Tableau *tableau;
-    } FG路Binding;
-
-    inline void FG路wellformed_binding(FG路Binding b){
-      #ifdef FG路DEBUG
-        FG路Guard路init_count(chk);
-        FG路Guard路fg.check(&chk, 1, b.fg,      "NULL fg table");
-        FG路Guard路fg.check(&chk, 1, b.tableau, "NULL tableau");
-        FG路Guard路assert(chk);
-      #endif
-    }
-
-     // note the use of the comma operator to return the result from the b.fg->fn call
-    #define FG路call(b, fn, ...) \
-      ( FG路wellformed_binding(b) ,b.fg->fn(b.tableau, ##__VA_ARGS__) )
-
-  #endif
+#endif
+
+// once per FG路TYPE value
+#if ! FIND_ITEM( FG路TYPE ,FG路TYPE_LIST )
+#define FG路TYPE_LIST APPEND(FG路TYPE_LIST ,FG路TYPE)
+
+  // a simplifying naming convention
+  #define FG路Binding 螢(FG路Type)
+  #define FG路FG      螢(FG路Type ,FG)
+  #define FG路Tableau 螢(FG路Type ,Tableau)
+
+  // as a convention, we name the binding after the type
+  typedef struct{
+    FG路FG *fg;
+    FG路Tableau *tableau;
+  } FG路Binding;
+
+  // binds a tableau and FG tabel instance together
+  inline void FG路wellformed_binding(FG路Binding b){
+    #ifdef FG路DEBUG
+      FG路Guard路init_count(chk);
+      FG路Guard路fg.check(&chk, 1, b.fg,      "NULL fg table");
+      FG路Guard路fg.check(&chk, 1, b.tableau, "NULL tableau");
+      FG路Guard路assert(chk);
+    #endif
+  }
+
+  /*
+    usage e.g.: FG路call(tm, function_name, arg1, arg2, ...)
+    Expands to: (tm.fg->function_name)((tm)->t, arg1, arg2, ...)
+
+    note the use of the comma operator to return the result from the b.fg->fn call
+  */
+  #define FG路call(b, fn, ...) \
+    ( FG路wellformed_binding(b) ,b.fg->fn(b.tableau, ##__VA_ARGS__) )
 
 #endif // FACE
 
index f748db6..3c49c35 100644 (file)
 /*
   TM - Tape Machine
 
-  This file has the template parameter: `CVT`
-
-  `CVT` Cell Value Type`. It is the type of the datum placed in a cell. By default (when the   macro CVT has no definition) the cell value type is taken as AUM. This file must
-  be included with CVT undefined ,before inclusions with it defined.
-  'Tape' is operated on by the Tape Machine.
-
-  'Area' is subset of an address space that is used as a virtual Tape by a machine.
-
-   An Area with zero elements has 'length == 0' or is 'empty'. In contrast ,and
-   area located (position specified) with a null pointer is said not to exist.
-
-   ----
-
-   CVT is a template variable that affects type names that show on the interface.
-   They affect all implementations in the same way.
-
-   There are multiple implementations, such as Array. Each has its own FG
-   table instance. For example Array路fg. Also each has its own Tableau type, for
-   example, `typedef struct { ... } 螢(TM路Array ,CVT)` is the Tableau type for
-   the array implementation.
-
-   This implementation uses pointer pairs to stand for 'TM type' that are
-   passed around. 
+  `TM路CVT` Cell Value Type`.
 
 */
 
-#define TM路DEBUG
-#ifdef TM路DEBUG
-  #include <stdio.h>
-#endif
-
-#define TM路ALL  ( defined(CVT) ) // ... && defined( ...
-#define TM路NONE ( !defined(CVT) )
-#if !( TM路ALL || TM路NONE )
-  #error "TM template inconsistency: must define all or none of: CVT"
-#endif
-
 #ifndef FACE
 #define TM路IMPLEMENTATION
 #define FACE
 #endif 
 
 //--------------------------------------------------------------------------------
-// Interface - always included
-
-#if TM路ALL
-  #define TM路ALL_VAL = CVT 
-  #define TM_t 螢(TM ,TM路ALL_VAL)
-#endif
+// Interface 
 
-#ifndef 螢(TM ,FACE)
-#define 螢(TM ,FACE)
+// once per translation unit
+#ifndef TM路TYPE_LIST
+#define TM路TYPE_LIST
 
   #include <stdint.h>
   #include <stddef.h>
+  #include "cpp_ext.c"
 
   #include "Core.lib.c"
   #include "FG.lib.c"
 
-  //----------------------------------------
-  // Tape Machine interface
-  //----------------------------------------
+  #define TM路DEBUG
+  #ifdef TM路DEBUG
+    #include <stdio.h>
+  #endif
 
-  #if TM路NONE
-    typedef enum{
-       TM路Tape路Topo路mu = 0 
-      ,TM路Tape路Topo路empty       = 1
-      ,TM路Tape路Topo路singleton   = 1 << 1
-      ,TM路Tape路Topo路segment     = 1 << 2
-      ,TM路Tape路Topo路circle      = 1 << 3
-      ,TM路Tape路Topo路tail_cyclic = 1 << 4
-      ,TM路Tape路Topo路infinite    = 1 << 5
-    }TM路Tape路Topo;
-
-    const TM路Tape路Topo TM路Tape路Topo路bounded = 
-      TM路Tape路Topo路singleton 
-      | TM路Tape路Topo路segment
-      ;
-
-    // If tape machine does not support step left ,then Status路leftmost 
-    // will be reported as Status路interim.
-    typedef enum{
-       TM路Head路Status路mu = 0
-      ,TM路Head路Status路dismounted  = 1
-      ,TM路Head路Status路out_of_area = 1 << 1
-      ,TM路Head路Status路leftmost    = 1 << 2
-      ,TM路Head路Status路interim     = 1 << 3
-      ,TM路Head路Status路rightmost   = 1 << 4
-    } TM路Head路Status;
-
-    const TM路Head路Status TM路Head路Status路on_tape = 
-      TM路Head路Status路leftmost
-      | TM路Head路Status路interim
-      | TM路Head路Status路rightmost
-      ;
-
-  #endif // #ifndef CVT
-
-  #if TM路All
-
-    // TM路<CVT>路Tableau
-    typedef struct 螢(TM ,Tableau);
-    
-    // create an FG路Binding so that FG路call will work
-    #define FG路Type TM 
-    #include "FG.lib.c"
-    #undef FG路Type
-
-    // extent is an index, hence its effect is a function of CVT
-    typedef 螢(extent_t ,CVT) size_t;
-                             
-    typedef struct{
-
-      TM路Tape路Topo (*Tape路topo)(TM tm);
-      bool (*Tape路bounded)(TM tm);
-
-      TM路Head路Status (*Head路status)(TM tm);
-      bool (*Head路on_tape)(TM tm);
-      bool (*Head路on_leftmost) (TM tm);
-      bool (*Head路on_rightmost)(TM tm);
-
-      // tape machine functions
-      Core路Status (*mount)   (TM tm);
-      Core路Status (*dismount)(TM tm);
-
-      void (*step)      (TM tm);
-      void (*step_left) (TM tm);
-      void (*rewind)    (TM tm);
-
-      TM路FG TM路fg; // points to TM路FG instance
-      螢(extent_t ,CVT) (*extent)(TM tm);
-      CVT  (*read) (TM tm);
-      void (*write)(TM tm ,CVT *remote_pt);
-
-    } 螢(TM ,FG);
+  typedef enum{
+     TM路Tape路Topo路mu = 0 
+    ,TM路Tape路Topo路empty       = 1
+    ,TM路Tape路Topo路singleton   = 1 << 1
+    ,TM路Tape路Topo路segment     = 1 << 2
+    ,TM路Tape路Topo路circle      = 1 << 3
+    ,TM路Tape路Topo路tail_cyclic = 1 << 4
+    ,TM路Tape路Topo路infinite    = 1 << 5
+  }TM路Tape路Topo;
+  const TM路Tape路Topo TM路Tape路Topo路bounded = 
+    TM路Tape路Topo路singleton 
+    | TM路Tape路Topo路segment
+    ;
+
+  typedef enum{
+    TM路Head路Status路mu = 0
+    ,TM路Head路Status路dismounted  = 1
+    ,TM路Head路Status路out_of_area = 1 << 1
+    ,TM路Head路Status路leftmost    = 1 << 2
+    ,TM路Head路Status路interim     = 1 << 3
+    ,TM路Head路Status路rightmost   = 1 << 4
+  } TM路Head路Status;
+
+  const TM路Head路Status TM路Head路Status路on_tape = 
+    TM路Head路Status路leftmost
+    | TM路Head路Status路interim
+    | TM路Head路Status路rightmost
+    ;
+
+  // set type equality pattern
+  #define EQ__TM__oo__TM
 
-    //----------------------------------------
-    // Array interface
-    //----------------------------------------
+#endif
+
+// once per TM路CVT value
+#if ! FIND_ITEM( TM路CVT ,TM路TYPE_LIST )
+#define TM路TYPE_LIST APPEND(TM路TYPE_LIST ,TM路TYPE)
+
+  // TM路<TM路CVT>路Tableau
+  typedef struct 螢(TM ,Tableau);
+  
+  // bind the tableau to an FG table, call the binding a 'TM' type
+  #define FG路Type TM 
+  #include "FG.lib.c"
+
+  // extent is an index, hence its effect is a function of TM路CVT
+  typedef 螢(extent_t ,TM路CVT) size_t;
+                           
+  typedef struct{
+
+    TM路Tape路Topo (*Tape路topo)(TM tm);
+    bool (*Tape路bounded)(TM tm);
 
-    typedef struct 螢(TM ,Array)路Tableau;
-                                  
-    TM 螢(TM ,Array)路init_pe( 
-       螢(TM ,Array)路Tableau *t
-      ,CVT position[] 
-      ,螢(extent_t ,CVT) extent 
-    );
+    TM路Head路Status (*Head路status)(TM tm);
+    bool (*Head路on_tape)(TM tm);
+    bool (*Head路on_leftmost) (TM tm);
+    bool (*Head路on_rightmost)(TM tm);
 
-    TM 螢(TM ,Array)路init_pp( 
-       螢(TM ,Array)路Tableau *t
-      ,CVT *position_left 
-      ,CVT *position_right 
-    );
+    // tape machine functions
+    Core路Status (*mount)   (TM tm);
+    Core路Status (*dismount)(TM tm);
 
-  #endif // #ifdef CVT
+    void (*step)      (TM tm);
+    void (*step_left) (TM tm);
+    void (*rewind)    (TM tm);
 
-#endif // FACE
+    TM路FG TM路fg; // points to TM路FG instance
+    螢(extent_t ,TM路CVT) (*extent)(TM tm);
+    TM路CVT  (*read) (TM tm);
+    void (*write)(TM tm ,TM路CVT *remote_pt);
+
+  } 螢(TM ,FG);
+
+  //----------------------------------------
+  // Array interface
+  //----------------------------------------
+
+  typedef struct 螢(TM ,Array)路Tableau;
+                                
+  TM 螢(TM ,Array)路init_pe( 
+     螢(TM ,Array)路Tableau *t
+    ,TM路CVT position[] 
+    ,螢(extent_t ,TM路CVT) extent 
+  );
+
+  TM 螢(TM ,Array)路init_pp( 
+     螢(TM ,Array)路Tableau *t
+    ,TM路CVT *position_left 
+    ,TM路CVT *position_right 
+  );
+
+#endif 
 
 //--------------------------------------------------------------------------------
 // Implementation
     // Dispatch wrapper
     //----------------------------------------
 
-    #ifndef CVT
+    #ifndef TM路CVT
 
       //-----------------------------------
       // common error messages
 
       };
 
-    #endif // ifndef CVT
+    #endif // ifndef TM路CVT
 
     //-----------------------------------
-    // CVT dependent functions
+    // TM路CVT dependent functions
 
-    #ifdef CVT
+    #ifdef TM路CVT
 
-      Local 螢(extent_t ,CVT) 螢(TM ,CVT)路extent(TM *tm){
+      Local 螢(extent_t ,TM路CVT) 螢(TM ,TM路CVT)路extent(TM *tm){
         #ifdef TM路DEBUG
           Core路Guard路init_count(chk);
           Core路Guard路fg.check(&chk ,1 ,TM路Tape路bounded(tm) ,"Tape is not bounded.");
         return tm->fg.extent(tm);
       }
 
-      Local CVT TM路read(TM *tm){
+      Local TM路CVT TM路read(TM *tm){
         #ifdef TM路DEBUG
           Core路Guard路init_count(chk);
           Core路Guard路fg.check( &chk ,1 ,TM路head_on_tape(tm) ,TM路Msg路head);
         return tm->fg.read(tm);
       }
 
-      Local void TM路write(TM *tm ,CVT *write_pt){
+      Local void TM路write(TM *tm ,TM路CVT *write_pt){
         #ifdef TM路DEBUG
           Core路Guard路init_count(chk); 
           Core路Guard路fg.check( &chk ,1 ,TM路head_on_tape(tm) ,TM路Msg路head); 
         return tm->fg.write(tm ,write_pt);
       }
 
-      Local 螢(TM ,CVT)路FG 螢(TM ,CVT)路fg = {
+      Local 螢(TM ,TM路CVT)路FG 螢(TM ,TM路CVT)路fg = {
         .parent = TM路fg
-        ,.extent = 螢(TM ,CVT)路extent
-        ,.read = 螢(TM ,CVT)路read
-        ,.write = 螢(TM ,CVT)路write
+        ,.extent = 螢(TM ,TM路CVT)路extent
+        ,.read = 螢(TM ,TM路CVT)路read
+        ,.write = 螢(TM ,TM路CVT)路write
       };
 
-    #endif // ifdef CVT
+    #endif // ifdef TM路CVT
 
 
     //----------------------------------------
     // TM路Array implementation
     //----------------------------------------
 
-    #ifndef CVT
+    #ifndef TM路CVT
 
       //-----------------------------------
       // common error messages
       const char *TM路Array路Msg路status="bad head status";
         
 
-    #endif // #ifndef CVT
+    #endif // #ifndef TM路CVT
 
-    #ifdef CVT
+    #ifdef TM路CVT
 
-      typedef struct 螢(TM ,CVT)路Tableau;
+      typedef struct 螢(TM ,TM路CVT)路Tableau;
 
       typedef struct{
-        CVT *hd;
-        CVT *position;
-        螢(extent_t ,CVT) extent;
-      }螢(TM路Array ,CVT)路Tableau;
+        TM路CVT *hd;
+        TM路CVT *position;
+        螢(extent_t ,TM路CVT) extent;
+      }螢(TM路Array ,TM路CVT)路Tableau;
 
       //-----------------------------------
 
       // TM路Array.tape implementation
 
       //----------------------------------------
-      // TM Array implementation, not CVT differentiated
+      // TM Array implementation, not TM路CVT differentiated
 
-      Local TM路Tape路Topo TM路Array路Tape路topo( 螢(TM ,CVT)路Tableau *tableau ){
-        螢(TM路Array ,CVT)路Tableau *t = (螢(TM路Array ,CVT)路Tableau *)tableau;
+      Local TM路Tape路Topo TM路Array路Tape路topo( 螢(TM ,TM路CVT)路Tableau *tableau ){
+        螢(TM路Array ,TM路CVT)路Tableau *t = (螢(TM路Array ,TM路CVT)路Tableau *)tableau;
         if(!t || !t->position) return T路Tape路Topo路mu;
         if(t->extent == 0) TM路Tape路Topo路singleton; 
         return TM路Tape路Topo路segment;
       }
 
        // For an Array Tape Machine ,a bound tape will be singleton or segment.
-       TM路Tape路Topo  螢(TM路Array ,CVT)路Tape路topo(螢(TM路Array ,CVT) *tm){
+       TM路Tape路Topo  螢(TM路Array ,TM路CVT)路Tape路topo(螢(TM路Array ,TM路CVT) *tm){
          if(!tm || !tm->position) return TM路Tape路Topo路mu;
          if(tm->extent == 0) TM路Tape路Topo路singleton; 
          return TM路Tape路Topo路segment;
       }
 
       // check the Tape路topo to make sure tape has extent before calling this
-      // `extent路CVT` returns the index to the rightmost cell in the array.
-      Local  螢(extent_t ,CVT) 螢(TM路Array ,CVT)路extent(螢(TM路Array ,CVT) *tm){
+      // `extent路TM路CVT` returns the index to the rightmost cell in the array.
+      Local  螢(extent_t ,TM路CVT) 螢(TM路Array ,TM路CVT)路extent(螢(TM路Array ,TM路CVT) *tm){
         #ifdef TM路DEBUG
           Core路Guard路init_count(chk);
           Core路Tape路Topo Tape路topo = Core路Tape路Topo路mu;
-          Core路Status status = 螢(TM路Array ,CVT)路Tape路topo(tm ,&Tape路topo);
+          Core路Status status = 螢(TM路Array ,TM路CVT)路Tape路topo(tm ,&Tape路topo);
           bool good_Tape路topo = 
             (status == Core路Status路on_track) && (Tape路topo & Core路Tape路Topo路finite_nz)
             ;
       //-----------------------------------
       // TM路Array.area implementation 
 
-      Local Core路Status 螢(TM路Array ,CVT)路mount_pe(
-        螢(TM路Array ,CVT) *tm ,CVT *position ,螢(extent_t ,CVT) extent
+      Local Core路Status 螢(TM路Array ,TM路CVT)路mount_pe(
+        螢(TM路Array ,TM路CVT) *tm ,TM路CVT *position ,螢(extent_t ,TM路CVT) extent
       ){
         #ifdef TM路DEBUG
           Core路Guard路init_count(chk);
         return Core路Status路on_track;
       }
 
-      // If size of CVT is not a power of two this can perform a divide
-      Local Core路Status 螢(TM路Array ,CVT)路mount_pp(
-        螢(TM路Array ,CVT) *tm ,CVT *pos_leftmost ,CVT *pos_rightmost
+      // If size of TM路CVT is not a power of two this can perform a divide
+      Local Core路Status 螢(TM路Array ,TM路CVT)路mount_pp(
+        螢(TM路Array ,TM路CVT) *tm ,TM路CVT *pos_leftmost ,TM路CVT *pos_rightmost
       ){
         #ifdef TM路DEBUG
           Core路Guard路init_count(chk);
           Core路Guard路if_return(chk);
         #endif
 
-        螢(extent_t ,CVT) extent = pos_rightmost - pos_leftmost);
-        return 螢(TM路Array ,CVT)路mount_pe(tm ,pos_leftmost ,extent);
+        螢(extent_t ,TM路CVT) extent = pos_rightmost - pos_leftmost);
+        return 螢(TM路Array ,TM路CVT)路mount_pe(tm ,pos_leftmost ,extent);
       }
 
       //-----------------------------------
       // base Tape Machine operations
 
-      Local Core路Status 螢(TM路Array ,CVT)路mount(螢(TM路Array ,CVT) *tm){
+      Local Core路Status 螢(TM路Array ,TM路CVT)路mount(螢(TM路Array ,TM路CVT) *tm){
         #ifdef TM路DEBUG
           Core路Guard路init_count(chk);
           Core路Guard路fg.check(&chk ,1 ,tm ,TM路Array路Msg路tm);
         return Core路Status路on_track;
       }
 
-      Local Core路Status 螢(TM路Array ,CVT)路dismount(螢(TM路Array ,CVT) *tm){
+      Local Core路Status 螢(TM路Array ,TM路CVT)路dismount(螢(TM路Array ,TM路CVT) *tm){
         #ifdef TM路DEBUG
           Core路Guard路init_count(chk);
           Core路Guard路fg.check(&chk ,1 ,tm ,TM路Array路Msg路tm);
         return Core路Status路on_track;
       }
 
-      Local TM路Head路Status 螢(TM路Array ,CVT)路head_status(TM *tm){
+      Local TM路Head路Status 螢(TM路Array ,TM路CVT)路head_status(TM *tm){
         if(!tm || !tm->position) return TM路Head路Status路mu;
         if(!tm->hd) return TM路Head路Status路dismounted;
         if(tm->hd == tm->position) return TM路Head路Status路leftmost;
 
-        CVT *rightmost_pt = tm->position + tm->extent;
+        TM路CVT *rightmost_pt = tm->position + tm->extent;
         if(tm->hd == rightmost_pt) TM路Head路Status路rightmost;
         if(tm->hd < tm->position || tm->hd > rightmost_pt)
           return TM路Head路Status路out_of_area;
          return TM路Head路Status路interim;
       }
 
-      bool 螢(TM路Array ,CVT)路can_read(螢(TM路Array ,CVT) *tm){
+      bool 螢(TM路Array ,TM路CVT)路can_read(螢(TM路Array ,TM路CVT) *tm){
         return tm && tm->position && tm->hd;
       }
 
       // can_read was true
-      bool 螢(TM路Array ,CVT)路on_origin(螢(TM路Array ,CVT) *tm){
+      bool 螢(TM路Array ,TM路CVT)路on_origin(螢(TM路Array ,TM路CVT) *tm){
         #ifdef TM路DEBUG
           Core路Guard路init_count(chk);
           bool flag = true ,s;
-          s = 螢(TM路Array ,CVT)路head_on_format(tm ,flag) == Core路Status路on_track;
+          s = 螢(TM路Array ,TM路CVT)路head_on_format(tm ,flag) == Core路Status路on_track;
           Core路Guard路fg.check(&chk ,1 ,s && flag ,"head off format");
           Core路Guard路assert(chk);
         #endif
       }
 
       // can_read was true
-      bool 螢(TM路Array ,CVT)路on_rightmost(螢(TM路Array ,CVT) *tm){
+      bool 螢(TM路Array ,TM路CVT)路on_rightmost(螢(TM路Array ,TM路CVT) *tm){
         #ifdef TM路DEBUG
           Core路Guard路init_count(chk);
           bool flag = true ,s;
-          s = 螢(TM路Array ,CVT)路head_on_format(tm ,flag) == Core路Status路on_track;
+          s = 螢(TM路Array ,TM路CVT)路head_on_format(tm ,flag) == Core路Status路on_track;
           Core路Guard路fg.check(&chk ,1 ,s && flag ,"head off format");
           Core路Guard路assert(chk);
         #endif
         return tm->hd == tm->position;
       }
 
-      void 螢(TM路Array ,CVT)路step(螢(TM路Array ,CVT) *tm){
+      void 螢(TM路Array ,TM路CVT)路step(螢(TM路Array ,TM路CVT) *tm){
         #ifdef TM路DEBUG
           Core路Guard路init_count(chk);
           bool flag = true ,s;
-          s = 螢(TM路Array ,CVT)路head_on_format(tm ,flag) == Core路Status路on_track;
+          s = 螢(TM路Array ,TM路CVT)路head_on_format(tm ,flag) == Core路Status路on_track;
           Core路Guard路fg.check(&chk ,1 ,s && flag ,"head off format");
           Core路Guard路assert(chk);
         #endif
         tm->hd++;
       }
 
-      void 螢(TM路Array ,CVT)路step_left(螢(TM路Array ,CVT) *tm){
+      void 螢(TM路Array ,TM路CVT)路step_left(螢(TM路Array ,TM路CVT) *tm){
         #ifdef TM路DEBUG
           Core路Guard路init_count(chk);
           bool flag = true ,s;
-          s = 螢(TM路Array ,CVT)路head_on_format(tm ,flag) == Core路Status路on_track;
+          s = 螢(TM路Array ,TM路CVT)路head_on_format(tm ,flag) == Core路Status路on_track;
           Core路Guard路fg.check(&chk ,1 ,s && flag ,"head off format");
           Core路Guard路assert(chk);
         #endif
         tm->hd--;
       }
 
-      void 螢(TM路Array ,CVT)路rewind(螢(TM路Array ,CVT) *tm){
+      void 螢(TM路Array ,TM路CVT)路rewind(螢(TM路Array ,TM路CVT) *tm){
         #ifdef TM路DEBUG
           Core路Guard路init_count(chk);
           bool flag = true ,s;
-          s = 螢(TM路Array ,CVT)路head_on_format(tm ,flag) == Core路Status路on_track;
+          s = 螢(TM路Array ,TM路CVT)路head_on_format(tm ,flag) == Core路Status路on_track;
           Core路Guard路fg.check(&chk ,1 ,s && flag ,"head off format");
           Core路Guard路assert(chk);
         #endif
       }
 
       // tm_can_read must be true for both machines.
-      void 螢(TM路Array ,CVT)路copy_datum(螢(TM路Array ,CVT) *tm_read ,螢(TM路Array ,CVT) *tm_write){
+      void 螢(TM路Array ,TM路CVT)路copy_datum(螢(TM路Array ,TM路CVT) *tm_read ,螢(TM路Array ,TM路CVT) *tm_write){
         #ifdef TM路DEBUG
           Core路Guard路init_count(chk);
           bool flag = true ,s;
-          s = 螢(TM路Array ,CVT)路head_on_format(tm_read ,flag) == Control路Status路on_track;
+          s = 螢(TM路Array ,TM路CVT)路head_on_format(tm_read ,flag) == Control路Status路on_track;
           Core路Guard路fg.check(&chk ,1 ,s && flag ,"tm_read head off track");
-          s = 螢(TM路Array ,CVT)路head_on_format(tm_write ,flag) == Control路Status路on_track;
+          s = 螢(TM路Array ,TM路CVT)路head_on_format(tm_write ,flag) == Control路Status路on_track;
           Core路Guard路fg.check(&chk ,1 ,s && flag ,"tm_write head off track");
           Core路Guard路assert(chk);
         #endif
         return Core路Status路on_track;
       }
 
-      void 螢(TM路Array ,CVT)路read(螢(TM路Array ,CVT) *tm ,CVT *read_pt){
+      void 螢(TM路Array ,TM路CVT)路read(螢(TM路Array ,TM路CVT) *tm ,TM路CVT *read_pt){
         #ifdef TM路DEBUG
           Core路Guard路init_count(chk);
           bool flag = true ,s;
-          s = 螢(TM路Array ,CVT)路head_on_format(tm ,flag) == Core路Status路on_track;
+          s = 螢(TM路Array ,TM路CVT)路head_on_format(tm ,flag) == Core路Status路on_track;
           Core路Guard路fg.check(&chk ,1 ,s && flag ,"head off format");
           Core路Guard路assert(chk);
         #endif
 
 
       //----------------------------------------
-      // Initialization for 螢(TM路Array ,CVT)路fg
+      // Initialization for 螢(TM路Array ,TM路CVT)路fg
 
-      Local 螢(TM路Array ,CVT)路FG 螢(TM路Array ,CVT)路fg = {
+      Local 螢(TM路Array ,TM路CVT)路FG 螢(TM路Array ,TM路CVT)路fg = {
         .tape = {
-           .Tape路topo   = 螢(TM路Array ,CVT)路Tape路topo
-           .extent = 螢(TM路Array ,CVT)路extent
+           .Tape路topo   = 螢(TM路Array ,TM路CVT)路Tape路topo
+           .extent = 螢(TM路Array ,TM路CVT)路extent
         }
 
         ,.area = {
-           .mount_pe = 螢(TM路Array ,CVT)路mount_pe
-          ,.mount_pp = 螢(TM路Array ,CVT)路mount_pp
+           .mount_pe = 螢(TM路Array ,TM路CVT)路mount_pe
+          ,.mount_pp = 螢(TM路Array ,TM路CVT)路mount_pp
         }
 
-        ,.mount    = 螢(TM路Array ,CVT)路mount
-        ,.dismount = 螢(TM路Array ,CVT)路dismount
+        ,.mount    = 螢(TM路Array ,TM路CVT)路mount
+        ,.dismount = 螢(TM路Array ,TM路CVT)路dismount
 
-        ,.status         = 螢(TM路Array ,CVT)路status
-        ,.head_on_format = 螢(TM路Array ,CVT)路head_on_format
+        ,.status         = 螢(TM路Array ,TM路CVT)路status
+        ,.head_on_format = 螢(TM路Array ,TM路CVT)路head_on_format
 
-        ,.can_read     = 螢(TM路Array ,CVT)路can_read
-        ,.on_origin    = 螢(TM路Array ,CVT)路on_origin
-        ,.on_rightmost = 螢(TM路Array ,CVT)路on_rightmost
+        ,.can_read     = 螢(TM路Array ,TM路CVT)路can_read
+        ,.on_origin    = 螢(TM路Array ,TM路CVT)路on_origin
+        ,.on_rightmost = 螢(TM路Array ,TM路CVT)路on_rightmost
 
-        ,.step = 螢(TM路Array ,CVT)路step
-        ,.step_left = 螢(TM路Array ,CVT)路step_left
-        ,.step_right = 螢(TM路Array ,CVT)路step_right // Synonym for step
-        ,.rewind = 螢(TM路Array ,CVT)路rewind
+        ,.step = 螢(TM路Array ,TM路CVT)路step
+        ,.step_left = 螢(TM路Array ,TM路CVT)路step_left
+        ,.step_right = 螢(TM路Array ,TM路CVT)路step_right // Synonym for step
+        ,.rewind = 螢(TM路Array ,TM路CVT)路rewind
 
-        ,.copy_datum = 螢(TM路Array ,CVT)路copy_datum
-        ,.read = 螢(TM路Array ,CVT)路read
-        ,.write = 螢(TM路Array ,CVT)路write
+        ,.copy_datum = 螢(TM路Array ,TM路CVT)路copy_datum
+        ,.read = 螢(TM路Array ,TM路CVT)路read
+        ,.write = 螢(TM路Array ,TM路CVT)路write
 
       };
 
-    #endif // ifdef CVT
+    #endif // ifdef TM路CVT
 
   #endif // LOCAL
 
 #endif // IMPLEMENTATION
 
 
-void 螢(TM路Array ,CVT)路write(螢(TM路Array ,CVT) *tm ,CVT *write_pt){
+void 螢(TM路Array ,TM路CVT)路write(螢(TM路Array ,TM路CVT) *tm ,TM路CVT *write_pt){
   #ifdef TM路DEBUG
     Core路Guard路init_count(chk);
     bool flag = true ,s;
-    s = 螢(TM路Array ,CVT)路head_on_format(tm ,flag) == Core路Status路on_track;
+    s = 螢(TM路Array ,TM路CVT)路head_on_format(tm ,flag) == Core路Status路on_track;
     Core路Guard路fg.check(&chk ,1 ,s && flag ,"head off format");
     Core路Guard路assert(chk);
   #endif
@@ -633,7 +594,7 @@ void 螢(TM路Array ,CVT)路write(螢(TM路Array ,CVT) *tm ,CVT *write_pt){
       // TM struct initializers
 
       Local Core路Status TM路mount_pe(
-        TM *tm ,CVT *position ,螢(extent_t ,CVT) extent
+        TM *tm ,TM路CVT *position ,螢(extent_t ,TM路CVT) extent
       ){
         #ifdef TM路DEBUG
           Core路Guard路init_count(chk);
@@ -647,9 +608,9 @@ void 螢(TM路Array ,CVT)路write(螢(TM路Array ,CVT) *tm ,CVT *write_pt){
         return Core路Status路on_track;
       }
 
-      // If size of CVT is not a power of two this can perform a divide
+      // If size of TM路CVT is not a power of two this can perform a divide
       Local Core路Status TM路mount_pp(
-        TM *tm ,CVT *pos_leftmost ,CVT *pos_rightmost
+        TM *tm ,TM路CVT *pos_leftmost ,TM路CVT *pos_rightmost
       ){
         #ifdef TM路DEBUG
           Core路Guard路init_count(chk);
@@ -663,7 +624,7 @@ void 螢(TM路Array ,CVT)路write(螢(TM路Array ,CVT) *tm ,CVT *write_pt){
           Core路Guard路if_return(chk);
         #endif
 
-        螢(extent_t ,CVT) extent = pos_rightmost - pos_leftmost);
+        螢(extent_t ,TM路CVT) extent = pos_rightmost - pos_leftmost);
         return TM路mount_pe(tm ,pos_leftmost ,extent);
       }
 
index 91e81da..680bbf5 100644 (file)
@@ -1,6 +1,72 @@
 
 #ifndef CPP_EXT
 #define CPP_EXT
+
  #include "cpp_ext_0.c"
  #include "cpp_ext_1.c"
+
+  /*
+    Types must be registered with predicates.
+
+    // all legal FG路Type are registered here
+    #define EQ__int__oo__int
+    #define EQ__float__oo__float
+    #define EQ__char__oo__char
+    #define EQ__void__oo__void
+
+  */
+  #define FIRST_SEEN(type ,list) \
+    NOT(FIND_ITEM(type ,list)) )
+
+ // CAT(SEP, ...) will soon be added to cpp_ext_1, then this will be:
+ // #define 螢(...)  CAT(路 ,__VA_ARGS__)
+
+  // Individual macros for specific argument counts
+  #define _螢0() 
+  #define 螢0() _螢0()
+
+  #define _螢1(a) a
+  #define 螢1(a) _螢1(a)
+
+  #define _螢2(a ,b) a##路##b
+  #define 螢2(a ,b) _螢2(a ,b)
+
+  #define _螢3(a ,b ,c) a##路##b##路##c
+  #define 螢3(a ,b ,c) _螢3(a ,b ,c)
+
+  #define _螢4(a ,b ,c ,d) a##路##b##路##c##路##d
+  #define 螢4(a ,b ,c ,d) _螢4(a ,b ,c ,d)
+
+  #define _螢5(a ,b ,c ,d ,e) a##路##b##路##c##路##d##路##e
+  #define 螢5(a ,b ,c ,d ,e) _螢5(a ,b ,c ,d ,e)
+
+  #define _螢6(a ,b ,c ,d ,e ,f) a##路##b##路##c##路##d##路##e##路##f
+  #define 螢6(a ,b ,c ,d ,e ,f) _螢6(a ,b ,c ,d ,e ,f)
+
+  #define _螢7(a ,b ,c ,d ,e ,f ,g) a##路##b##路##c##路##d##路##e##路##f##路##g
+  #define 螢7(a ,b ,c ,d ,e ,f ,g) _螢7(a ,b ,c ,d ,e ,f ,g)
+
+  #define _螢8(a ,b ,c ,d ,e ,f ,g ,h) a##路##b##路##c##路##d##路##e##路##f##路##g##路##h
+  #define 螢8(a ,b ,c ,d ,e ,f ,g ,h) _螢8(a ,b ,c ,d ,e ,f ,g ,h)
+
+  #define _螢9(a ,b ,c ,d ,e ,f ,g ,h ,i) a##路##b##路##c##路##d##路##e##路##f##路##g##路##h##路##i
+  #define 螢9(a ,b ,c ,d ,e ,f ,g ,h ,i) _螢9(a ,b ,c ,d ,e ,f ,g ,h ,i)
+
+  #define _螢10(a ,b ,c ,d ,e ,f ,g ,h ,i ,j) a##路##b##路##c##路##d##路##e##路##f##路##g##路##h##路##i##路##j
+  #define 螢10(a ,b ,c ,d ,e ,f ,g ,h ,i ,j) _螢10(a ,b ,c ,d ,e ,f ,g ,h ,i ,j)
+
+  // Argument counting mechanism
+  #define _ARG_N(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N
+  #define COUNT_ARGS(...) _ARG_N(__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)
+
+  // Macro name concatenation
+  #define _CONCAT(a, b) a##b
+  #define CONCAT(a, b) _CONCAT(a, b)
+
+  // Selector that chooses the right macro based on argument count
+  #define 螢_EXPAND(count, ...) CONCAT(螢, count)(__VA_ARGS__)
+  #define 螢(...) 螢_EXPAND(COUNT_ARGS(__VA_ARGS__), __VA_ARGS__)
+
+
 #endif 
index 90a0120..573c27c 100644 (file)
@@ -37,7 +37,7 @@
 
   Macros starting with an '_' (underscore) are private.
 
-  EQ comparisons apart from logic comparisons, must be registered in advance. They take the form of, _RWR_EQ__<x>__oo__<y>, note comments below.
+  EQ comparisons apart from logic comparisons, must be registered in advance. They take the form of, EQ__<x>__oo__<y>, note comments below.
 
 5. todo
 
@@ -93,8 +93,8 @@ Constants
 #define _RWR_OR__0__oo__0
 
 // add more of this form to register other equivalences
-#define _RWR_EQ__0__oo__0
-#define _RWR_EQ__1__oo__1
+#define EQ__0__oo__0
+#define EQ__1__oo__1
 
 /*===========================================================================
 Primitive Concatenation
@@ -166,7 +166,7 @@ Logic Connectors
   #define _BOOL(x_item) \
     _AND( \
        EXISTS_ITEM( x_item ) \
-      ,NOT_MATCH_RWR( CAT2(_RWR_EQ__0__oo__ ,x_item) )  \
+      ,NOT_MATCH_RWR( CAT2(EQ__0__oo__ ,x_item) )  \
     )
   #define BOOL(x_item) _BOOL(_FIRST(x_item))
   
@@ -180,18 +180,18 @@ Logic Connectors
   more general than a connector because more rules can be added.
 
   each registered equality rule has the form
-     _RWR_EQ__<x>__oo__<y>
+     EQ__<x>__oo__<y>
   for example, logic equalities are already registered:
-     _RWR_EQ__0__oo__0
-     _RWR_EQ__1__oo__1
+     EQ__0__oo__0
+     EQ__1__oo__1
 
 ===========================================================================*/
 
   #define EQ(x_item ,y_item) \
-        MATCH_RWR( CAT4(_RWR_EQ__ ,x_item ,__oo__ ,y_item) )
+        MATCH_RWR( CAT4(EQ__ ,x_item ,__oo__ ,y_item) )
 
   #define NOT_EQ(x_item ,y_item) \
-    NOT_MATCH_RWR( CAT4(_RWR_EQ__ ,x_item ,__oo__ ,y_item) )
+    NOT_MATCH_RWR( CAT4(EQ__ ,x_item ,__oo__ ,y_item) )
 
 /*===========================================================================
   IF-ELSE construct.
index 1980b93..bc241d7 100644 (file)
@@ -71,5 +71,20 @@ DROPE_NOT_EXISTS_RIGHT
 // number of evals required depends upon length of not found list prefix
 #define FIND(predicate ,...) EVAL( _FIND(predicate ,__VA_ARGS__) )
 
+#define _FIND_ITEM(item ,...) \
+  IF \
+    ( NOT_EXISTS(__VA_ARGS__) ) \
+    () \
+    (IF \
+      ( EQ(item ,FIRST(__VA_ARGS__)) )             \
+      ( FIRST( ,__VA_ARGS__) )                    \
+      ( DEFER3(_FIND_ITEM_CONFEDERATE) ()(predicate ,REST(__VA_ARGS__)) )     \
+     )
+#define _FIND_ITEM_CONFEDERATE() _FIND_ITEM
+
+// number of evals required depends upon length of not found list prefix
+#define FIND_ITEM(predicate ,...) EVAL( _FIND_ITEM(predicate ,__VA_ARGS__) )
+
+
 
 #endif  
diff --git a/developer/cc馃枆/xi.c b/developer/cc馃枆/xi.c
deleted file mode 100644 (file)
index ae2b85c..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Xi (螢) macro implementation with variable argument support
- *
- * This file provides macros from 螢0 through 螢10 along with a selector
- * that automatically chooses the right macro based on argument count.
- *
- * Usage:
- *   螢(a)                 -> a
- *   螢(a ,b)              -> a路b
- *   螢(a ,b ,c)           -> a路b路c
- *   ...
- *   螢(a ,b ,c ,d ,e ,f) -> a路b路c路d路e路f
- *
- * For Map with two template parameters:
- *   螢(Map ,CVT_read ,CVT_write) -> Map路CVT_read路CVT_write
- */
-
-#ifndef XI_C
-#define XI_C
-
-// Individual macros for specific argument counts
-#define _螢0() 
-#define 螢0() _螢0()
-
-#define _螢1(a) a
-#define 螢1(a) _螢1(a)
-
-#define _螢2(a ,b) a##路##b
-#define 螢2(a ,b) _螢2(a ,b)
-
-#define _螢3(a ,b ,c) a##路##b##路##c
-#define 螢3(a ,b ,c) _螢3(a ,b ,c)
-
-#define _螢4(a ,b ,c ,d) a##路##b##路##c##路##d
-#define 螢4(a ,b ,c ,d) _螢4(a ,b ,c ,d)
-
-#define _螢5(a ,b ,c ,d ,e) a##路##b##路##c##路##d##路##e
-#define 螢5(a ,b ,c ,d ,e) _螢5(a ,b ,c ,d ,e)
-
-#define _螢6(a ,b ,c ,d ,e ,f) a##路##b##路##c##路##d##路##e##路##f
-#define 螢6(a ,b ,c ,d ,e ,f) _螢6(a ,b ,c ,d ,e ,f)
-
-#define _螢7(a ,b ,c ,d ,e ,f ,g) a##路##b##路##c##路##d##路##e##路##f##路##g
-#define 螢7(a ,b ,c ,d ,e ,f ,g) _螢7(a ,b ,c ,d ,e ,f ,g)
-
-#define _螢8(a ,b ,c ,d ,e ,f ,g ,h) a##路##b##路##c##路##d##路##e##路##f##路##g##路##h
-#define 螢8(a ,b ,c ,d ,e ,f ,g ,h) _螢8(a ,b ,c ,d ,e ,f ,g ,h)
-
-#define _螢9(a ,b ,c ,d ,e ,f ,g ,h ,i) a##路##b##路##c##路##d##路##e##路##f##路##g##路##h##路##i
-#define 螢9(a ,b ,c ,d ,e ,f ,g ,h ,i) _螢9(a ,b ,c ,d ,e ,f ,g ,h ,i)
-
-#define _螢10(a ,b ,c ,d ,e ,f ,g ,h ,i ,j) a##路##b##路##c##路##d##路##e##路##f##路##g##路##h##路##i##路##j
-#define 螢10(a ,b ,c ,d ,e ,f ,g ,h ,i ,j) _螢10(a ,b ,c ,d ,e ,f ,g ,h ,i ,j)
-
-// Argument counting mechanism
-#define _ARG_N(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N
-#define COUNT_ARGS(...) _ARG_N(__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)
-
-// Macro name concatenation
-#define _CONCAT(a, b) a##b
-#define CONCAT(a, b) _CONCAT(a, b)
-
-// Selector that chooses the right macro based on argument count
-#define 螢_EXPAND(count, ...) CONCAT(螢, count)(__VA_ARGS__)
-#define 螢(...) 螢_EXPAND(COUNT_ARGS(__VA_ARGS__), __VA_ARGS__)
-
-#endif /* XI_C */
index 90a0120..573c27c 100644 (file)
@@ -37,7 +37,7 @@
 
   Macros starting with an '_' (underscore) are private.
 
-  EQ comparisons apart from logic comparisons, must be registered in advance. They take the form of, _RWR_EQ__<x>__oo__<y>, note comments below.
+  EQ comparisons apart from logic comparisons, must be registered in advance. They take the form of, EQ__<x>__oo__<y>, note comments below.
 
 5. todo
 
@@ -93,8 +93,8 @@ Constants
 #define _RWR_OR__0__oo__0
 
 // add more of this form to register other equivalences
-#define _RWR_EQ__0__oo__0
-#define _RWR_EQ__1__oo__1
+#define EQ__0__oo__0
+#define EQ__1__oo__1
 
 /*===========================================================================
 Primitive Concatenation
@@ -166,7 +166,7 @@ Logic Connectors
   #define _BOOL(x_item) \
     _AND( \
        EXISTS_ITEM( x_item ) \
-      ,NOT_MATCH_RWR( CAT2(_RWR_EQ__0__oo__ ,x_item) )  \
+      ,NOT_MATCH_RWR( CAT2(EQ__0__oo__ ,x_item) )  \
     )
   #define BOOL(x_item) _BOOL(_FIRST(x_item))
   
@@ -180,18 +180,18 @@ Logic Connectors
   more general than a connector because more rules can be added.
 
   each registered equality rule has the form
-     _RWR_EQ__<x>__oo__<y>
+     EQ__<x>__oo__<y>
   for example, logic equalities are already registered:
-     _RWR_EQ__0__oo__0
-     _RWR_EQ__1__oo__1
+     EQ__0__oo__0
+     EQ__1__oo__1
 
 ===========================================================================*/
 
   #define EQ(x_item ,y_item) \
-        MATCH_RWR( CAT4(_RWR_EQ__ ,x_item ,__oo__ ,y_item) )
+        MATCH_RWR( CAT4(EQ__ ,x_item ,__oo__ ,y_item) )
 
   #define NOT_EQ(x_item ,y_item) \
-    NOT_MATCH_RWR( CAT4(_RWR_EQ__ ,x_item ,__oo__ ,y_item) )
+    NOT_MATCH_RWR( CAT4(EQ__ ,x_item ,__oo__ ,y_item) )
 
 /*===========================================================================
   IF-ELSE construct.
index 1980b93..bc241d7 100644 (file)
@@ -71,5 +71,20 @@ DROPE_NOT_EXISTS_RIGHT
 // number of evals required depends upon length of not found list prefix
 #define FIND(predicate ,...) EVAL( _FIND(predicate ,__VA_ARGS__) )
 
+#define _FIND_ITEM(item ,...) \
+  IF \
+    ( NOT_EXISTS(__VA_ARGS__) ) \
+    () \
+    (IF \
+      ( EQ(item ,FIRST(__VA_ARGS__)) )             \
+      ( FIRST( ,__VA_ARGS__) )                    \
+      ( DEFER3(_FIND_ITEM_CONFEDERATE) ()(predicate ,REST(__VA_ARGS__)) )     \
+     )
+#define _FIND_ITEM_CONFEDERATE() _FIND_ITEM
+
+// number of evals required depends upon length of not found list prefix
+#define FIND_ITEM(predicate ,...) EVAL( _FIND_ITEM(predicate ,__VA_ARGS__) )
+
+
 
 #endif  
index 886aec3..2bcc339 100644 (file)
@@ -4,10 +4,10 @@
 #define LIST int ,float ,char ,void 
 
 // register equality
-#define _RWR_EQ__int__oo__int
-#define _RWR_EQ__float__oo__float
-#define _RWR_EQ__char__oo__char
-#define _RWR_EQ__void__oo__void
+#define EQ__int__oo__int
+#define EQ__float__oo__float
+#define EQ__char__oo__char
+#define EQ__void__oo__void
 
 // make predicates
 #define IS_int(x)   EQ(x ,int)
index 56f2283..7b3660f 100644 (file)
@@ -3,7 +3,7 @@ RT-INCOMMON:=$(REPO_HOME)/tool_shared/third_party/RT-project-share/release
 
 include $(RT-INCOMMON)/make/environment_RT_0
 
-CFLAGS+=-Werror -include "$(RT-INCOMMON)/make/RT_0.h"
+CFLAGS+=-Werror -Wno-macro-redefined -include "$(RT-INCOMMON)/make/RT_0.h"
 LINKFLAGS+= -l$(PROJECT)
 LIBFILE=$(LIBDIR)/lib$(PROJECT).a