Hello, is there any reason the following code fails to compile? Is there no way to alter the string generated by the iterator?
import future
var our_list = lc[ "Number: " & ($y) | ( y <- 1..10), string ]
echo our_list
Apparently putting the list comprehension resultant in brackets fixed the problem:
import future
var our_list = lc[ ("Number: " & ($y)) | ( y <- 1..10), string ]
echo our_list
This results in:
@[Number: 1, Number: 2, Number: 3, Number: 4, Number: 5, Number: 6, Number: 7, Number: 8, Number: 9, Number: 10]
The reason for this is & has a lower precedence than |, therefore it parses as:
lc["Number: " & ($y | (y <- 1..10)), string]