Re: [m-users.] IO argument clobbering

Volker Wysk <[email protected]>
Newsgroups gmane.comp.lang.mercury.general
Message-ID <[email protected]>
Am Dienstag, dem 18.07.2023 um 19:55 +1000 schrieb Zoltan Somogyi:
> On 2023-07-18 11:44 +02:00 CEST, "Volker Wysk" <[email protected]> wrote:
> > Am Dienstag, dem 18.07.2023 um 18:32 +1000 schrieb Peter Wang:
> > > To clarify, you CAN approximate a higher-order term with the inst `ground',
> > > because the term has no variables (variables essentially meaning "holes"
> > > in the term that are not yet filled in).
> > > 
> > > What you can't do is CALL a higher-order term approximated by `ground'
> > > because `ground' does not include any higher-order inst information.
> > 
> > Hmmm... Why would you want to approximate a higher order inst with a ground
> > inst? Isn't calling the term as a function or predicate the only thing you
> > can do with it?
> 
> You wouldn't WANT to, but sometimes, as with the code that started off
> this email thread, you DO, because you either don't KNOW that you have to
> specify the higher order inst for the higher order value, or because you
> simplify forget.

Yes, that's Sean's case.

> When you write "callback::in" as the type and mode of an argument,
> the type says that the only thing you can do with the argument is call it,
> but the inst says you can't call it, because the compiler does not know
> the modes of the predicate's arguments. 

Yes, I've understood with your explanation (previous mail).

> (In the original example, callback
> is a predicate type, but the same would be true for any function whose mode
> was not the standard function mode.) This is obviously :-) a problem.
> 
> Peter is right; this issue needs better explanation in the error messages
> that it gives rise to. I will look into it.

Agreed. I find the error messages which occur in conjunction with insts hard
to follow.

Cheers,
Volker

_______________________________________________
users mailing list
[email protected]
https://lists.mercurylang.org/listinfo/users
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE6QXGh82Ov3+2nrxp+K4ydFOsHoUFAmS2YxwACgkQ+K4ydFOs
HoWcAhAAvFpGpq8e7a0TLAE9yCDmQmDrrcT6/FARlvTHxwyq8gzlrjTnYYjeAcp2
zERq7eNXE7/eB5WUGdmjA2+0w38jVcix7VhhgtrgYF2etXfWpqQgpdXyLdbTLjaJ
TA9pmx4V75Z4FyjZNDeru6MQCXz3nmJBj7rSMN75s40HmbvypGqzynGUXd9E4d7Y
DUFPysJDnt5AwfS6JwvVelUImKtnUwD3hCAX2sXmo7prKM0ImR65VzeTFi0VpQ9q
t/cCtgbR0r3t2Zbvcqvjq35zKQ16o7DS7gLwFjHB/rTXGr4JOLGVSmjzRjC+jeIH
ad9iAvo/I67sRstcQifnasGYIeEylK8E4XYv2csNUQI08psojKSOerjrGAcY5qNi
OYKZuQ0bM9PVr03rJBce/D0K46yEryUiTRtnDtvJcK/15Qa0GmZsjC46f2VzIGI5
QGTskMX+O8bVMA96VojzDk3bBXhP8095Fsy18AOcmcS7GLcsG+pSxs+I3F1VvtcY
jFakuDgi/qzXOtMdIrfIoFulbg9TtYtVlJKyWR9uyO2G6gPHckX28r5SV9e9gwsx
RBZMuQiR0/FEMswHDLKKQF+szLGJCsXtClvR10kCHOCHJt61U2sJXvS/wBcxL7sw
VtJs/fGB2FHjn4UwHk/eRqsndGnuD15OKihlMg2s8Nql1Y3Ajzw=
=XK1s
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.