[mercury-users] Difference of Predicate Declaration from Implementation

Mark Brown mark at csse.unimelb.edu.au
Tue Sep 4 20:27:13 AEST 2007


On 04-Sep-2007, Mark Brown <mark at csse.unimelb.edu.au> wrote:
> On 04-Sep-2007, Stormie Stormie <stormie at hotmail.it> wrote:
> > 
> > 
> > I have question from calculator.m example in mercury
> > 
> > 1) Arguments in the predicate declaration (e.g. fullexpr) are different  from its implementation.
> > e.g. arguments for fullexpr are three, but it just takes one (i.e. X) in its implementation.
> > Why is that so? 
> 
> The clauses are DCG-rules, rather than ordinary rules.  See section 2.11
> of the reference manual.

I meant to add that you can recognise a DCG-rule because it uses '-->'/2
as the top-level functor, rather than ':-'/2 which appears in ordinary rules.

Cheers,
Mark.

--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list