Skip to content

Range and Slice

Choose a tag to compare

@JSAbrahams JSAbrahams released this 18 May 08:41
· 100 commits to main since this release
  • Add Range and Slice to the language
    • A range is an expression, may be iterated over, and has the following notation: expression ( .. | ..= ) expression [ .. expression]
    • A slice is an expression, and has the following notation: expression ( :: | ::= ) expression [ :: expression ]
      Note that unlike Python, we use :: instead of : to separate single arguments to the slice.
  • Can iterate over all types which implement an iterator
  • Fix several bugs associated with constraining function call arguments with expressions and property calls