10 lines
285 B
Text
10 lines
285 B
Text
fcn range(ns){
|
|
fcn(w){
|
|
if (w.atEnd) return(Void.Stop);
|
|
a:=b:=w.next(); n:=0;
|
|
while(b+1 == (c:=w.peekN(n))){ n+=1; b=c }
|
|
if(n>1){do(n){w.next()}; return("%d-%d".fmt(a,b)); }
|
|
a
|
|
} :
|
|
(0).pump(*,List,_.fp(ns.walker().tweak(Void,Void))).concat(",");
|
|
}
|