All pastes #414759 Raw Edit

Miscellany

public text v1 · immutable
#414759 ·published 2007-03-29 08:04 UTC
rendered paste body

    (* LtOp *)
	  | trexp (A.OpExp{left,oper=A.LtOp,right,pos}) =
            let val {exp=_, ty=tyleft} = trexp(left)
                val {exp=_, ty=tyright} = trexp(right)
            in if (tyleft = tyright) = true then
                   case tyleft of E.INT => {exp={}, ty=E.INT}
                                 | E.STRING => {exp={}, ty=E.INT}
                                 | _ => (error pos "INT or STRING required"; {exp={}, ty=E.ERROR})
               else  {exp={}, ty=E.ERROR}
            end