[Aldor-l] question about set! in streams / even shorter

Ralf Hemmecke ralf at hemmecke.de
Thu Aug 24 16:18:09 EDT 2006


> Is there a way to delete an element from a stream? Eg., in Axiom one can say

> delete(s, 2) 

> (s being a Stream) and gets the Stream s.1, s.3, s.4,...

The API of LibAldor doesn't show such a delete. But of course it would 
be easy to greate such a stream.

delete(s: Stream T, n: MachineInteger): Stream T == {
     g: Generator T == generate {
         for i in 0 .. for t in s repeat if i ~= n then yield t;
     }
     stream g;
}

Ralf



More information about the Aldor-l mailing list