[m-users.] IO argument clobbering

Volker Wysk post at volker-wysk.de
Tue Jul 18 01:07:29 AEST 2023


Am Montag, dem 17.07.2023 um 15:52 +0100 schrieb Sean Charles
(emacstheviking):
> Zoltan, Volker...... yes!
> 
> That makes it compile and run just fine.... I am not sure I fully comprehend but I will go and RTFM some more, that might help.

"in" is an abbreviation for "in(ground)". "ground" means normal data,
nothing callable. A predicate isn't ground. Its inst is like you have
defined it in your ":- inst callback == ...".

Cheers,
Volker

> 
> Thank you both.
> 
> 
> > On 17 Jul 2023, at 15:37, Zoltan Somogyi <zoltan.somogyi at runbox.com> wrote:
> > 
> > 
> > On 2023-07-17 16:27 +02:00 CEST, "Sean Charles (emacstheviking)" <objitsu at gmail.com> wrote:
> > > :- type callback == (pred(world, world, io, io)).
> > > :- inst callback == (pred(in, out, di, uo) is det).
> > > 
> > > :- pred run_loop(
> > >    callback::in, world::in, world::out, io::di, io::uo
> > > ) is det.
> > 
> > Without compileable example code I cannot be sure, but I think
> > the problem is the "callback::in" in the declaration of run_loop.
> > What happens when you replace it with "callback:in(callback)"?
> > The mode checker needs this to tell it the mode of the higher order arg.
> > 
> > Zoltan.
> 
> _______________________________________________
> users mailing list
> users at lists.mercurylang.org
> https://lists.mercurylang.org/listinfo/users

-------------- 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/20230717/5e144132/attachment-0001.sig>


More information about the users mailing list