generators which return null() value are not well
supported by the combinat::generators library. This
probably happens more generaly to generators that
return expression sequences.
Example with a generator that returns null() and then
FAIL.
makeG :=
proc()
local i;
option escape;
begin
i := 1;
proc()
begin
if i=0 then FAIL;
else
i := i-1;
return(null());
end_if;
end_proc
end:
g:=makeG():
g() ;g() ;
FAIL
g:=makeG():
combinat::generators::toList(g) ;
[FAIL]
What should we do? Is this easily fixable? Or should
we state officially generators that return expression
sequence are not supported?
Logged In: YES
user_id=153147
The current default implementation of generators::toList which is
faster than the trivial one using append does not allows for sequences.
The trivial one (called toList_append) does and flatten the sequences.
But since you can use lists rather that sequences, and that it it likely
that using sequences will break other functions dealing with generators,
I'm in favor of forbidding generator that returns expression sequences.