Hi,
I often have the following problem (not really a problem, just a slight annoyance). Just as a silly example, consider the line
apply( 10, i -> ( if i%2 == 0 then i))
that outputs {0, , 2 , , 4 , , 6 , , 8 , }, where the gaps are there because when the if statement is not satisfied a "null" gets spit out.
Now, I have a way to remove all the "null" by doing toList(set ( nameofthelist) - {null} )) but I feel that it is not the right way to do it; also, sometimes the order of the elements in the list is important, and using "set" messes it up.
So my question is: is there a way to make a list like that, but in a way that the output is directly {2,4,6,8}?
Thanks
Fulvio