devin_asay at byu.edu
Thu Mar 29 10:12:59 CDT 2007
On Mar 29, 2007, at 5:27 AM, Simon HARPER wrote:
> Hi there, and I do agree that, as a coder of 15 years, I would
> normally go on gut instinct. However, being used to c/c++, Java and
> Perl the Revolution Transcript syntax and expressions are not
> 'natural' for me, as I'm trained to think in the more mathematical
> syntax of these grammars and not the more discursive grammar of
> Transcript. I'm sure I'll get it with persistence but I just think
> that coders moving over could really do with good documentation as
> it just is not intuitive for a people with experience of these
> other 'conventional' languages, IMO.
Richmond makes a good point, although I think it's an exaggeration to
say RunRev don't take documentation seriously. What most developers,
including myself, have discovered after a few weeks is that the
structure of the Rev scripting language (AKA Transcript) is pretty
consistent and therefore new things become easily discoverable once
the structure "clicks" in your brain. Here are some of the "aha!"
moments that helped me figure out Xtalk scripting.
Rev scripting and object naming is case-insensitive.
Variables are untyped.
= is a logical comparison operator, not an assignment operator.
almost all operators have both symbolic and verbose variants:
= - is
<> - is not
+ - add
To assign a value to a data container use
put <value> into <container> (not <container> = <value>)
There are *lots* of synonyms; eg., the constant return = cr = lf =
Internally, all line delimiters are ASCII 10 (LF), but Rev
automatically translates to and from the OS native line delimiter
when reading and writing text files.
The word 'the' is important; it means that what follows is a property
or a revolution function
the <property> of <object> : set the visible of btn 1 to not the
visible of btn 1
the <function> of <argument> : put the sqrt of 9 into myvar
But functions also have an "algebraic" form:
<function>(<arg>): put sqrt(9) into myvar
Since Rev tries to be helpful, it's not picky about the use of 'the'
and will try make sense of a statement missing a 'the'. It usually
Sometimes it's hard to tell the difference between properties and
Corollary: the distinction usually doesn't matter.
You create variables by naming them in a statement.
put 100 into george
You create custom properties, which act just like built-in
properties, by naming them in a statement:
set the squirrelCount of button "startSquirrels" to random(15)
Arrays are really lookup tables, indexed by key strings, not
put "squirrel" into cage["favoriteRodent"]
put "squirrel" into cage -- is the same as -- put "squirrel" into
Object references are verbose, Rev doesn't use dot notation:
button "mybtn" of card "mycard" of stack "mystack"
I apologize if these seem trivial or too basic. They are just things
that "clicked" for me as I traveled along the xTalk path.
Maybe others can share similar "Aha!" insights about the nature of
the Rev scripting language.
> On 29 Mar 2007, at 12:15, Richmond Mathewson wrote:
>> I beleive one of the main reasons RR does not spend a
>> lot of time and resources on updating documentation is
>> because a very large number of programmers don't read
>> the documentation in anything but a cursory manner -
>> relying on their intuition, their past experience and
>> their willingness ot "get their feet wet" instead.
>> When I was learning PASCAL (Durham, 1984) the standard
>> joke going around the computer labs was that the last
>> person to write a computer programming manual had had
>> a mausoleum constructed out of unsold copies.
>> I have yet to read a really user-friendly programming
>> manual as most computer-programmers who write manuals
>> do not seem to spend a lot of time on audience
>> research or the finer points of reader-response
>> The other reason why RR may not take their
>> documentation too seriously is that, in my experience,
>> the best manual I am aware of for Runtime Revolution
>> is this Use-List - it is dynamic, adaptive and
>> generally very friendly.
Humanities Technology and Research Support Center
Brigham Young University
More information about the use-livecode