2011-03-18 5 views

Répondre

3

Vous devez d'abord créer une chaîne sur le term, puis l'imprimer en utilisant print. Pour transformer un term en une chaîne, vous pouvez définir une fonction comme celle-ci:

fun termToString (node (str, terms)) = 
    "node("^str^", "^termListToString terms^")" 
    | termToString (vnode str) = 
    "vnode("^str^")" 
and termListToString terms = 
    "["^String.concatWith ", " (map termToString terms)^"]" 
Questions connexes