<html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><br><div><br><blockquote type="cite"><div>On 18 Jul 2023, at 11:08, Richard O'Keefe <raoknz@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Two points of pedantry.</div><div class="gmail_default" style="font-family:monospace,monospace">Mercury: :- type callback == ... is NOT like a preprocessor macro in C.</div><div class="gmail_default" style="font-family:monospace,monospace">It's much closer to a C 'typedef'.</div></div></div></blockquote><div><br></div><div>Actually, yes it is. I was aiming low...</div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">English: the past participle of 'to grok' is 'grokked', not 'groked'.</div><div class="gmail_default" style="font-family:monospace,monospace">The Groke <a href="https://en.wikipedia.org/wiki/The_Groke">https://en.wikipedia.org/wiki/The_Groke</a> is not involved.</div><div class="gmail_default" style="font-family:monospace,monospace"><a href="https://www.oxfordlearnersdictionaries.com/definition/english/grok">https://www.oxfordlearnersdictionaries.com/definition/english/grok</a></div></div></div></blockquote><div><br></div><div>Interesting they didn't mention Stranger In A Strange Land though. I remember reading that, I can still see the flying manta rays.</div><div><br></div><div><br></div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">I had a bit of trouble getting the hang of higher order insts myself.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 18 Jul 2023 at 21:39, Volker Wysk <<a href="mailto:post@volker-wysk.de">post@volker-wysk.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Am Dienstag, dem 18.07.2023 um 02:09 +1000 schrieb Zoltan Somogyi:<br>
> On 2023-07-17 17:43 +02:00 CEST, "Volker Wysk" <<a href="mailto:post@volker-wysk.de" target="_blank">post@volker-wysk.de</a>> wrote:<br>
> > Am Montag, dem 17.07.2023 um 17:39 +0200 schrieb Volker Wysk:<br>
> > > But the "in(callback)" inst isn't ground. It's a higher order inst. Only<br>
> > > the "in" with zero arguments is an abbreviation for "in(ground)". <br>
> > <br>
> > Hmmm... Looks like I was confused about what "ground" means. <br>
> <br>
> In different contexts, "ground" means several related and similar<br>
> but nevertheless slightly different things. Which meaning of "ground" people<br>
> mean when they write that term is *usually* clear from the context, but not always.<br>
> <br>
> The standard meaning in logic programming theory is simply "a term that<br>
> contains no variables", and all uses of "ground" include this meaning. But Mercury<br>
> goes beyond standard logic programming theory by having types,<br>
> including higher order types. When you write "ground" in a Mercury program,<br>
> that occurrence of "ground" describes a term that contains<br>
> no variables AND whose type is either not a higher order type,<br>
> or is a higher order function type with the standard function mode<br>
> (which is: all arguments are input, the return value is output).<br>
> It cannot be a higher order predicate type, or a higher order function<br>
> type with a nonstandard mode, because for those, you need to tell<br>
> the compiler the modes of their arguments. If you don't give the compiler<br>
> this info, you get the error message that started this thread.<br>
> <br>
> There is a similar issue with respect to uniqueness. The inst "ground"<br>
> describes a reference to a term that contains no variables, and is not<br>
> the only reference to that term. If you want to describe a reference<br>
> to a term that contains no variables but it IS the only reference<br>
> to that term, what you write is "unique".<br>
> <br>
> Internally in the Mercury compiler, the representation of ground<br>
> insts is parameterised by the absence/presence of both uniqueness<br>
> and higher order inst information. The "ground" inst in Mercury programs<br>
> corrresponds to the absence of both of these kinds of information.<br>
> And yet the compiler's name even for insts with one or both<br>
> of these kinds of information is still "ground". So you see, even<br>
> the Mercury language and the Mercury compiler disagree on<br>
> which variant meaning should be called "ground" :-)<br>
<br>
Okay, now I've groked what a "ground term" and a "ground inst" is in<br>
Mercury. Thank you for the explanation.<br>
<br>
Regards,<br>
Volker<br>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.mercurylang.org" target="_blank">users@lists.mercurylang.org</a><br>
<a href="https://lists.mercurylang.org/listinfo/users" rel="noreferrer" target="_blank">https://lists.mercurylang.org/listinfo/users</a><br>
</blockquote></div>
_______________________________________________<br>users mailing list<br>users@lists.mercurylang.org<br>https://lists.mercurylang.org/listinfo/users<br></div></blockquote></div><br></body></html>