Modify Properties "In-Place" (add, subtract, put,

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderator: Klaus

Post Reply
Nonsanity
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 86
Joined: Thu May 17, 2007 9:15 pm
Contact:

Modify Properties "In-Place" (add, subtract, put,

Post by Nonsanity » Wed Nov 18, 2009 12:25 am

Take this common situation:

Code: Select all

set the GameScore of this card to the GameScore of this card + 1
Or this one:

Code: Select all

set the TimestampList of button "Record Timestamp" to the TimestampList of button "Record Timestamp" & return & the time
While wordiness is to be expected in Rev, the modification of properties is very cumbersome. Now that Rev is going mainstream with 4.0 (with a free development version) making the language as easy to use for the masses is an important thing to focus upon.

This same pattern of "set the X of Y to the X of Y with some modification" happens so often, I'd expect the language to provide a shortcut.

Code: Select all

add 1 to the GameScore prop[erty] of this card
put return & the time after the TimestampList prop of button "Record Timestamp"
I suggest the "prop[erty]" keyword only in case "the" is not enough to identify a property. Behind the scenes, all that is happening is a implicit set and get of the property, but done without needless repetition.

I could be missing some neglected bit of grammar, but even in the examples RunRev provides on the website, the repetitious form is still being used. Seems rather off-putting for beginners...

Just a suggestion.
~ Nonsanity
~ Chris Innanen

ukimiku
Posts: 101
Joined: Thu Oct 22, 2009 10:45 am

Re: Modify Properties "In-Place" (add, subtract, put,

Post by ukimiku » Sun Nov 22, 2009 5:38 pm

I second that. Why should the programmer bother with repeting code for a task for which there is basically only one method, which could easily be automated?

Regards

Post Reply