[mercury-users] Beyond "Hello World"

Ralph Becket rafe at cs.mu.OZ.AU
Fri Feb 25 11:06:32 AEDT 2005


For some reason this doesn't appear to have made it to the Users' list,
so I'm trying again.  I'll send you the attachment separately, Martin; I
think that may be why the first version of this message was rejected.

----- Forwarded message from Ralph Becket <rafe at cs.mu.oz.au> -----

Martin Proud, Wednesday, 23 February 2005:
> Hello, I am brand new to Mercury, and I am trying to get things going 
> along. (Hopefully I'm writing to the right place?)

Absolutely!

> I had a little trouble installing, but after reading through the 
> archives and documentation, I think things are working better now. I 
> believe I have the "stable rotd" installed (2003-12-21), for better or 
> for worse (or ...maybe this is my problem?)

That's a very old rotd and Mercury has moved on a fair bit since 2003.
I strongly recommend you install the latest unstable rotd - we're close
to release 0.12 of the Mercury compiler and the current unstable rotd is
unstably only because it's failing a small number of rather obscure test
cases; certainly nothing that would affect you at the moment.

> "Hello World" compiles and runs, thankfully. So I'm looking for some 
> other programs to test. I tried running some in Ralph Beckett's 

s/Beckett/Becket/

> tutorial (I'm assuming they're programs and not snippets? Maybe I'm 
> wrong?) but I am getting errors. For example, for factorial:

You are a prime candidate proof-reader for the current draft of the
forthcoming Mercury tutorial textbook, which I've attached.  Feedback
would be much appreciated!  The old tutorial is somewhat out of date.

> factorial.m:005: In clause for predicate `factorial.factorial/2':
> factorial.m:005:   error: undefined predicate `=</2'.
> 
> (I'm assuming I'm building the programs correctly - I'm typing:
> 
> foo.m
> mmake foo.depend
> mmake foo
> ./foo

Have you included `:- import_module int.' in your program?  You need
that to do anything with ints.

> Perhaps I'm missing something I should be including in the Mmakefile? 
> Currently, all I have is "CFLAGS = -fno-strict-aliasing" which seems to 
> drop a bunch of warnings on compile.)
> 
> Guess I'm not sure where to go from here. I'd like to see another 
> working example if I can, to at least make sure I've got a working 
> compiler. I was running the test suite, though I didn't save the 
> results - perhaps I should run it again? I know the "string_format" 
> tests definitely failed - not sure what I need to do from that?

Install the latest unstable rotd and try the examples in the attached
book and let us know how things work out.  You should have a much
smoother ride.

Cheers!
-- Ralph

----- End forwarded message -----
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list