Hi sorry that was my mistake : "is_prime(15)" does not hit that particular
point (because 15 is divisible by 3 and 5).

Thanks for the tip nevertheless.

On Sat, May 14, 2016 at 1:31 PM, David Matthews <
[email protected]> wrote:

> It's possible that the way the code has been generated there isn't
> actually a breakpoint on that line.  I prefer setting break-points either
> on an exception or on a function.  Sometimes that may involve adding a
> dummy function and breaking on that
> e.g.
> else
> let
>    fun breakHere() = ()
> in
>    breakHere();
>    false
> end;
>
> David
>
>
> On 14/05/2016 09:19, Artella Coding wrote:
>
>> Hi, suppose that I have the following code ("basics.ml") :
>>
>> ********************************
>> (* basics.ml *)
>>
>> fun is_divisible(n : int, currentDivisor : int) =
>>   if currentDivisor <= n - 1 then
>>     n mod currentDivisor = 0
>>     orelse
>>     is_divisible(n, currentDivisor + 1)
>>   else
>>     false; (* This is line 9 *)
>>
>> fun is_prime(n : int) : bool =
>>   if n = 2 then
>>     true
>>   else
>>     not(is_divisible(n, 2));
>> ********************************
>>
>> Then if I do :
>>
>> rlwrap poly
>>> PolyML.Compiler.debug := true;
>>> use "basics.ml";
>>> open PolyML.Debug;
>>> breakAt("basics.ml",9);
>>> is_prime(15);
>>>
>>
>> then I am finding that the debugger is not stopping at the desired line.
>> Is
>> there anything that I am doing wrong? (I am using the latest compiler
>> sources from github). Thanks
>>
>>
>>
>> _______________________________________________
>> polyml mailing list
>> [email protected]
>> http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
>>
>> _______________________________________________
> polyml mailing list
> [email protected]
> http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
>
_______________________________________________
polyml mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml

Reply via email to