[mercury-users] problems on Windows (was: 'Char' type problem)

Bart Demoen bmd at cs.kuleuven.ac.be
Wed Mar 18 23:20:52 AEDT 1998




> > I was also unable to get Bart Demoen's program to work; although I was able
> > to compile & link it.  Calling the .exe just yields 'no.'
> 
> Um, maybe that's the correct output?
> Perhaps you could show us the source code?


clever Fergus ! the source code is:

:- module b3.

:- interface.

:- import_module io, char, int .

:- pred main(io__state::di, io__state::uo) is multidet.


:- implementation.

main -->
        {foo(a,'C')} ->
          io__write_string("yes\n")
        ; io__write_string("no\n").


:- pred foo(char,char).
:- mode foo(in,out) is semidet.

foo(a,'A').
foo(b,'B').

and "no" is indeed the correct output ... but next time I give someone
an example, the correct output will be

   "program aborted because of SIGBUS"

:-)

I should have known better - sorry.

Cheers

Bart



More information about the users mailing list