home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / examples / manual / Expr.sml < prev    next >
Encoding:
Text File  |  1997-08-18  |  214 b   |  6 lines  |  [TEXT/R*ch]

  1. datatype expr = Cst of int | Neg of expr | Plus of expr * expr
  2.  
  3. fun show (Cst n)         = makestring n
  4.   | show (Neg e)         = "(-" ^ show e ^ ")"
  5.   | show (Plus (e1, e2)) = "(" ^ show e1 ^ "+" ^ show e2 ^ ")"
  6.