File langprocs.icn |
$Id: langprocs.icn,v 1.8 2009-10-28 21:07:18 to_jafar Exp $ This file is in the public domain. Author: Robert Parlett (parlett@dial.pipex.com) Addition of call_by_name by Steve Wampler (sbw@tapestry.tucson.az.us) Changes to use standard Unicon functions.
This file is part of the lang package.
Source code.Details |
Procedures: |
Invoke a procedure by string name. This is a convenience procedure for invoking a procedure given its string name. The primary convenience is that it maps external package procedure names into internal form for string-invocation. An example of its use would be to call the constructor for some class identified by its string name at runtime. @param f_name -- Name of procedure @param f_args... -- arguments to pass to the procedure, if any @return result of invocation
Cast the fields of this object to another object o.
Clone the given object
Compare this object with another by recursively comparing all members of the object.
Look for the method in the given object. @param obj The object in which to find the method @param method_name The name of the method @return a procedure object, being the method @fail if the method cannot be found.
generate_class_members(object)
Generate the values of the member variables of an object. All other values/objects will cause failure.
Generate the names of the member variables of an object. All other values/objects will cause failure.
Generate the record names for a record. All other values/objects will cause failure.
Get the Class object for this object
Return the value of the {n}th member variable of an object. The results are undefined for a non-class object.
Return the class name for the instance o <i>Deprecated in favor of function <tt>classname(o)</tt>.</i>
Return the id of the object, based on the string returned by {image()}. For types that do not produce such a value, this method will fail for values that do not have a serial number. <i>Deprecated in favor of function <tt>serial()</tt>.</i> @example @ x := [1, 2 ,3] @ write(::image(x)) @ write(get_id(x)) @ @ Output: @ list_5(3) @ 5
Return the name of the object. For a record this is the type name; for a class it is the class name, for a procedure the procedure name, for a file the filename and for a window the window name. For all other types, this method fails.
Return the type of the object, as a string. For standard Icon types, this is the value returned by the {type()} function. For records, it is the string "record" and for classes it is the string "class".
Return a hash code for this object. For any two objects for which {equals} indicates equality, the returned hash code should be the same.
Succeed iff the given object is an instance of the class with the given name.
The default behaviour for Object.clone
object_equals(obj, other, seen)
The default behaviour for Object.equals
object_hash_code(o, depth, seen)
The default behaviour for Object.hash_code
object_to_string(o, depth, seen)
The default behaviour for Object.to_string
Convert the object to string ,descending structures to the given depth @param o The object to be converted. @param depth The depth of recursion; default is all levels