Changes between Version 34 and Version 35 of Language


Ignore:
Timestamp:
05/21/23 09:51:08 (3 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Language

    v34 v35  
    215215Constant of type `$scope`, the root dynamic scope.
    216216
    217 === Range literals: `lo .. hi` #range-literals
    218 
    219 An expression of the form `lo .. hi` where `lo` and `hi` are integer expressions, represents the range consisting of the integers `lo`, `lo` + 1, ..., `hi` (in that order).
    220 An expression of the form `lo .. hi # step`, where `lo`, `hi`, and `step` are integer expressions is interpreted as follows.
    221 If `step` is positive, it represents the range consisting of `lo`, `lo` + `step`, `lo` + 2 ∗ `step`, …, up to and possibly including `hi`.
    222 To be precise, the infinite sequence is intersected with the set of integers less than or equal to `hi`.
    223 If `step` is negative, the expression represents the range consisting of `hi`, `hi` + `step`, `hi` + 2 ∗ `step`, . . ., down to and possibly including `lo`.
    224 Precisely, the infinite sequence is intersected with the set of integers greater than or equal to `lo`.
     217=== Range literals: ''a''`..`''b'' and ''a''`..`''b''`#`''c'' #range-literals
     218
     219A range literal has form
     220  ''expr'' `..` ''expr'' ( `#` ''expr'' )?
     221The two or three sub-expressions (the third is optional) have integer type and the type of the entire expression is `$range`.
     222
     223The range literal ''a''`..`''b'' represents the range consisting of the integers ''a'', ''a''+1, ..., ''b'' (in that order).
     224
     225The range literal ''a''`..`''b''`#`''c'' is interpreted as follows.
     226If ''c'' is positive, it represents the range consisting of ''a'', ''a''+''c'', ''a''+2''c'', ...,  up to and possibly including ''b''.
     227To be precise, the infinite sequence is intersected with the set of integers less than or equal to ''b''.
     228If ''c'' is negative, the expression represents the range consisting of ''b'', ''b''+''c'', ''b''+2''c'', ..., down to and possibly including ''a''.
     229Precisely, the infinite sequence is intersected with the set of integers greater than or equal to ''a''.
    225230
    226231=== The scope of an expression: `$scopeof` #scopeof
    227232
    228 Given any left-hand-side expression ''expr'', the expression `$scopeof(`''expr''`)` evaluates to the dynamic scope containing the object specified by ''expr''.
     233The syntax is
     234  `$scopeof` `(` ''expr'' `)`
     235where ''expr'' is an expression that can occur on the left hand side of an assignment operator (i.e., an lvalue).
     236It evaluates to the dynamic scope containing the object specified by ''expr''.
    229237The following example illustrates the semantics of the `$scopeof` operator. All of the assertions hold:
    230238{{{