Hi Joshua,
At least one issue with the code is the If
condition xlist == Null
. It will remain unevaluated unless xlist
is Null. So the If
will remain unevaluated.
{0, 1, 2, 3, 4, 5} == Null
(* {0, 1, 2, 3, 4, 5} == Null *)
If[{0, 1, 2, 3, 4, 5} == Null, True, False]
(* If[{0, 1, 2, 3, 4, 5} == Null, True, False] *)
Rather than testing for Null
, test the Length
of the list.