Discussion:
[polyml] polyml Digest, Vol 152, Issue 3
David Topham
2018-11-11 03:28:07 UTC
Permalink
Thank you David, That is very helpful information and maybe good to add to
the Debugger tutorial to help others. If I explicitly add type information
to variables the debugger works.
Send polyml mailing list submissions to
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
You can reach the person managing the list at
When replying, please edit your Subject line so it is more specific
than "Re: Contents of polyml digest..."
1. Re: Debugger (David Matthews)
----------------------------------------------------------------------
Message: 1
Date: Fri, 9 Nov 2018 13:13:17 +0000
Subject: Re: [polyml] Debugger
Content-Type: text/plain; charset=utf-8; format=flowed
Dave,
It seems to be a bug with printing the value of a polymorphic equality
type variable. "s" has type ''a and that upsets the debugger. It works
either if there is a type constraint to force the type of "s" to be int
list or if "member" is changed so that the equality function is passed
as an argument and the functions are fully polymorphic. I need to find
out why equality types cause problems.
David
I am trying to use the debugger in PolyML but always get errors. Here is
PolyML.Compiler.debug := true;
open PolyML.Debug;
fun member(x,[]) = false
| member(x,(y::ys)) = if x = y then true else member(x,(ys));
member(2,[2,3,4]); (* expect true *)
member(5,[2,3,4]); (* expect false *)
fun subset([],s) = true
| subset((x::xs),s) = member(x,s) andalso subset(xs,s);
fun equals(s1,s2) = subset(s1,s2) andalso subset(s2,s1);
breakIn "subset";
subset([],[1,2,3]); (* expect true *)
subset([2],[1,2,3]); (* expect true *)
It does break at the debug prompt, but when typing
dump();
it crashes with: Function subset:Exception- Cast "toAddress" raised
Do you have any suggestions?
I am using Debian 9 64-bit and installed using apt-get
"polyml is already the newest version (5.6-8)"
-Dave
------------------------------
Subject: Digest Footer
_______________________________________________
polyml mailing list
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
------------------------------
End of polyml Digest, Vol 152, Issue 3
**************************************
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
--
-Dave

Loading...