if inside for

4 views
Skip to first unread message

Ralf Hemmecke

unread,
Feb 13, 2017, 3:26:08 PM2/13/17
to aldor-devel
Hi Peter,

I see

bracket(g: Generator %): % ==
l := nil()
last := nil()
for sx in g repeat
if last = nil() then
l := cons(sx, nil())
last := l
else
next: % := cons(sx, nil())
setRest!(last, next)
last := next
return l

in your patch series (d8f313b328f640d7ec774d1657534fe94ee4eda2).

What is the advantage of this in contrast to that:

bracket(g: Generator %): % ==
for sx in g repeat
l := cons(sx, nil())
break
last := l
for sx in g repeat
next: % := cons(sx, nil())
setRest!(last, next)
last := next
return l

Ralf
Reply all
Reply to author
Forward
0 new messages