propertynames
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, LCMark
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: propertynames
Sudden thought: if we're going to have "the revAvailableHandlers of <object>", how about "the revAvailableProperties of <object>", implemented as a function?
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: propertynames
I like the idea of looking at this in general and seeing how there can be uniform and encompassing functions.
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: propertynames
I think it makes sense to have a naming convention that makes sense.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: propertynames
Something like the revAvailableHandlers might well be sufficient. That property was added to help with 'Go To Definition' and the handler list in the script editor - and for that purpose it is fine, but it has never been turned into a 'proper' feature, mainly because it works, and the output it currently has isn't really structured in an 'x-talky' type way.
This is why knowing what information is needed and where it is to be used is important.
It would be quite easy to do something similar 'revAvailableProperties' that returns information about the properties an object provides (although, it would require that information to be encoded in the engine explicitly at the moment - the type a property is, its relation to others and its type is all implicit in the code currently - less so on the refactored branch).
If the need is really to be able to ask the engine what properties are available for use in a property type browser, then just knowing the names is not enough... You need to know the type, whether it's derived, whether it's read-only and (if it is a synonym) what it is a synonym of.
This is why knowing what information is needed and where it is to be used is important.
It would be quite easy to do something similar 'revAvailableProperties' that returns information about the properties an object provides (although, it would require that information to be encoded in the engine explicitly at the moment - the type a property is, its relation to others and its type is all implicit in the code currently - less so on the refactored branch).
If the need is really to be able to ask the engine what properties are available for use in a property type browser, then just knowing the names is not enough... You need to know the type, whether it's derived, whether it's read-only and (if it is a synonym) what it is a synonym of.
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: propertynames
Isn't that information already in the engine? If I try to set a built-in property on an object that doesn't support it (set the height of card x) something throws an error.it would require that information to be encoded in the engine explicitly at the moment
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: propertynames
Yes - but it's implicit in the code rather than in a table that could be massaged into a format for return from a property.
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: propertynames
I'm guessing that's what Pete's got in mind, but I'm not going to make assumptions for him.If the need is really to be able to ask the engine what properties are available for use in a property type browser
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev