Page 1 of 1

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

Posted: Wed Nov 18, 2009 12:25 am
by Nonsanity
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.

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

Posted: Sun Nov 22, 2009 5:38 pm
by ukimiku
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