On 4/4/07, Allison Randal <[EMAIL PROTECTED]> wrote:
Alek Storm wrote:
>
> Whoops, that metaclasses reference didn't quite make sense (it was
pretty
> late in my timezone). I meant that, in Smalltalk for example, classes
are
> also first-class objects. Also, in prototype-based languages like
Alek Storm wrote:
Whoops, that metaclasses reference didn't quite make sense (it was pretty
late in my timezone). I meant that, in Smalltalk for example, classes are
also first-class objects. Also, in prototype-based languages like Self and
ECMAScript, objects might also want to act like class
On 4/3/07, Alek Storm <[EMAIL PROTECTED]> wrote:
we can just use set_hll_global and get_hll_global, storing the class
PMCs like normal objects. Which makes sense, given that class PMCs
can also *be* normal objects (metaclasses, etc), and we don't need a
separate container for classes. My Small
Since classes are now a great deal more polymorphic, it seems we don't
really need a newclass opcode anymore, since HLLs will instantiate the
class objects themselves anyway. Instead of having
$P0 = get_class "HLLClass"
$P1 = $P0.new()
Or:
$P0 = get_hll_namespace
$P1 = $P0.find_class("HLLClass
Allison Randal wrote:
Class is the base for all classes. I can see the value of stripping away
any methods that may interfere with a particular HLL's concept of how a
class should behave, so we'll do that. And what should we call the
subclass of Class that adds lots of methody syntactic sugar
Alek Storm wrote:
I've asked for something pretty darn close to what you've suggested
(see #41619), but you've explained it a lot better than I ever could.
Glad we're thinking similar things.
What I think you were saying:
Default
|
Jonathan Worthington wrote:
All that said, there is an argument for having it as a vtable method
that I think stands, which is the same argument that suggests not having
any methods on the class PMC at all and making everything a vtable
method. The argument is that if a language wants to inheri
On 4/3/07, Jonathan Worthington <[EMAIL PROTECTED]> wrote:
There is a compromise - make them all vtable methods, write a BaseClass
PMC and inherit Class from it. BaseClass implements all of the vtable
variants of the method, and Class can then provide a sane interface. HLL
implementers who need
Alek Storm wrote:
I was expecting new() to be a vtable method, since that is the only
way we can guarantee that whatever PMC comes out of find_class
implements new(). We don't want code to crash because somebody stuck
a non-class PMC into Parrot as a class.
Huh? A vtable method doesn't promise
On 3/31/07, Allison Randal <[EMAIL PROTECTED]> wrote:
Alek Storm wrote:
>>
>> $P0 = get_hll_namespace
>> $P1 = $P0.find_class("HLLClass")
>> $P2 = $P1.new()
>
>
> Will new() be a vtable method or PCCMETHOD in a Class PMC? That's the
only
> way I can see this syntax not conflicting with normal me
Am Montag, 2. April 2007 07:37 schrieb Joshua Isom:
> I'm not sure how the imcc compiler handles the .Foo syntax internally,
> but there's a file, runtime/parrot/include/pmctypes.pasm that at least
> appears as though it's magically included into the beginning of every
> pir/pasm file.
Nope the pm
Joshua Isom wrote:
I'm not sure how the imcc compiler handles the .Foo syntax internally,
but there's a file, runtime/parrot/include/pmctypes.pasm that at least
appears as though it's magically included into the beginning of every
pir/pasm file. If it were changed to output a string instead
On Mar 31, 2007, at 3:24 PM, Allison Randal wrote:
Jonathan Worthington wrote:
Does this also imply that all number-based type instantiation is
going away, and thus we need to deprecate the find_type op too?
Eventually, yes (almost certainly), but not in the next month.
Allison
I'm not su
Allison Randal wrote:
Or, can I also write:
$P0 = Integer.new() # create new Integer PMC object
$P1 = Hash.new()# create new Hash PMC object
No, we're eliminating bareword class names from PIR/PASM entirely. It's
easy to do that in an HLL, though.
Unless, of course, you declare Int
Klaas-Jan Stol wrote:
$P0 = get_class "HLLClass"
$P1 = $P0.new()
IIUC, instead of create a new object (either a built-in PMC or an OO
object) in 1 instruction, it should now be done in 2?
Yes. It adds a small amount of tedious typing, but gains us a great deal
of power in our OO system. We
Allison Randal wrote:
Klaas-Jan Stol wrote:
Hello,
I have a short and simple question w.r.t. syntax for constructing new
objects for the architect :-)
Currently, it's done through:
new P0, .Integer
or in PIR:
$P0 = new Integer # or .Integer
I thought to have read somewhere this will be ch
On Saturday 31 March 2007 12:42, Alek Storm wrote:
> > $P0 = get_hll_namespace
> > $P1 = $P0.find_class("HLLClass")
> > $P2 = $P1.new()
> Will new() be a vtable method or PCCMETHOD in a Class PMC? That's the only
> way I can see this syntax not conflicting with normal method-calling
> syntax.
I
Jonathan Worthington wrote:
Allison Randal wrote:
No dot-prefix, but also no bareword class names. Only quoted names.
Same is true for both high-level objects and low-level PMC objects.
I guess the upshot of this is we need to deprecate the old syntax and
make sure the new one works. Deprecate
Thank you, but I know what a PCCMETHOD is.
On 3/31/07, Allison Randal <[EMAIL PROTECTED]> wrote:
Alek Storm wrote:
>>
>> $P0 = get_hll_namespace
>> $P1 = $P0.find_class("HLLClass")
>> $P2 = $P1.new()
>
>
> Will new() be a vtable method or PCCMETHOD in a Class PMC? That's the
only
> way I can s
Alek Storm wrote:
$P0 = get_hll_namespace
$P1 = $P0.find_class("HLLClass")
$P2 = $P1.new()
Will new() be a vtable method or PCCMETHOD in a Class PMC? That's the only
way I can see this syntax not conflicting with normal method-calling
syntax.
new() is a class method, an ordinary method on
Allison Randal wrote:
No dot-prefix, but also no bareword class names. Only quoted names.
Same is true for both high-level objects and low-level PMC objects.
I guess the upshot of this is we need to deprecate the old syntax and
make sure the new one works. Deprecate in the next release, remove
Alek Storm wrote:
$P0 = get_hll_namespace
$P1 = $P0.find_class("HLLClass")
$P2 = $P1.new()
Will new() be a vtable method or PCCMETHOD in a Class PMC?
It's implemented as a PCCMETHOD in the Class PMC, yes.
Though at the moment you must write:
$P2 = $P1.'new'()
But that may well be a bug in I
$P0 = get_hll_namespace
$P1 = $P0.find_class("HLLClass")
$P2 = $P1.new()
Will new() be a vtable method or PCCMETHOD in a Class PMC? That's the only
way I can see this syntax not conflicting with normal method-calling syntax.
Klaas-Jan Stol wrote:
Hello,
I have a short and simple question w.r.t. syntax for constructing new
objects for the architect :-)
Currently, it's done through:
new P0, .Integer
or in PIR:
$P0 = new Integer # or .Integer
I thought to have read somewhere this will be changed into something
l
Hello,
I have a short and simple question w.r.t. syntax for constructing new
objects for the architect :-)
Currently, it's done through:
new P0, .Integer
or in PIR:
$P0 = new Integer # or .Integer
I thought to have read somewhere this will be changed into something
like this:
$P0 = Inte
25 matches
Mail list logo