Re: Why these errors?
Re: Why these errors?
- Subject: Re: Why these errors?
- From: Axel Luttgens <email@hidden>
- Date: Tue, 11 Feb 2014 13:49:40 +0100
Le 11 févr. 2014 à 12:04, "Manoah F. Adams" a écrit :
> [...]
>
> I know it seems to work, but it gets much more complicated when trying to put it into practice.
>
> (1) It is very tedious, as there gets to be a lot of boilerplate, and much to forget (is the script writer always going to remember to prefix instance variables with my/its ? - I often forgot.).
>
> (2) As soon as one separates class from instance objects, the inheritance of ivars is broken, until yet another layer of 'parenting' and scripting is added.
>
> Consider this edition of the above, modified to differentiate between class and instance objects:
>
> script Volkswagon_class
> on getMaker()
> return its Maker
> end getMaker
> [...]
> log getMaker()
> setMaker("Porche")
> log getMaker()
> end tell
>
> The above script will not run, because Maker did not get inherited.
I would be tempted to say instead: because Maker isn't defined anywhere, as far as the inheritance for Golf_instance is concerned.
It is a bit as if one had written (pseudo C++):
class Volkswagon_class
{
public:
string getMaker() { return Maker; }
}
Class Golf_class::Volkswagon_class
{
}
Class Golf_instance::Golf_class
{
}
M = Golf_instance::getMaker();
I think the problem is, everyone tends to come with her own idea of OOP, by mentally checking a given language against a list of capabilities/mechanisms encountered in a more familiar language. As a result, this often leads either to convoluted concepts mapping attempts, or to perhaps too strong conclusions.
Axel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden