Objective-Everything Release 5.  Copyright ©1994-1998 by TipTop Software, Inc.  All Rights Reserved.

  Other ObjPerl

ObjPerl Module

Functions

lookup(name)

Lookup object by name.  If name represents an illegal object ValueError is raised.

perl% lookup 'NSObject'; 
NSObject 
perl% $x=NSObject->object; 
<NSObject:0x4927c> 
perl% lookup '@NSObject@0x4927c'; 
<NSObject:0x4927c> 
perl% lookup '0x4927c'; 
<NSObject:0x4927c> 
dyload(file, ...)

Dynamically links (loads) the specified files.

nil(o)

Returns true if ObjPerl object is nil, false otherwise.  Raises if o is not an ObjPerl object.

nil(nil); # ==> 1
nil(lookup("Object")); # ==> 0
nil("hello");  # ==> croaks
object_is_bad(o)

Returns an error description if o is a bad ObjPerl object, or if o is not an ObjPerl object at all.  Returns false (0) if o is a valid ObjPerl object.  Never raises.

perl% $o=NSObject->alloc->init; 
<NSObject:0x169ff0> 
perl% $o->release; 
perl% $o->release; 
perl% object_is_bad $o; 
'Dealloc'ed object' 
perl% object_is_bad 123; 
'not an object' 
perl% object_is_bad nil; 
mapobj BLOCK obj[, enumerator]

Executes BLOCK for each element of $obj.  If enumerator is specified, it is used to enumerate elements of obj.  Otherwise, $obj->objectEnumerator is used.

iprint EXPR

Prints Perl expression EXPR in the interactor.

ireadline PROMPT

Reads one line from the interactor.

obj(pl)

Converts Perl object pl to its ObjPerl equivalent.

pl(obj)

Converts ObjPerl object obj to its Perl equivalent.

AppKit Support

To load AppKit, simply import the AppKit module.

use AppKit;

This brings in the AppKit and ObjAppKit frameworks.

AppKit::run [EXPR [kwflags]]

Runs the AppKit main event loop.  Code sub is executed as soon as the main event loop starts running.

Keyword arguments:
nib => path
name or path of the main nib file
class => c
application class
AppKit::after [EXPR [delay]]

Asynchronously executes sub.  If the delay argument is specified, sub is executed after delay seconds.


[previous][contents][next]