rev 412 - in trunk: modules/Prosist pr

SVN User <[email protected]> Sat, 24 Apr 2004 18:40:55 -0400
Newsgroups gmane.comp.lang.prothon.cvs
Message-ID <[email protected]>
Author: mark
Date: 2004-04-24 18:40:52 -0400 (Sat, 24 Apr 2004)
New Revision: 412

Added:
   trunk/pr/int.pr
Modified:
   trunk/modules/Prosist/Prosist.c
   trunk/pr/prosist.pr
Log:
prosist store/load still buggy (aarrggh)

Modified: trunk/modules/Prosist/Prosist.c
===================================================================
--- trunk/modules/Prosist/Prosist.c	2004-04-24 21:26:27 UTC (rev 411)
+++ trunk/modules/Prosist/Prosist.c	2004-04-24 22:40:52 UTC (rev 412)
@@ -356,8 +356,11 @@
 	int i, llen = (int) list_len(ist, olst);
 	for(i=0; i < llen; i++) {					
 		obj_p item = list_item(ist, olst, i);
-		if (item != OBJ(NONE))
+		if (item != OBJ(NONE)) {
+			if (has_proto_QUES(ist, item, MutWrap_OBJ))
+				item = (obj_p) item->data.ptr;
 			read_unlock(ist, item);				
+		}
 	}											
 	del_unlock(olst);
 }
@@ -370,6 +373,7 @@
 
 	mw_obj = NEW_MW(obj);
 	if (obj == OBJ(NONE) || dict_item(ist, psrecp->obj_to_id, mw_obj)) {
+		list_item_set(ist, store_refs, objidx, OBJ(NONE));
 		del_unlock(mw_obj);
 		return;
 	}

Added: trunk/pr/int.pr
===================================================================
--- trunk/pr/int.pr	2004-04-24 21:26:27 UTC (rev 411)
+++ trunk/pr/int.pr	2004-04-24 22:40:52 UTC (rev 412)
@@ -0,0 +1,12 @@
+INT=Int()
+with INT:
+	def .__add__(other):
+		print ., "+", other
+		i = ^__add__(other) % 16
+		i.setProto(INT)
+		return i
+i=16
+i.setProto(INT)
+j=4
+j.setProto(INT)
+print i+j
Modified: trunk/pr/prosist.pr
===================================================================
--- trunk/pr/prosist.pr	2004-04-24 21:26:27 UTC (rev 411)
+++ trunk/pr/prosist.pr	2004-04-24 22:40:52 UTC (rev 412)
@@ -4,11 +4,6 @@
 
 import Prosist
 
-a = {1:2}
-
-db = Prosist('test.pdb', root=a, mode=Prosist.RWTRUNCATE)
-
-/*
 b = 7.3
 
 c = "hello"
@@ -41,6 +36,5 @@
 a = 1
 
 print
-print x, x[6].a , x[6].b , x[6].c 
-
-*/
\ No newline at end of file
+print x
+#, x[6].a , x[6].b , x[6].c