Michal Wallace writes:
> On Wed, 7 Jan 2004, Luke Palmer wrote:
> 
> > Should go something like this:
> >
> >     .sub _main
> >         .local object Cat
> >         .local object felix
> >         newclass Cat, "Cat"
> >         find_type $I0, "Cat"
> >         felix = new $I0
> >         # ...
> >     .end
> 
> 
> Thanks, but that doesn't work either. :/
> The "new" op expects an identifier. It won't
> take a VAR, IREG, or REG.

Er, sorry, that's IMCC's fault.  This works:

    new felix, $I0

> 
> > But note that objects are unfinished.  I ran into a certain problem
> > when I assumed that attributes could be any type of data; not so --
> > they can only be integers (at the moment).  I needed object support
> > right away, so I simulated using a hash.  The hash has a "CLASS" key
> > which holds the class to which it belongs.  I then use this to get
> > the methods.
> 
> I'm not even trying to get objects working yet. I just
> need something that'll let me run setprop on it so my
> generators can make iterator "things" with a .next()
> attached to them... I was using ParrotObjects and
> ParrotClasss for a while but now you can't make a
> new ParrotObject directly either. :/

I know PerlArray accepts and stores properties: my compiler uses them.
PerlHash probably does too.

And thanks again for all the work you're doing on Python :-)

Luke

> Incidentally, anyone know why not? In python or
> javascript it's easy to just create an object of
> no particular class just to have a place to stick
> things.
> 
>   foo = object()
>   foo.x = 1
> 
> It was working fine in parrot too, but then it
> went away. :/
> 
> Sincerely,
> 
> Michal J Wallace
> Sabren Enterprises, Inc.
> -------------------------------------
> contact: [EMAIL PROTECTED]
> hosting: http://www.cornerhost.com/
> my site: http://www.withoutane.com/
> --------------------------------------
> 

Reply via email to