Re: [Phix] Language Feature Request: For Each
- Posted by euphoric (admin) Dec 13, 2021
- 1159 views
_tom said...
I guess it's really just syntactic sugar.
sequence s = {1,2,3,4,5} integer i = length(s) for x=1 to i do ?s[x] end for -- vs sequence s = {1,2,3,4,5} each i in s do ?i end each -- each without specifying iterating variable type is default object sequence s = {1,2,3,4,5} each integer i in s do ?i end each
Each one produces the exact same output.