[mercury-users] rule is a reserved word?
Gustavo A. Ospina
gos at info.fundp.ac.be
Tue Jun 8 06:19:52 AEST 1999
At 05:25 08/06/99 +1000, Fergus Henderson wrote:
>On 07-Jun-1999, Dominique de Waleffe <ddw at miscrit.be> wrote:
>> Just got that one a few days ago too. Appears that rule is used for some
>> purpose in nu-prolog and defined in Mercury as reserved word for
>> compatibility...
>
>Yes. Actually in Mercury `rule' is an operator, but not a reserved word.
>You can go ahead and use `rule' as an identifier, just so long as you
>put it in parentheses.
Thanks for your help. I see, therefore, that there are no reserved words in
Mercury, but operators, like Prolog.
I'm in agree in that is necessary to put in the language reference the list
of operators, with an explanation of which ones are used (and which ones
are not) by Mercury language. One tends to take some operators in the sense
of reserved words of imperative languages (in the practice, no one would
think to define an identifier of a type, pred, or func, called
'import_module'?), because of that my semantic confusion.
>(In NU-Prolog, `rule' was used for type declarations for predicates
>defined using DCG clauses. `:- rule p(arg1, arg2, arg3)' was
>an abbreviation for `:- pred p(arg1, arg2, arg3, any, any).')
This reminds me an older discussion about predicates and DCG (specifically
IO predicates). The operator rule has some utility in the context of
Mercury, for define predicates implemented by DCG clauses? or is it just to
can mix NU-Prolog code with Mercury code (or viceversa)?
>The Prolog to Mercury Transition Guide contains a table listing
>all the operators in Mercury. That table really ought to be in
>the Mercury Language Reference Manual.
I've already see it. When I was seeking the names of the 'reserved words'
I've read the section 2.5, where it could be put the operator's list.
Have a nice day. Best regards.
+ Gustavo.
--------------------------------------------------------------------------
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