Ticket #71 (closed defect: fixed)
Cannot enumerate an int in a `for` expression
Reported by: | Chuck | Owned by: | Chuck |
---|---|---|---|
Priority: | medium | Milestone: | |
Component: | Cobra Compiler | Version: | 0.8.0 |
Keywords: | Cc: |
Description
for statements support both sequences and integers:
for cust in customers print cust for i in 10 print i, i*2
Then there is a for expression, but using it on integers causes an error:
custs = for cust in customers where cust.hasOutstandingBalance # errors nums = for i in 10 get i*2 objs = for i in j get items[i+1]
for expressions on integers are occasionally needed and would make the language more symmetrical.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.