Home My Page Projects Code Snippets Project Openings SML/NJ
 Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

# SCM Repository

[smlnj] Diff of /sml/branches/SMLNJ/src/compiler/MiscUtil/print/ppobj.sml
 [smlnj] / sml / branches / SMLNJ / src / compiler / MiscUtil / print / ppobj.sml

# Diff of /sml/branches/SMLNJ/src/compiler/MiscUtil/print/ppobj.sml

revision 68, Fri Apr 3 00:06:42 1998 UTC revision 69, Fri Apr 3 00:06:55 1998 UTC
# Line 75  Line 75
75    | isRecTy _ = false    | isRecTy _ = false
76
77  fun isUbxTy (T.VARty(ref (T.INSTANTIATED t))) = isUbxTy t  fun isUbxTy (T.VARty(ref (T.INSTANTIATED t))) = isUbxTy t
78    | isUbxTy (T.CONty(tc, _)) =    | isUbxTy (T.CONty(tc as T.GENtyc _, [])) =
79        (TU.equalTycon(tc, BT.int32Tycon)) orelse        (TU.eqTycon(tc, BT.int32Tycon)) orelse
80        (TU.equalTycon(tc, BT.word32Tycon))        (TU.eqTycon(tc, BT.word32Tycon))
81    | isUbxTy _ = false    | isUbxTy _ = false
82
83  fun decon(obj, {rep,name,domain}) = (case rep  fun decon(obj, {rep,name,domain}) = (case rep
# Line 219  Line 219
219                else                else
220                 (let fun zeros n = if n < 1 then [] else 0::(zeros (n-1))                 (let fun zeros n = if n < 1 then [] else 0::(zeros (n-1))
221                      val args = Vector.fromList (zeros arity)                      val args = Vector.fromList (zeros arity)
222
223                     (*                     (*
val _ = say "***printing poly-fun with arity = "
val _ = say (Int.toString arity)
val _ = say "\n"
*)
(*** ultra-super-gross hack (zsh) ***)
225                       of T.CONty(T.RECORDtyc _, []) =>                       of T.CONty(T.RECORDtyc _, []) =>
226                              bug "unexpected poly type in ppObj"                              bug "unexpected poly type in ppObj"
(*
| T.CONty(T.RECORDtyc _, [_]) =>
let val tobj : int Vector.vector -> {a: object}
= U.cast obj
val res1 = tobj args
val res = Obj.toObject res1
in ppVal'(res, body,membersOp,depth,l,r,accu)
end
| T.CONty(T.RECORDtyc _, [_,_]) =>
let val tobj : int Vector.vector
-> object * object = U.cast obj
val res1 = tobj args
val res = Obj.toObject res1
in ppVal'(res, body,membersOp,depth,l,r,accu)
end
| T.CONty(T.RECORDtyc _, [_,_,_]) =>
let val tobj : int Vector.vector
-> object * object * object
= U.cast obj
val res1 = tobj args
val res = Obj.toObject res1
in ppVal'(res, body,membersOp,depth,l,r,accu)
end
| T.CONty(T.RECORDtyc _, [_,_,_,_]) =>
let val tobj : int Vector.vector
-> object * object * object * object
= U.cast obj
val res1 = tobj args
val res = Obj.toObject res1
in ppVal'(res, body,membersOp,depth,l,r,accu)
end
*)
227                        | T.CONty(T.RECORDtyc _, _) =>                        | T.CONty(T.RECORDtyc _, _) =>
229                        | _ =>                        | _ =>
# Line 267  Line 231
231                                         = Unsafe.cast obj                                         = Unsafe.cast obj
232                                  val res = tobj args                                  val res = tobj args
233                               in ppVal'(res, body,membersOp,depth,l,r,accu)                               in ppVal'(res, body,membersOp,depth,l,r,accu)
end
(* end case *))
234                  end)                  end)
235                    end)
236    *)
237                        val tobj : int Vector.vector -> object
238                                    = Unsafe.cast obj
239                        val res = tobj args
240                     in ppVal'(res, body,membersOp,depth,l,r,accu)
241                    end)
242
243
244             | T.CONty(tyc as T.GENtyc{kind=T.PRIMITIVE _,...}, argtys) =>             | T.CONty(tyc as T.GENtyc{kind=T.PRIMITIVE _,...}, argtys) =>
245                let fun ppWord s = PP.add_string ppstrm ("0wx"^s)                let fun ppWord s = PP.add_string ppstrm ("0wx"^s)
246                in                in
# Line 333  Line 304
304                             SOME([BT.refTycon],[]),argtys',depth,l,r,accu)                             SOME([BT.refTycon],[]),argtys',depth,l,r,accu)
305                      end))                      end))
306                 else let val argtys' = interpArgs(argtys,membersOp)                 else let val argtys' = interpArgs(argtys,membersOp)
307                       in ppDcon(obj,(Vector.sub(stamps,index),Vector.sub(members,index)),                       in ppDcon(obj,(Vector.sub(stamps,index),
308                                 SOME(transMembers (stamps,freetycs, root, family)),                                      Vector.sub(members,index)),
309                                   SOME(transMembers (stamps, freetycs,
310                                                      root, family)),
311                                 argtys',depth,l,r,accu)                                 argtys',depth,l,r,accu)
312                      end                      end
313             | T.CONty(tyc as T.RECORDtyc [], _) => add_string ppstrm  "()"             | T.CONty(tyc as T.RECORDtyc [], _) => add_string ppstrm  "()"

Legend:
 Removed from v.68 changed lines Added in v.69