I want to print a list inside a help function, for debugging purpose. And for some reason it's not printing anything. Does anyone know what's wrong?
Here is some of my code:
local
....
and xx(LparenToken) = "LparenToken"
| xx(RparenToken) = "RparenToken"
| xx(QuoteToken) = "QuoteToken"
| xx(DotToken) = "DotToken"
| xx(VectorToken) = "VectorToken"
| xx(IntToken(a)) = "IntToken"
| xx(CharToken(a)) = "CharToken"
| xx(StringToken(a)) = "StringToken"
| xx(SymbolToken(a)) = "SymbolToken"
| xx(BoolToken(a)) = "BoolToken"
and readList(nil) = []
| readList(lst:SchemeToken list) = (map(print)((map(xx)(lst))); read(getFirstSexpr(lst))::readList(getRestSexpr(lst)))
...
in
some functions..
end
i have tried this also:
and readList(nil) = []
| readList(lst:SchemeToken list) = (print "x"; read(getFirstSexpr(lst))::readList(getRestSexpr(lst)))
it is not printing. i get just the answer:
- Reader.stringToSexpr "#(a b (1 2 3) c)";
val it =
Vector
[Symbol "a",Symbol "b",Pair (Number 1,Pair (Number 2,Number 3)),
Symbol "c"] : Sexpr
readListisn't being called at all - newacct