メインコンテンツまでスキップ
バージョン:25.2

symbol_parentheses `()`

  • grouping operator in expressions (treat any expression as a factor)

    • Examples:

       put 5 * (3 + 8) --> 55
  • used around parameters in a function call expression

    • Examples:

       put average(2,4,6,8) --> 5
  • used (required) around the selector operator

    • Examples:

       put (if x then y else z) into res
  • used to treat the value of any expression as an identifier

    • Examples:

       set foo.("prop" & 1) to 7 --> sets foo's "prop1" property to 7
  • used to treat the value of any expression as an object for obtaining a property using 's and '.'

    • Examples:

       put ("script" & 2)'s counter
  • used to apply a unit to the value of an expression when it is followed by a unit name

    • Examples:

       set height to (a + b) inches
  • used optionally in a variety of situations

    • used optionally around formal parameter declaration
    • used optionally around parameter value
    • used optionally around factor list
    • used optionally around helper list
    • used optionally around a container
  • used around lists or property lists instead of [ ] or

    • SenseTalk is very accommodating about the brackets used for collections, allowing any of ( ), [ ], or around both lists and property lists. However, it is strongly encouraged to always use for property lists, and [ ] for lists.