[812] in Coldmud discussion meeting

root meeting help first previous next last

Functions/Native Methods conversion...

daemon@ATHENA.MIT.EDU (Thu Sep 21 00:26:15 1995 )

Date: Wed, 20 Sep 1995 22:18:44 -0600
From: 869683 Gillespie Brandon James <brandon@smithfield.declab.usu.edu>
To: coldstuff@pippin.ece.usu.edu

The following is a list of functions, and:

    1: what I am considering doing with them by version 1.0-0 of the
       ColdX driver.
    2: what they may become, as native methods rather than direct functions

I would ask that those interested please read over this list, now is the
time to give feedback...  I plan on making virtually no other changes to
the syntax in regard to this, after 1.0-0 (I probably will ADD, but not
change).  My basic guidelines were:

  * If it is something requiring state info of a specific frame (like
    encapsulation restrictions for object variables/info, or just
    object/method info), it stays a function.
  * If it accepts or manipulates more than one data type, it stays a
    function.
  * If it deals with an in-driver aspect, such as connections or files,
    it stays as a function.
  * If it is directly died to a single data type, make it a native method

The above pretty much sorted everything, except for generic informational
methods, which I put on $sys as a native method.

BTW, I _will_ respond to all of the multithreading comments, I just
havn't had the time to yet: very busy this side, have lots of things to
do before school starts. *sigh*

Until later, enjoy...

-Brandon Gillespie-

------------------------------------------------------------------

Key: * => new
     + => changed
     ? => undecided, do we want/need it?

--- Functions:

 add_parameter() 
 del_parameter() 
 parameters() 
 set_var() 
 get_var() 
 clear_var() 

 compile_to_method() (was compile)
*compile_to_list()
+method_flags() (return a list of symbols instead)
+set_method_flags() (accept a list of symbols instead)
 method_state() 
 set_method_state() 
+method_info() (was method_args(), returns ["args...", lines])
 methods() 
 find_method() 
 find_next_method() 
 list_method() 
 del_method() 

 parents() 
 children() 
 ancestors() 
*descendants()
 has_ancestor() 
+size() (take args: size([data]) as wel as size() (this object()))
 create() 
 chparents() 
 destroy() 
+log() (this will go away, once we add good file writing/reading)
+binary_dump() AXE, backup() works
+text_dump() AXE, use decompilation routines in-db and externally
 backup() 
 shutdown()
+execute() do something with pipes/files?
 set_heartbeat() 
 data() 
 add_objname() 
 del_objname() 
!get_dbref(sym)
 get_objname(dbref)
 cancel() 
 suspend() 
 resume() 
 pause() 
+threads() (tasks())
 callers() 
+bind_function() uniformly accept symbols
+unbind_function() uniformly accept symbols
 method() 
 this() 
 definer() 
 sender() 
 caller() 
+thread_id() (was: task_id())
 tick() 
 ticks_left() 
 type() 
 class() 
 toint() 
 tofloat() 
 tostr() 
 toliteral() 
 todbref() 
 tosym() 
 toerr() 
 valid() 
 error() 
 traceback() 
 throw() 
 rethrow() 

 reassign_connection()
 bind_port()
 unbind_port()
 open_connection()
 close_connection()
+cwrite() (was echo(), send to a connection)
 cwritef() (was echo_file(), send to a connection)

 fstat() (was stat_file(), get stat info on a file)
+fread() (was read_file(), reads from a file)
*fopen()
*fclose()
*fseek()
*fwrite()

--- Native Methods:

 buffer_len()                  -> $buffer.length()
 buffer_retrieve()             -> $buffer.retrieve()
 buffer_append()               -> $buffer.append()
 buffer_replace()              -> $buffer.replace()
*?                             -> $buffer.insert()
*?                             -> $buffer.subrange()
 buffer_add()                  -> $buffer.add()
 buffer_truncate()             -> $buffer.truncate()
 buffer_tail()                 -> $buffer.tail()
 buffer_to_string()            -> $buffer.to_string()
 buffer_to_strings()           -> $buffer.to_strings()
 buffer_from_string()          -> $buffer.from_string()
 buffer_from_strings()         -> $buffer.from_strings()
 dict_keys()                   -> $dictionary.keys()
 dict_add()                    -> $dictionary.add()
 dict_del()                    -> $dictionary.del()
 dict_contains()               -> $dictionary.contains()
 hostname()                    -> $network.hostname()
 ip()                          -> $network.ip()
 random()                      -> $integer.random()
 max()                         -> $integer.max()
 min()                         -> $integer.min()
 abs()                         -> $integer.abs()
 listlen()                     -> $list.length()
 sublist()                     -> $list.subrange()
 insert()                      -> $list.insert()
 replace()                     -> $list.replace()
 delete()                      -> $list.delete()
 setadd()                      -> $list.setadd()
 setremove()                   -> $list.setremove()
 union()                       -> $list.union()
 strlen()                      -> $string.length()
 substr()                      -> $string.subrange()
 explode()                     -> $string.explode()
 pad()                         -> $string.pad()
 match_begin()                 -> $string.match_begin()
 match_template()              -> $string.match_template()
 match_pattern()               -> $string.match_pattern()
 match_regexp()                -> $string.match_regexp()
*                              -> $string.sub_regexp()
 strsub()                      -> $string.sub_string()
 crypt()                       -> $string.crypt()
 uppercase()                   -> $string.uppercase()
 lowercase()                   -> $string.lowercase()
 strcmp()                      -> $string.compare()
 strfmt()                      -> $string.format()
 next_dbref()                  -> $sys.next_dbref()
 load()                        -> $sys.load()
 status()                      -> $sys.status()
 version()                     -> $sys.version()
 time()                        -> $time.time()
 mtime()                       -> $time.mtime()
 ctime()                       -> $time.ctime()
 localtime()                   -> $time.localtime()
 timestamp()                   -> $time.timestamp()
 strftime()                    -> $time.format()

 tokenize_cml()                -> $cml2_compiler.tokenize()
 buf_to_veil_packets()         -> $buffer.to_veil_packets()
 buf_from_veil_packets()       -> $buffer.from_veil_packets()