logo       

rev 512 - in trunk: pr/test src: msg#00079

Subject: rev 512 - in trunk: pr/test src
Author: mark
Date: 2004-05-20 03:54:49 -0400 (Thu, 20 May 2004)
New Revision: 512

Modified:
   trunk/pr/test/test.pr
   trunk/src/builtins-core.c
   trunk/src/object.c
Log:
added Object.objId_()

Modified: trunk/pr/test/test.pr
===================================================================
--- trunk/pr/test/test.pr       2004-05-19 23:26:17 UTC (rev 511)
+++ trunk/pr/test/test.pr       2004-05-20 07:54:49 UTC (rev 512)
@@ -17,7 +17,7 @@
         if attrname in attrs:
             a = attrs[attrname]
             if a.hasProto?(Func):
-                return a
+                return a 
             return a
     raise AttributeError
 
@@ -25,21 +25,70 @@
 object ModInt(Int):
     modulo = 10
     def call_(i=0):
+
+        if nextProto is not None:
+            proto2 = self.protoList()[1]
+            if proto2 is not nextProto:
+                print "err before"
+                raise xxx
+
         call = refer(ModInt, 'call_')
+        
+        if nextProto is not None:
+            proto2 = self.protoList()[1]
+            if proto2 is not nextProto:
+                print "err after"
+                raise xxx
+
         return call{self}(i % self.modulo)
+
     def add_(other):
         if self.modulo != other.modulo:
             raise TypeError
         proto = self.protoList()[1]
+        
+        if proto is not lastProto:
+                print "err 1"
+                raise xxx
+        proto2 = proto.protoList()[1]
+        if proto2 is not nextProto:
+                print "err 2"
+                raise xxx
+        
         add = refer(ModInt, 'add_')
+        
+        if proto is not lastProto:
+                print "err 3"
+                raise xxx
+        proto2 = proto.protoList()[1]
+        if proto2 is not nextProto:
+                print "err 4"
+                raise xxx
+        
         x =  proto(add{self}(other))
+        
+        proto = x.protoList()[1]
+        if proto is not lastProto:
+                print "err 5"
+                raise xxx
+        proto2 = proto.protoList()[1]
+        if proto2 is not nextProto:
+                print "err 6"
+                raise xxx
+        
         print "new", x
         return x
 
 object Mod8Int(ModInt):
     modulo = 8
 
+nextProto = None
 m = Mod8Int(1)
+lastProto = m.protoList()[1]
+nextProto = lastProto.protoList()[1]
+print "lastProto: %i" % lastProto.objId_()
+print "nextProto: %i" % nextProto.objId_()
+
 n = Mod8Int(1)
 print "%i, %s" % (m, m.protoList().str_())
 for i in 100:

Modified: trunk/src/builtins-core.c
===================================================================
--- trunk/src/builtins-core.c   2004-05-19 23:26:17 UTC (rev 511)
+++ trunk/src/builtins-core.c   2004-05-20 07:54:49 UTC (rev 512)
@@ -110,6 +110,10 @@
        return OBJ(NONE);
 }
 
+DEF(Object, objId_, NULL) {
+       return NEW_INT((intptr_t) self);
+}
+
 DEF(Object, Proto, FORM_STAR_PARAM) {
        int i, llen = (int) list_len(ist, parms[1]);
        obj_p new_obj;
@@ -763,6 +767,7 @@
        MODULE_SUB_INIT(Object);
        MODULE_ADD_SYM(Object, call_);
        MODULE_ADD_SYM(Object, init_);
+       MODULE_ADD_SYM(Object, objId_);
        MODULE_ADD_SYM(Object, Proto);
        MODULE_ADD_SYM(Object, copy);
        MODULE_ADD_SYM(Object, setReadAccess);

Modified: trunk/src/object.c
===================================================================
--- trunk/src/object.c  2004-05-19 23:26:17 UTC (rev 511)
+++ trunk/src/object.c  2004-05-20 07:54:49 UTC (rev 512)
@@ -767,7 +767,7 @@
 }
 
 //********************************* proto_list *****************************
-obj_p proto_list(isp ist, obj_p obj){
+obj_p proto_list(isp ist, obj_p obj) {
        i32_t i, j, k = 0, len;
        obj_p proto, list_obj;
        clist_t *pao_list;




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
web.pylons.gene...    hurd.l4/2002-10...    kernel.commits....    user-groups.lin...    yellowdog.gener...    java.drools.use...    security.openva...    package-managem...    linux.debian.us...    qnx.openqnx.dev...    genealogy.gramp...    file-systems.if...    voip.wengophone...    tex.context/200...    ietf.smime/2003...    audio.csound.de...    culture.region....    xfree86.devel/2...    mobile.kannel.u...    distributed.con...    education.engli...    org.user-groups...    bug-tracking.gn...    recreation.bicy...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe