prettyprinting infrastructure
Konrad Slind <[email protected]> Wed, 27 Jan 2010 13:13:57 -0600
| Newsgroups | gmane.comp.lang.sml.smlnj |
|---|---|
| Message-ID | <[email protected]> |
--===============4935978200382418259==
Content-Type: multipart/alternative; boundary=0016e64cc7d64a8d95047e2a3445
--0016e64cc7d64a8d95047e2a3445
Content-Type: text/plain; charset=ISO-8859-1
Hi all,
I want to write and install prettyprinters in the
SML/NJ top-level. From a bit of prowling around
in repositories, I found the PrettyPrint and
CompilerPPTable structures.
* are these the recommended structures?
* I would like to be able to install prettyprinters
for some "system" types, for example, atoms.
But the following small session shows I've got
something wrong in trying to install a prettyprinter
for atoms:
- fun pp_atom strm atm =
PrettyPrint.string strm (Atom.toString atm);
val pp_atom = fn : stream -> atom -> unit
- CompilerPPTable.install_pp ["Atom","atom"] pp_atom;
val it = () : unit
- Atom.atom"foo";
val it = - : atom
From what I remember the last time I worked on this, the first
argument to install_pp is supposed to indicate the path for
the type the prettyprinter is being dispatched on. So, do I
have the path for atom wrong, or is it not possible to install
a prettyprinter for a "system" type?
Thanks,
Konrad.
--0016e64cc7d64a8d95047e2a3445
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div>Hi all,</div>
<div>=A0</div>
<div>=A0 I want to write and install prettyprinters in the</div>
<div>SML/NJ top-level. From a bit of prowling around</div>
<div>in repositories, I found the PrettyPrint and</div>
<div>CompilerPPTable structures.</div>
<div>=A0</div>
<div>=A0 * are these the recommended structures?</div>
<div>=A0</div>
<div>=A0 * I would like to be able to install prettyprinters</div>
<div>=A0=A0=A0=A0for some "system" types, for example, atoms.</di=
v>
<div>=A0=A0=A0 But the following small session shows I've got</div>
<div>=A0=A0=A0 something wrong in trying to install a prettyprinter</div>
<div>=A0=A0=A0 for atoms:</div>
<div>=A0</div>
<div>=A0=A0=A0=A0=A0=A0 - fun pp_atom strm atm =3D </div>
<div>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 PrettyPrint.string strm (Atom.toS=
tring atm);</div>
<div>=A0</div>
<div>=A0=A0=A0=A0=A0=A0=A0val pp_atom =3D fn : stream -> atom -> unit=
<br></div>
<div>=A0=A0=A0=A0=A0=A0=A0- CompilerPPTable.install_pp ["Atom",&q=
uot;atom"] pp_atom;<br>=A0=A0=A0=A0=A0=A0=A0val it =3D () : unit</div>
<div><br>=A0=A0=A0=A0=A0=A0 - Atom.atom"foo";<br>=A0=A0=A0=A0=A0=
=A0 val it =3D - : atom<br></div>
<div>=A0From what I remember the last time I worked on this, the first</div=
>
<div>argument to install_pp is supposed to indicate the path for</div>
<div>the type the prettyprinter is being dispatched on. So, do I </div>
<div>have the path for atom wrong, or is it not possible to install</div>
<div>a prettyprinter for a "system" type?</div>
<div>=A0</div>
<div>Thanks,</div>
<div>Konrad.</div>
<div>=A0</div>
--0016e64cc7d64a8d95047e2a3445--
--===============4935978200382418259==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
--===============4935978200382418259==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Smlnj-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/smlnj-list
--===============4935978200382418259==--