
24 Mar
2004
24 Mar
'04
8:04 p.m.
Alex, AG> Ignore the layout AG> I can't find the error, running it gives parse error during AG> compile on pStack, it is not very descriptive and I don't AG> what is wrong. Well, ignoring the layout is not a good thing here, since that's the one of the causes for your program to not compile. Besides that, the recursive call to pStack needs a second argument.
digStack :: Integer->Integer->[Integer] digStack a b | a == 0 = [] | otherwise = (mod a b):(digStack (div a b) b)
pStack :: [Integer] -> Integer -> [Integer] pStack [] _ = [] pStack (x:xs) a = digStack x a ++ pStack xs {- ADDED: -} a
HTH, Stefan