Local Attractions


While travelling in the land of sensetalk be sure not to miss out on the special features and local attractions!
SenseTalk includes a number of higher-level features that set it apart from other languages and contribute to its "people oriented" nature. Some are intrinsic to the fundamentals of the language, and some are specific features. We'll describe a few of them here.
Units
Numeric values may have units associated with them. SenseTalk understands hundreds of different units and is able to perform calculations with them and conversions to related units.
put 5 ft into length
put 20 inches into width
set area to length * width
put area --> 8.333333 square feet
put area as cm^2 --> 7741.92 square centimeters
Patterns
SenseTalk's pattern language was touched on elsewhere, but is worth mentioning again. It provides all of the functionality of regular expressions, but in a highly readable (and writable) form.
put every occurrence of <digit> in "pi is 3.14 or 22/7" --> ["3","1","4","2","2","7"]
Each Expressions
Each expressions are a powerful, expressive tool for processing lists or chunks. They are similar to "list comprehensions" in Python or other languages.
put each word of "in a hole in the ground" whose length is more than 3 --> ["hole","ground"]
Files as Containers
SenseTalk allows you to treat a text file as a "container". This lets you perform any text operations on a file that you could perform on a variable or other container, including accessing, setting, or modifying its value.
put "once upon a time" into file "tale.txt"--> set file contents
put the last word of file "tale.txt" --> "time"
set the first word of file "tale.txt" to capitalized of word 1 of file "tale.txt"
put "…" after file "tale.txt"
put file "tale.txt" --> "Once upon a time…"