Author: larry Date: Sat Jun 3 20:32:43 2006 New Revision: 9465 Modified: doc/trunk/design/syn/S03.pod Log: Revisions to definitions of simple scalar. Modified: doc/trunk/design/syn/S03.pod ============================================================================== --- doc/trunk/design/syn/S03.pod (original) +++ doc/trunk/design/syn/S03.pod Sat Jun 3 20:32:43 2006 @@ -116,14 +116,37 @@ and imply scalar assignment: $a # simple scalar variable - @a[123] # single literal subscript - %a{'x'} # single literal subscript + @a[SIMPLE] # single simple subscript + %a{SIMPLE} # single simple subscript %a<x> # single literal subscript - @a[+TERM] # single term coerced to numeric for array - %a{~TERM} # single term coerced to string for hash + +Where SIMPLE is defined as + + 123 # single literal + 'x' # single literal + "$x" # single literal + qq/$x/ # single literal + +TERM # any single term coerced to numeric + -TERM # any single term coerced to numeric + ~TERM # any single term coerced to string + ?TERM # any single term coerced to boolean + !TERM # any single term coerced to boolean @a[SIMPLE] # any of these simples used as subscript recursively %a[SIMPLE] # any of these simples used as subscript recursively +We also include: + + OP SIMPLE + SIMPLE OP + SIMPLE OP SIMPLE + +where C<OP> is includes any standard scalar operators in the five +precedence levels autoincrement, exponentiation, symbolic unary, +multiplicative, and additive; but these are limited to standard +operators that are known to return numbers, strings, or booleans. +(Operators that imply list operations are excluded: C<$>, C<@>, +and C<xx>, for instance. Hyper operators are also excluded.) + All other forms imply list assignment, and will evaluate both sides of the assignment in list context (eventually). However, this is primarily a syntactic distinction, and no semantic or type information