Facilities of Nercury
Fergus Henderson
fjh at cs.mu.oz.au
Wed Mar 5 23:42:33 AEDT 1997
The following mail was sent to mercury-bugs, but I think
it is more appropriate for mercury-users, so I'm sending this
reply there.
Serap Yilmaz, you wrote:
>
> Dear Mr./Ms.,
> I started learning Mercury recently. Currently I am writing a programme
> where I needed to use some facilities which I used to use in Prolog. Could
> you tell me the corresponding predicates or e.t.c (that were given for
> Prolog below) if there exist such things in Mercury?
>
> In Prolog:
> 1. =.. ("univ" operator)
> 2. functor/3, arg/3
> 3. nonvar(T), var(T) where T is a term
Regarding 1 and 2, there is no direct equivalent to these predicates in
Mercury 0.6, which is the current release. We have implemented
equivalents in the latest development version, called functor/3, arg/3,
and (tentatively) expand/4 (`=..' is hardly mnemonic, and expand/4 is
not much better; does anyone have a suggestion for a better name for
this predicate?). These will be available in the next release of Mercury.
Regarding 3, the appropriate equivalent depends on exactly what it is
that you are trying to achieve. You need to explain why your Prolog
program uses nonvar/1 and var/1 before we can suggest appropriate
alternatives in Mercury.
Cheers,
Fergus.
P.S. If you really really *really* need functor/3 and arg/3 *now*,
and you are willing to spend whatever time is required to install a
relatively untested beta-release source distribution, then we can
make one available.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
More information about the users
mailing list