Understanding Native Customs


Keep in mind that on this expedition you will encounter a number of differences specific to SenseTalk. Get familiar with these native customs so you can write scripts with ease!
SenseTalk is a People Oriented Programming language. It aims for familiarity — not for programmers, but for ordinary people. So don't expect % to be the modulo operator you may have used in other languages — in SenseTalk % is the percent operator!
SenseTalk is extremely forgiving. For example, requesting an out-of-range value from a list won't throw an exception, it will simply return empty. If a function ends without returning a value, it will return empty. If a call to a command or function supplies fewer parameters than the number declared, the remaining values will receive an initial value of empty. You should be noticing a pattern here. The value empty is a constant whose value is an empty string (the same as "").
Common Idioms
Typically, SenseTalk is written in a conversational style, so the equals comparison operator is more commonly written using the word is (or is not or isn't for inequality) rather than using the = (or <> or ≠) symbol.
In some cases there are many synonyms for an operator to allow the intent to be expressed in a more natural and meaningful way. For example, is greater than (or >) is a natural way to compare numbers, but may be less clear when comparing strings, or dates and times.
put 5 is more than 3
put "c" comes after "a"
put "3:00 PM" is later than "5:00 AM" as time
Comments (to the end of the line) can begin with two dashes or — (an em-dash) or //. A hash (#) is also legal, but isn't considered normal SenseTalk style and is discouraged. Block comments are enclosed in (* and *) which may be nested. Block comments using double-asterisks (** **) are used by the EggDoc script for generating documentation of scripts and handlers.