[m-users.] IO argument clobbering
Volker Wysk
post at volker-wysk.de
Tue Jul 18 20:02:04 AEST 2023
Am Dienstag, dem 18.07.2023 um 19:55 +1000 schrieb Zoltan Somogyi:
> On 2023-07-18 11:44 +02:00 CEST, "Volker Wysk" <post at volker-wysk.de> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mercurylang.org/archives/users/attachments/20230718/bc579f42/attachment.sig>
More information about the users
mailing list