ANNOUNCE: ObjectivePerl Release 0.01

Kyle Dawkins <[email protected]> Tue, 13 Apr 2004 08:19:21 -0700
Newsgroups gmane.comp.web.webobjects.general,gmane.comp.web.webobjects.devel,gmane.comp.web.webobjects.eof
Message-ID <[email protected]>
Hey all

Sorry for the cross-post but thought some of you might enjoy playing 
around with this...   as a weekend project I just implemented something 
I call "ObjectivePerl".  It adds obj-c style syntax and runtime to 
perl.  Here's what it looks like:


          use ObjectivePerl;
          @implementation MyClass
          {
             $someInstanceVariable;
             @private: $privateInstanceVariable;
             @protected: $normalInstanceVariable, 
$anotherInstanceVariable;
          }

          + new {
                ~[$super new];
          }

          - setSomeInstanceVariable: $value {
              $someInstanceVariable = $value;
          }

          - someInstanceVariable {
             return $someInstanceVariable;
          }
          @end

You can define your classes in an obj-c way, you get protected and 
private instance variables, and you can define static/instance methods 
in the familiar way, and you get methods with named selectors... and 
you get the familiar syntax to invoke those methods (albeit with a 
tilde in front now, like

	~[$self initWithString: "Yeah!" andArray: [ "Hey", "you"! ]];


It's an alpha release but it actually works and I would love some 
feedback/bug reports!  If anyone's interested in reading more about it, 
check out

http://search.cpan.org/~kyled/ObjectivePerl-0.01/ObjectivePerl.pm

and you can download and install it right from within perl like this:

sudo perl -MCPAN -e shell
password: <blah>

cpan shell -- CPAN exploration and modules installation (v1.76)
ReadLine support enabled

cpan> install ObjectivePerl

and you're golden.

I have only tested on OSX 10.3.X, don't know about other Unixes, but I 
can't see why not.

Have fun!

Kyle Dawkins
Central Park Software