That works perfectly for what I need...thanks David

On Sun, Mar 6, 2016 at 4:00 AM, <[email protected]> wrote:

> Send polyml mailing list submissions to
>         [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
> or, via email, send a message with subject or body 'help' to
>         [email protected]
>
> You can reach the person managing the list at
>         [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of polyml digest..."
>
>
> Today's Topics:
>
>    1. Echo code as well as output (David Topham)
>    2. Re: Echo code as well as output (David Matthews)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 5 Mar 2016 09:16:05 -0800
> From: David Topham <[email protected]>
> To: [email protected]
> Subject: [polyml] Echo code as well as output
> Message-ID:
>         <CAD034BEm3Yxrgx1OeZTz-r_sQkowpw51YY8-=
> [email protected]>
> Content-Type: text/plain; charset="utf-8"
>
> I am looking for a way to display the code as well as the output when
> running SML.
>
> I believe it might be called "trace" or "log"... I did find this suggestion
> online:
>
> PolyML.startLog
>
> but that seems to be deprecated?
>
> Is there another option?
>
> e.g.
>
> fun f x = x * x;
> f 4;
> just displays
> val it = 16: int
>
> and I would like something like:
>
> f 4 = 16
> or similar to see what code was evaluated to get the 16
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.inf.ed.ac.uk/pipermail/polyml/attachments/20160305/bf8d6fbc/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Sun, 6 Mar 2016 08:50:45 +0000
> From: David Matthews <[email protected]>
> To: [email protected]
> Subject: Re: [polyml] Echo code as well as output
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=windows-1252; format=flowed
>
> On 05/03/2016 17:16, David Topham wrote:
> > I am looking for a way to display the code as well as the output when
> > running SML.
> > e.g.
> >
> > fun f x = x * x;
> > f 4;
> > just displays
> > val it = 16: int
> >
> > and I would like something like:
> >
> > f 4 = 16
> > or similar to see what code was evaluated to get the 16
>
> The only thing that occurs to me is to turn on "parsetree" debugging
> with PolyML.Compiler.parsetree := true;  The output is pretty-printed
> into a form very similar to the original.
>
>  > PolyML.Compiler.parsetree := true;
> val it = (): unit
>  > fun f x = x * x;
> fun f x = x * x
> val f = fn: int -> int
>  > f 4;
> val it = f 4
> val it = 16: int
>  >
>
> David
>
>
> ------------------------------
>
> _______________________________________________
> polyml mailing list
> [email protected]
> http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
>
> End of polyml Digest, Vol 124, Issue 2
> **************************************
>
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
>
_______________________________________________
polyml mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml

Reply via email to