Control? Object?
Richard Gaskin
ambassador at fourthworld.com
Sun Jun 19 09:42:03 EDT 2016
Mark Schonewille wrote:
> In my book, I consistently distinguish objects and controls. This means
> that I almost always talk about controls and very rarely about objects,
> because it isn't really necessary to use objects in the LiveCode
> scripting language
Sounds like a good approach, since as you describe the two words mean
different things, controls being a subset of objects.
> and AFAIK there is no "create object" command in the
> LiveCode language (but if you really want to, you can simulate objects).
There is no "create control" command either. Controls are a subset of
objects, and since every *thing* in LiveCode is an object, with the
create command the "object" is inherently implied in the act of
creation. With this implication, "object" isn't needed any more than
"control" would be; what we need to let it know is the type of object we
want to create, e.g.
create button
create stack
> It is interesting that LiveCode (I'm working with 6.7.6 today) doesn't
> have an "object" keyword but does have a "control" keyword, while many
> functions, commands and messages contain either the string "control" or
> the string "object".
The control keyword is most useful for counting or stepping through
controls on a card object. e.g.:
the number of controls
Since objects are a superset that would include all structural elements,
this:
the number of objects
...should not be synonymous, but instead have a higher count that
includes cards, substacks, perhaps even audioClips, etc.
I can conceive of a few use cases for an "objects" keyword, but only
very few. If anyone here feels strongly this should be included, please
let us know the RQCC # of your request so we can follow its progress.
> It is clear that LiveCode hasn't matured well enough to deal with this
> issue. I would recommend using above definitions consistently. One day,
> real objects will be introduced into the LiveCode scripting language and
> we will need to distinguish them from controls.
I've long advocated adopting OOP as an optional set of extensions to the
language, and IIRC have been informed that it'll likely never happen.
I'll leave it to Mark Waddingham to explain why.
But in the meantime, just because LC doesn't conform specifically to OOP
conventions doesn't mean its objects don't exist. OOP is one
implementation of object-based systems. XTalks are another.
Given both their age and very intentional design, I'm not sure I would
use "less mature" to distinguish xTalks from systems that are merely
different.
--
Richard Gaskin
Fourth World Systems
Software Design and Development for Desktop, Mobile, and Web
____________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode
mailing list