Will Coleda wrote:
Now I get "Method 'slurp' not found"
but if I change getclass to 'new', then it ... well, it gets further.
Is this because:
1) the syntax for class/static methods changed?
2) slurp was modified to no longer be static?
3) we can't do static anymore?
In any case, the perldoc for ParrotIO.slurp needs updating, as it's
still using the old syntax that I'm trying to fix up.
Is 'slurp' really a class method? It seems like the kind of thing you'd
want to call on an instance, not an uninstantiated class. Let's see...
ah, when called as a class method it takes a filename, opens it, and
slurps it. Well, 'slurp' isn't in the (as yet unimplemented) I/O PDD. If
we keep 'slurp', it makes more sense to have it as an opcode than a
class method (maybe with a better name than 'slurp', or even just the
get_string vtable entry).
To answer the deeper question: yes it's true that you can no longer
define a method 'bar' in class 'Foo' and then call that method on a
class object. The new object model makes a sharper distinction between
classes and instances of classes. Overall this is a Good Thing(TM).
To solve your problem right now: open the file before slurping it:
$P0 = open 'the_file', '<'
$S0 = $P0.'slurp'('')
Allison