rev 444 - in trunk: . include/prothon pr
SVN User <[email protected]> Sun, 02 May 2004 04:41:23 -0400
| Newsgroups | gmane.comp.lang.prothon.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: mark
Date: 2004-05-02 04:41:20 -0400 (Sun, 02 May 2004)
New Revision: 444
Modified:
trunk/STATUS.txt
trunk/include/prothon/prothon.h
trunk/pr/bin.pr
trunk/pr/test.pr
Log:
status update
Modified: trunk/STATUS.txt
===================================================================
--- trunk/STATUS.txt 2004-05-02 04:58:18 UTC (rev 443)
+++ trunk/STATUS.txt 2004-05-02 08:41:20 UTC (rev 444)
@@ -1,14 +1,23 @@
----------------------- TO-DO (highest priority first) ------------------------
-
+
+--- netowrking code -- web access demonstration of security
+
+--- def _call_(*args, **kwds):
+ obj = $_init_(*args, **kwds):
+ if obj is None: return $
+ return obj
+
+--- add obj.bind(obj.func)
+
+--- fix str-to-obj in parser for '\000abc'.len()
+
--- Complete File/Dir objects
--- add support for APR_BINARY in File.c ('b' flag)
--- support any object that supports file methods in stdxxx (duck std)
--- Auto-documenter app
---- Bound methods - binding - calling
-
--- How do we add "properties", "descriptors"?
--- binary space registering in object (1-double use of data, 2-wrong use of data)
Modified: trunk/include/prothon/prothon.h
===================================================================
--- trunk/include/prothon/prothon.h 2004-05-02 04:58:18 UTC (rev 443)
+++ trunk/include/prothon/prothon.h 2004-05-02 08:41:20 UTC (rev 444)
@@ -60,8 +60,8 @@
//#define DEBUG_THREADS
//#define DEBUG_MEM_MGR
//#define TRACE_PARSER
-#define DUMP_MODULE_CODE
-#define TRACE_INTERPRETER
+//#define DUMP_MODULE_CODE
+//#define TRACE_INTERPRETER
//#define DUMP_OBJECTS_AT_END
//#define PROSIST_DEBUG
Modified: trunk/pr/bin.pr
===================================================================
--- trunk/pr/bin.pr 2004-05-02 04:58:18 UTC (rev 443)
+++ trunk/pr/bin.pr 2004-05-02 08:41:20 UTC (rev 444)
@@ -9,23 +9,23 @@
print Int$__str__() # prints 99
try:
- with obj: Int$__init__(99) # init Int a second time
-except x,e: print e # throws "obj_set_data_owner error"
+ with obj: Int$__init__(99) # init Int a second time
+except x,e: print e # throws "object has binary data, expected none"
try:
- obj.__init__('abc') # init as String
-except x,e: print e # throws "object has binary data, expected none"
+ obj.__init__('abc') # init as String
+except x,e: print e # throws "object has binary data, expected none"
-L = Proto(List) # L is uninitialized list
+L = Proto(List) # L is uninitialized list
L.__init__(1,2,3)
-print L
+print L # prints [1, 2, 3]
L.__init__(4,5,6)
-print L
+print L # prints [4, 5, 6]
d = {1:2, 'a':'b'}
-print d
+print d # prints {1:2, 'a':'b'}
d.__init__(c = 'd', f = 'g')
-print d
\ No newline at end of file
+print d # prints {f:'g', c:'d'}
\ No newline at end of file
Modified: trunk/pr/test.pr
===================================================================
--- trunk/pr/test.pr 2004-05-02 04:58:18 UTC (rev 443)
+++ trunk/pr/test.pr 2004-05-02 08:41:20 UTC (rev 444)
@@ -1,35 +1,15 @@
#!/usr/bin/env prothon
-# bin.pr
+# cache.pr
-x = Proto(Int)
-x.__init__(99)
-print x
+> # 2) Add caching to Mod16Int:
+> object Mod16IntC(Mod16Int):
+> $cache = {}
+> def $__new__(i):
+> i = i % $modulo
+> if i in $cache:
+> return $cache[i]
+> obj = ^__new__(i)
+> $cache[i] = obj
+> return obj
-x = Exception
-
-object obj(String, Int):
- Int$__init__(99) # inits using second proto
- print Int$__str__() # prints 99
-
-try:
- with obj: Int$__init__(99) # init Int a second time
-except x,e: print e # throws "obj_set_data_owner error"
-
-try:
- obj.__init__('abc') # init as String
-except x,e: print e # throws "object has binary data, expected none"
-
-L = Proto(List) # L is uninitialized list
-
-L.__init__(1,2,3)
-print L
-
-L.__init__(4,5,6)
-print L
-
-d = {1:2, 'a':'b'}
-print d
-
-d.__init__(c = 'd', f = 'g')
-print d
\ No newline at end of file