Skip to content

Range types are unimplemented #21

@egroge

Description

@egroge

The following is taken from the flint guide:

Range types unimplemented

Flint includes two range types, which are shortcuts for expressing ranges of values. These can only be used with for-in loops.

The half-open range (a..<b) defines a range that runs from a to b, but does not include b.

for let i: Int in (0..<5) {  
 // i will be 0, 1, 2, 3, 4 on separate iteratons}  

The open range operator (a...b) defines a range that runs from a to b and does include b.

for let i: Int in (0...5) {  
 // i will be 0, 1, 2, 3, 4, 5 on separate iteratons}  

At the moment, both a and b must be integer literals, not variables!

Planned feature > > In the future, it will be possible to iterate up to an arbitrary value. See flintlang/flint#397.

Metadata

Metadata

Assignees

No one assigned

    Labels

    deferredNot a current priorityenhancementNew feature or requestewasmCode generation for the eWASM system for Ethereummove irCode generation for Libra

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions