Re: Simple (?) fix for _call and _str
"Mark Hahn" <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.user |
|---|---|
| Message-ID | <[email protected]> |
Paul Prescod wrote:
> I propose that in Prothon the only difference between prototypes and
> instances be a flag called "isProto_". When you create a new object
> with the "object" command you get a new prototype. You can also ask
> for a new prototype with the function newProto(). Otherwise, you get
> instances (e.g. when you call a prototype or use the newObject
> function). You can switch something from being a prototype to being
> an instance just by switching the flag.
I'd like to keep the basic operations like the object keyword untouched. We
don't want to force 2-tier down their throats. Using newProto() would work.
My comments....
You can remove the (?) from the subject line. It IS simple.
You could just use the presence of "typeName_" to indicate that an object is
a prototype and kill two birds with one stone. I'd call it "protoName_"
myself.
I like your two-name idea for instStr_ and protoStr_. I would want to use
str_ and protoStr_ for the same reason that I didn't want to change the
object keyword. I would want the object keyword, call_ and str_ to work as
before in the default case.
Negatives compared to Serge's and my proposals...
1) Lack of dual namespaces. (You are the one that got us started on them
<grin>).
2) Directed method calling would have to use the "Klass.method{self}()"
syntax. Super would still work.
I can't think of any other features your proposal loses Your advantage is
simplicity of course. No hidden objects, no interpreter hacks.
I will vote for this. How does everyone else feel? Comments? Votes?
I will still be arguing for the class keyword as an independent feature even
if this is accepted as the call_ str_ fix.