rev 373 - in trunk: include/prothon modules/File modules/OS modules/Prosist modules/Re modules/SQLite src
SVN User <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: mark
Date: 2004-04-17 01:12:18 -0400 (Sat, 17 Apr 2004)
New Revision: 373
Modified:
trunk/include/prothon/prothon.h
trunk/include/prothon/prothon_dll.h
trunk/modules/File/File.c
trunk/modules/OS/OS.c
trunk/modules/Prosist/Prosist.c
trunk/modules/Re/Re.c
trunk/modules/SQLite/SQLite.c
trunk/src/builtins-core.c
trunk/src/builtins-dict.c
trunk/src/builtins-float.c
trunk/src/builtins-int.c
trunk/src/builtins-list.c
trunk/src/builtins-string.c
trunk/src/builtins-tuple.c
trunk/src/interp.c
trunk/src/object.c
trunk/src/symbol.c
trunk/src/sys.c
Log:
still working on prosist
Modified: trunk/include/prothon/prothon.h
===================================================================
--- trunk/include/prothon/prothon.h 2004-04-17 02:48:57 UTC (rev 372)
+++ trunk/include/prothon/prothon.h 2004-04-17 05:12:18 UTC (rev 373)
@@ -184,8 +184,8 @@
typedef struct obj_s {
- obj_state_t state :3; // 2 when not debugging
- data_type_t data_type :3; // 2 when not debugging
+ obj_state_t state :3; // u8_t :2 when not debugging
+ data_type_t data_type :3; // u8_t :2 when not debugging
u8_t imm_data_len :4;
access_t rd_access :2;
access_t wr_access :2;
@@ -195,8 +195,8 @@
u8_t scanned :1;
u8_t has_attrs :1;
u8_t del_locked :1;
- u8_t rdlock_cnt :6; // 7 when not debugging
- u8_t wrlock_req_cnt :6; // 7 when not debugging
+ u8_t rdlock_cnt :6; // :7 when not debugging
+ u8_t wrlock_req_cnt :6; // :7 when not debugging
i32_t wrlock;
attr_proto_t attr_proto;
obj_data_t data;
@@ -404,7 +404,6 @@
MAX,
MIN,
COPY,
- __CREATOR__,
__STORPROXY__,
__NEWVIASTORPROXY__,
@@ -683,17 +682,27 @@
// SET_OBJ_ID: Mark an object as a identity object with a name
// This is used by Prosist, the persistence engine and other documentation.
-// Any object that has a unique identity across runs of the interpreter
-// and different interpreters should be marked with this flag.
+// Any object that occupies a constant attribute slot at all times
+// should be marked with this attribute so that it can be found.
+// Being constant means it has a unique identity across runs of the
+// interpreter and different interpreters should be marked as such.
// Not two objects in the same namespace should have this same name.
+// The module name and object name are convenience for finding the obj.
+// The following should be true at all times: obj = module.name
+// module == * -> obj = Object.name
+// module and container equal to * means Object.name.
+// no quotes are needed, ex: set_obj_id(Match_OBJ, Re_OBJ, Match);
// All Prototypes should be marked with this.
-#define set_obj_id(ist, obj, name) \
- set_attr(ist, (obj), SYM(__ID__), new_string_obj(ist, (name)));
+#define set_obj_id(obj, module, name) \
+ set_attr(ist, (obj), SYM(__ID__), \
+ list2(ist, new_string_obj(ist, (#module)), \
+ new_string_obj(ist, (#name)) ) )
// SET_OBJ_DOC: Add document string (__doc__) to object
// This can be used on any object. It is recommended that it be used
// liberally to make browsing objects easier and to make dumps readable.
-void set_obj_doc(isp ist, obj_p obj, char* str);
+void set_obj_doc_f(isp ist, obj_p obj, char* str);
+#define set_obj_doc(obj, str) set_obj_doc_f(ist, (obj), (str))
#ifndef NO_APR
// NEW_THREAD_OBJ: Create a new thread object and start the thread
Modified: trunk/include/prothon/prothon_dll.h
===================================================================
--- trunk/include/prothon/prothon_dll.h 2004-04-17 02:48:57 UTC (rev 372)
+++ trunk/include/prothon/prothon_dll.h 2004-04-17 05:12:18 UTC (rev 373)
@@ -97,7 +97,7 @@
obj_p (*call_func1_f)(isp ist, obj_p self, obj_p sym, obj_p parm);
obj_p (*sym)(isp ist, char* symbol);
obj_p (*new_object)(isp ist, obj_p proto);
- void (*set_obj_doc)(isp ist, obj_p obj, char* str);
+ void (*set_obj_doc_f)(isp ist, obj_p obj, char* str);
obj_p (*dict_keys_values)(isp ist, obj_p dict_obj, int key_flg);
obj_p (*check_exceptions)(isp ist);
@@ -197,7 +197,7 @@
#define MODULE_SET_DOC(name, docstr) \
- set_obj_doc(ist, name##_OBJ, #name ": " docstr); \
+ set_obj_doc(name##_OBJ, #name ": " docstr); \
check_exceptions(ist);
#ifndef OBJECT_H
@@ -234,7 +234,7 @@
#define list8 (*services->list8)
#define raise_exception (*services->raise_exception)
#define new_object (*services->new_object)
-#define set_obj_doc (*services->set_obj_doc)
+#define set_obj_doc_f (*services->set_obj_doc_f)
#define pr_malloc (*services->pr_malloc)
#define pr_realloc (*services->pr_realloc)
#define pr_free (*services->pr_free)
Modified: trunk/modules/File/File.c
===================================================================
--- trunk/modules/File/File.c 2004-04-17 02:48:57 UTC (rev 372)
+++ trunk/modules/File/File.c 2004-04-17 05:12:18 UTC (rev 373)
@@ -121,7 +121,8 @@
MODULE_START(File)
{
File_OBJ = new_object(ist, NULL);
- set_obj_doc(ist, File_OBJ, "File object prototype");
+ set_obj_doc(File_OBJ, "File object prototype");
+
MODULE_ADD_TO_BASE(File);
File_OBJ->unclonable = TRUE;
}
Modified: trunk/modules/OS/OS.c
===================================================================
--- trunk/modules/OS/OS.c 2004-04-17 02:48:57 UTC (rev 372)
+++ trunk/modules/OS/OS.c 2004-04-17 05:12:18 UTC (rev 373)
@@ -63,6 +63,7 @@
{
OS_OBJ = new_object(ist, NULL);
MODULE_SET_DOC(OS, "Operating System specific routines");
+ set_obj_id(OS_OBJ, *, OS);
MODULE_ADD_TO_BASE(OS);
}
@@ -70,7 +71,7 @@
if (!has_proto_QUES(ist, parms[1], OBJ(STRING_PROTO))) {
ist->exception_obj = new_object(ist, OBJ(TYPE_EXC));
ist->exception_obj->wr_access = ACC_GUEST;
- set_obj_doc(ist, ist->exception_obj, "object is not of type string");
+ set_obj_doc(ist->exception_obj, "object is not of type string");
return NULL;
}
return new_int_obj(ist, system(strch(parms[1])));
Modified: trunk/modules/Prosist/Prosist.c
===================================================================
--- trunk/modules/Prosist/Prosist.c 2004-04-17 02:48:57 UTC (rev 372)
+++ trunk/modules/Prosist/Prosist.c 2004-04-17 05:12:18 UTC (rev 373)
@@ -167,7 +167,7 @@
read_unlock(ist, self);
set_obj_rdacc(self, ACC_USER1);
- set_obj_doc(ist, self, "Prosist DataBase");
+ set_obj_doc(self, "Prosist DataBase");
set_attr(ist, self, sym(ist, "filename"), parms[1]);
set_attr(ist, self, sym(ist, "root"), root_obj);
read_lock(ist, self);
Modified: trunk/modules/Re/Re.c
===================================================================
--- trunk/modules/Re/Re.c 2004-04-17 02:48:57 UTC (rev 372)
+++ trunk/modules/Re/Re.c 2004-04-17 05:12:18 UTC (rev 373)
@@ -74,6 +74,7 @@
{
Re_OBJ = new_object(ist, NULL);
MODULE_SET_DOC(Re, "module for regular expressions");
+ set_obj_id(Re_OBJ, *, Re);
MODULE_ADD_TO_BASE(Re);
ReException_OBJ = new_object(ist, OBJ(EXCEPTION));
@@ -135,6 +136,7 @@
{
ReCompiled_OBJ = new_object(ist, NULL);
MODULE_ADD_TO_OBJ(ReCompiled, Re_OBJ, "Re");
+ set_obj_id(ReCompiled_OBJ, Re, Re);
MODULE_SET_DOC(ReCompiled, "prototype for compiled regular expressions");
}
@@ -515,6 +517,7 @@
{
ReMatch_OBJ = new_object(ist, NULL);
MODULE_SET_DOC(ReMatch, "prototype for regular expression match objects");
+ set_obj_id(ReMatch_OBJ, Re, Match);
MODULE_ADD_TO_OBJ(ReMatch, Re_OBJ, "Match");
}
Modified: trunk/modules/SQLite/SQLite.c
===================================================================
--- trunk/modules/SQLite/SQLite.c 2004-04-17 02:48:57 UTC (rev 372)
+++ trunk/modules/SQLite/SQLite.c 2004-04-17 05:12:18 UTC (rev 373)
@@ -107,7 +107,7 @@
CHECK_TYPE_EXC(parms[1], OBJ(STRING_PROTO), "string");
filename = strch(parms[1]);
conn_obj = new_object(ist, Connection_OBJ);
- set_obj_doc(ist, conn_obj, "SQLite connection");
+ set_obj_doc(conn_obj, "SQLite connection");
conn_obj->unclonable = TRUE;
set_obj_rdacc(conn_obj, ACC_USER1);
conn_obj->data_type = DATA_TYPE_DATAPTR;
@@ -123,7 +123,7 @@
if (self->data.ptr) {
cursor_p cursorp;
obj_p curs_obj = new_object(ist, Cursor_OBJ);
- set_obj_doc(ist, curs_obj, "SQLite cursor");
+ set_obj_doc(curs_obj, "SQLite cursor");
curs_obj->data_type = DATA_TYPE_DATAPTR;
cursorp = curs_obj->data.ptr = pr_malloc(sizeof(cursor_t));
cursorp->ist = ist;
Modified: trunk/src/builtins-core.c
===================================================================
--- trunk/src/builtins-core.c 2004-04-17 02:48:57 UTC (rev 372)
+++ trunk/src/builtins-core.c 2004-04-17 05:12:18 UTC (rev 373)
@@ -79,13 +79,14 @@
{
Object_OBJ = OBJ(OBJECT);
MODULE_SET_DOC(Object, "prototype base for all objects");
+ set_obj_id(Object_OBJ, *, Object);
- set_obj_doc(ist, OBJ(SYMBOL_PROTO), "Symbol object prototype");
- set_obj_doc(ist, OBJ(HASH_PROTO), "Hash object prototype");
- set_obj_doc(ist, OBJ(SLICE_PROTO), "Slice object prototype");
- set_obj_doc(ist, OBJ(SUPER_PROTO), "Super object prototype");
- set_obj_doc(ist, OBJ(ROOT_GLOBALS), "Root_Globals: recursive container of all objects");
- set_obj_doc(ist, OBJ(MODULES), "Modules: container of all modules");
+ set_obj_doc(OBJ(SYMBOL_PROTO), "Symbol object prototype");
+ set_obj_doc(OBJ(HASH_PROTO), "Hash object prototype");
+ set_obj_doc(OBJ(SLICE_PROTO), "Slice object prototype");
+ set_obj_doc(OBJ(SUPER_PROTO), "Super object prototype");
+ set_obj_doc(OBJ(ROOT_GLOBALS), "Root_Globals: recursive container of all objects");
+ set_obj_doc(OBJ(MODULES), "Modules: container of all modules");
set_attr(ist, OBJ(OBJECT), sym(ist, "Root_Globals"), OBJ(ROOT_GLOBALS));
set_attr(ist, OBJ(OBJECT), sym(ist, "Modules"), OBJ(MODULES));
@@ -336,17 +337,6 @@
return parms[1];
}
-DEF(Object, __creator__, NULL) {
- obj_p name;
- char buf[512];
- if (name = get_attr(ist, self, SYM(__ID__))) {
- apr_snprintf(buf, sizeof(buf), "1:%s", strch(name));
- del_unlock(name);
- return list3(ist, OBJ(NONE), new_string_obj(ist, "Object"), new_string_obj(ist, buf));
- }
- return list3(ist, OBJ(NONE), OBJ(NONE), new_string_obj(ist, "Object"));
-}
-
DEF(Object, __storProxy__, NULL) {
return self;
}
@@ -363,7 +353,7 @@
False_OBJ = OBJ(PR_FALSE);
MODULE_SET_DOC(False, "boolean false identity value");
set_attr(ist, OBJ(OBJECT), sym(ist, "False"), False_OBJ);
- set_obj_id(ist, False_OBJ, "False");
+ set_obj_id(False_OBJ, *, False);
}
DEF(False, __str__, NULL) { return new_string_obj(ist, "False"); }
@@ -382,7 +372,7 @@
True_OBJ = OBJ(PR_TRUE);
MODULE_SET_DOC(True, "boolean true identity value");
set_attr(ist, OBJ(OBJECT), sym(ist, "True"), True_OBJ);
- set_obj_id(ist, True_OBJ, "True");
+ set_obj_id(True_OBJ, *, True);
}
DEF(True, __str__, NULL) { return new_string_obj(ist, "True"); }
@@ -406,7 +396,7 @@
None_OBJ = OBJ(NONE);
MODULE_SET_DOC(None, "represents empty set");
set_attr(ist, OBJ(OBJECT), sym(ist, "None"), None_OBJ);
- set_obj_id(ist, None_OBJ, "None");
+ set_obj_id(None_OBJ, *, None);
}
DEF(None, __str__, NULL) {
@@ -429,10 +419,10 @@
MODULE_SET_DOC(Exception, "prototype of all exception objects");
set_attr(ist, OBJ(OBJECT), sym(ist, "Exception"), Exception_OBJ);
-#define EXCEPTION_DECLARE(proto, exc_const, name, desc_str) \
- OBJ(exc_const) = new_object(ist, proto); \
- set_obj_doc( ist, OBJ(exc_const), desc_str); \
- set_obj_id(ist, OBJ(exc_const), #name); \
+#define EXCEPTION_DECLARE(proto, exc_const, name, desc_str) \
+ OBJ(exc_const) = new_object(ist, proto); \
+ set_obj_id(OBJ(exc_const), *, name); \
+ set_obj_doc(OBJ(exc_const), desc_str); \
set_attr(ist, OBJ(OBJECT), sym(ist, #name), OBJ(exc_const))
/* Other exception objects dependent on this one */
@@ -458,7 +448,7 @@
char buf[512];
if (list_len(ist, parms[1]) > 0) {
apr_snprintf(buf, sizeof(buf), "%s", as_str(ist, list_item(ist, parms[1], 0)));
- set_obj_doc(ist, self, buf);
+ set_obj_doc(self, buf);
}
return OBJ(NONE);
}
@@ -468,6 +458,8 @@
{
Gen_OBJ = OBJ(GEN_PROTO);
MODULE_SET_DOC(Gen, "generator object prototype");
+ set_attr(ist, OBJ(OBJECT), sym(ist, "Generator"), Gen_OBJ);
+ set_obj_id(Gen_OBJ, *, Generator);
}
DEF(Gen, __iter__, NULL) {
@@ -481,6 +473,7 @@
Seq_OBJ = OBJ(SEQ_PROTO);
MODULE_SET_DOC(Seq, "object prototype");
set_attr(ist, OBJ(OBJECT), sym(ist, "Sequence"), Seq_OBJ);
+ set_obj_id(Seq_OBJ, *, Sequence);
}
obj_p str_tuple_list(isp ist, obj_p self, char* ldelim, char* rdelim)
@@ -643,6 +636,7 @@
{
Func_OBJ = OBJ(FUNC_PROTO);
MODULE_SET_DOC(Func, "function object prototype");
+ set_obj_id(Func_OBJ, *, Function);
}
DEF(Func, __cDataLen__, NULL) {
@@ -693,7 +687,6 @@
MODULE_ADD_SYM(Object, attrs);
MODULE_ADD_SYM(Object, CurrentThread);
MODULE_ADD_SYM(Object, Sleep);
- MODULE_ADD_SYM(Object, __creator__);
MODULE_ADD_SYM(Object, __storProxy__);
MODULE_ADD_SYM(Object, __newViaStorProxy__);
Modified: trunk/src/builtins-dict.c
===================================================================
--- trunk/src/builtins-dict.c 2004-04-17 02:48:57 UTC (rev 372)
+++ trunk/src/builtins-dict.c 2004-04-17 05:12:18 UTC (rev 373)
@@ -208,6 +208,7 @@
Dict_OBJ = OBJ(DICT_PROTO);
MODULE_SET_DOC(Dict, "dictionary object prototype");
+ set_obj_id(Dict_OBJ, *, Dict);
set_attr(ist, OBJ(OBJECT), sym(ist, "Dict"), Dict_OBJ);
Dict_OBJ->data_type = DATA_TYPE_DATAPTR;
Modified: trunk/src/builtins-float.c
===================================================================
--- trunk/src/builtins-float.c 2004-04-17 02:48:57 UTC (rev 372)
+++ trunk/src/builtins-float.c 2004-04-17 05:12:18 UTC (rev 373)
@@ -91,8 +91,10 @@
// Imag_OBJ = OBJ(IMAG_PROTO) = new_object(ist, NULL);
OBJ(IMAG_PROTO) = new_object(ist, NULL);
- set_obj_doc(ist, OBJ(FLOAT_PROTO), "Float number object prototype");
- set_obj_doc(ist, OBJ(IMAG_PROTO), "Imaginary number object prototype");
+ set_obj_doc(OBJ(FLOAT_PROTO), "Float number object prototype");
+ set_obj_id(Float_OBJ, *, Float);
+ set_obj_doc(OBJ(IMAG_PROTO), "Imaginary number object prototype");
+ set_obj_id(OBJ(IMAG_PROTO), *, Imaginary);
set_attr(ist, OBJ(OBJECT), sym(ist, "Float"), OBJ(FLOAT_PROTO));
set_attr(ist, OBJ(OBJECT), sym(ist, "Imaginary"), OBJ(IMAG_PROTO));
Modified: trunk/src/builtins-int.c
===================================================================
--- trunk/src/builtins-int.c 2004-04-17 02:48:57 UTC (rev 372)
+++ trunk/src/builtins-int.c 2004-04-17 05:12:18 UTC (rev 373)
@@ -91,6 +91,7 @@
{
Int_OBJ = OBJ(INT_PROTO);
MODULE_SET_DOC(Int, "number object prototype");
+ set_obj_id(Int_OBJ, *, Int);
set_attr(ist, OBJ(OBJECT), sym(ist, "Int"), Int_OBJ);
/* Dependent objects */
@@ -98,7 +99,7 @@
OBJ(MAX_INT) = new_int_obj(ist, MAX_INT_VAL);
OBJ(LONG_PROTO) = new_string_obj(ist, "0");
clr_immutable(OBJ(LONG_PROTO));
- set_obj_doc(ist, OBJ(LONG_PROTO), "Long integer number object prototype");
+ set_obj_doc(OBJ(LONG_PROTO), "Long integer number object prototype");
set_immutable(OBJ(LONG_PROTO));
Int_OBJ->data_type = DATA_TYPE_IMMDATA;
Modified: trunk/src/builtins-list.c
===================================================================
--- trunk/src/builtins-list.c 2004-04-17 02:48:57 UTC (rev 372)
+++ trunk/src/builtins-list.c 2004-04-17 05:12:18 UTC (rev 373)
@@ -283,6 +283,7 @@
List_OBJ = OBJ(LIST_PROTO);
MODULE_SET_DOC(List, "object prototype");
+ set_obj_id(List_OBJ, *, List);
set_attr(ist, OBJ(OBJECT), sym(ist, "List"), List_OBJ);
List_OBJ->data_type = DATA_TYPE_DATAPTR;
Modified: trunk/src/builtins-string.c
===================================================================
--- trunk/src/builtins-string.c 2004-04-17 02:48:57 UTC (rev 372)
+++ trunk/src/builtins-string.c 2004-04-17 05:12:18 UTC (rev 373)
@@ -122,6 +122,7 @@
{
String_OBJ = OBJ(STRING_PROTO);
MODULE_SET_DOC(String, "string object prototype");
+ set_obj_id(String_OBJ, *, String);
set_attr(ist, OBJ(OBJECT), sym(ist, "String"), String_OBJ);
String_OBJ->data_type = DATA_TYPE_IMMDATA;
String_OBJ->imm_data_len = 0;
@@ -375,6 +376,8 @@
MODULE_START(StringGen)
{
StringGen_OBJ = new_object(ist, NULL);
+ set_attr(ist, OBJ(OBJECT), sym(ist, "StringGen"), StringGen_OBJ);
+ set_obj_id(StringGen_OBJ, *, StringGen);
}
DEF(StringGen, next, NULL) {
Modified: trunk/src/builtins-tuple.c
===================================================================
--- trunk/src/builtins-tuple.c 2004-04-17 02:48:57 UTC (rev 372)
+++ trunk/src/builtins-tuple.c 2004-04-17 05:12:18 UTC (rev 373)
@@ -84,6 +84,7 @@
Tuple_OBJ = OBJ(TUPLE_PROTO);
MODULE_SET_DOC(Tuple, "object prototype");
+ set_obj_id(Tuple_OBJ, *, Tuple);
set_attr(ist, OBJ(OBJECT), sym(ist, "Tuple"), Tuple_OBJ);
Tuple_OBJ->data_type = DATA_TYPE_DATAPTR;
Modified: trunk/src/interp.c
===================================================================
--- trunk/src/interp.c 2004-04-17 02:48:57 UTC (rev 372)
+++ trunk/src/interp.c 2004-04-17 05:12:18 UTC (rev 373)
@@ -1502,7 +1502,7 @@
}
#endif
apr_snprintf(full_doc, sizeof(full_doc), "%s%s", name, comment);
- set_obj_doc(ist, module, full_doc);
+ set_obj_doc(module, full_doc);
frame = ist->frame;
new_locals = new_object(ist, NULL);
set_attr(ist, module, SYM(__LOCALS__), new_locals);
Modified: trunk/src/object.c
===================================================================
--- trunk/src/object.c 2004-04-17 02:48:57 UTC (rev 372)
+++ trunk/src/object.c 2004-04-17 05:12:18 UTC (rev 373)
@@ -154,7 +154,7 @@
dll_services.list6 = list6;
dll_services.raise_exception = raise_exception;
dll_services.new_object = new_object;
- dll_services.set_obj_doc = set_obj_doc;
+ dll_services.set_obj_doc_f = set_obj_doc_f;
dll_services.obj_malloc = obj_malloc;
dll_services.obj_realloc = obj_realloc;
dll_services.obj_free = obj_free;
@@ -209,7 +209,7 @@
init_symbol(ist);
- set_obj_doc(ist, OBJ(SYMBOLS), "Symbols: list of all symbol objects");
+ set_obj_doc(OBJ(SYMBOLS), "Symbols: list of all symbol objects");
/* Now load the actual modules for the builtin prototypes */
BUILTIN_LOAD(Core);
@@ -339,7 +339,7 @@
p = err_buf + strlen(err_buf) - 1;
while (*p == '.' || *p == ' ' || *p == '\t') { *p = 0; p--; }
- set_obj_doc(ist, ist->exception_obj, err_buf);
+ set_obj_doc(ist->exception_obj, err_buf);
}
}
@@ -837,7 +837,7 @@
//********************************* set_obj_doc ***********************************
-void set_obj_doc(isp ist, obj_p obj, char* str){
+void set_obj_doc_f(isp ist, obj_p obj, char* str){
if (str[strlen(str)-1] == '\n') {
char* ns = pr_malloc(strlen(str)+1);
strcpy(ns, str);
Modified: trunk/src/symbol.c
===================================================================
--- trunk/src/symbol.c 2004-04-17 02:48:57 UTC (rev 372)
+++ trunk/src/symbol.c 2004-04-17 05:12:18 UTC (rev 373)
@@ -148,7 +148,6 @@
{ "max", 0 },
{ "min", 0 },
{ "copy", 0 },
- { "__creator__", 0 },
{ "__storProxy__", 0 },
{ "__newViaStorProxy__", 0}
};
Modified: trunk/src/sys.c
===================================================================
--- trunk/src/sys.c 2004-04-17 02:48:57 UTC (rev 372)
+++ trunk/src/sys.c 2004-04-17 05:12:18 UTC (rev 373)
@@ -147,7 +147,7 @@
sys_module = new_object(ist, OBJ(OBJECT));
set_attr(ist, OBJ(MODULES),sym(ist, "Sys"), sys_module);
set_attr(ist, OBJ(OBJECT), sym(ist, "Sys"), sys_module);
- set_obj_doc(ist, sys_module, "Sys: a built-in module of system attributes");
+ set_obj_doc(sys_module, "Sys: a built-in module of system attributes");
add_path(ist, sys_path, "."); if_exc_return NULL;
#ifdef PROTHON_DEFAULT_MODDIR
add_path(ist, sys_path, PROTHON_DEFAULT_MODDIR); if_exc_return NULL;
@@ -162,7 +162,7 @@
if (!*s++) break;
}
}
- set_obj_doc(ist, sys_path, "path: list of paths to search for modules");
+ set_obj_doc(sys_path, "path: list of paths to search for modules");
set_attr(ist, sys_module, sym(ist, "path"), sys_path);
if ((s = getenv("PROTHONHOME"))) {
for (d=path; *s && *s!=';'; s++, d++) *d = *s;