[m-dev.] use of require/1 and mode error?
Fergus Henderson
fjh at cs.mu.oz.au
Mon Sep 15 15:57:57 AEST 1997
Andrew Bromage, you wrote:
> G'day.
>
> Fergus Henderson wrote:
>
> > > > - % XXX use of `require' is a bug (should be a mode error)
> > > > - { require(laplace(X), "laplace failed\n") },
>
> > A higher-order term (such as the first argument to require/1)
> > is not allowed to have any partially applied output arguments,
> > because (a) it might be called any number of times, and (b)
> > it might be called inside negations. But laplace(X) does bind `X'.
> > (a) is not a problem for `any' insts, but (b) is, so it
> > should be an error.
>
> I realise this is early Monday and I'm not thinking straight, but
> why wouldn't (some [X] laplace(X)) work?
Only because the line following the call to require/1 is
printmat(X)
i.e. the variable is really not local. If you locally quantify it,
then X in the call to printmat(X) will become a singleton variable,
and that will result in a mode error.
--
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 developers
mailing list