Adding STklos primitives

From: David Fox <fox_at_FIRST.CS.NYU.EDU>
Date: Wed, 7 Jun 95 23:07:09 EDT

Below is a patch containing my hack to let stk library clients add new
STklos primitive types. This didn't make it into 2.1.7 for whatever
reason, so I want to reiterate that I really need this feature to do
my work.

*** STk-2.1.7/STklos/stklos.c.orig Mon May 1 13:50:31 1995
--- STk-2.1.7/STklos/stklos.c Wed Jun 7 22:45:05 1995
***************
*** 33,35 ****
  
! static SCM Top, Object, Class;
  static SCM Boolean, Char, Pair, Procedure, String, Symbol, Vector, Number,
--- 33,35 ----
  
! SCM Top, Object, Class;
  static SCM Boolean, Char, Pair, Procedure, String, Symbol, Vector, Number,
***************
*** 343,344 ****
--- 343,345 ----
  
+ SCM class_of_table[1024] = {0,};
  
***************
*** 353,354 ****
--- 354,361 ----
  
+ void STk_make_prim_type(int type, SCM *var, char *name, SCM meta, SCM super)
+ {
+ make_prim_type(var, name, meta, super);
+ class_of_table[type] = *var;
+ }
+
  static void make_primitive_classes(void)
***************
*** 399,401 ****
      case tc_tkcommand: return Widget;
! default: return (STk_procedurep(obj) == Truth)? Procedure: Unknown;
    }
--- 406,410 ----
      case tc_tkcommand: return Widget;
! default:
! if (STk_procedurep(obj) == Truth) return Procedure;
! else return class_of_table[TYPE(obj)] ? : Unknown;
    }
Received on Thu Jun 08 1995 - 05:07:52 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST