<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Thanks. I really need to write another book...</div><div class="gmail_default" style="font-family:monospace,monospace">Way back when, Dave Bowen at Quintus wrote a debugging tool to tell you when</div><div class="gmail_default" style="font-family:monospace,monospace">a predicate you thought was determinate wasn't. So we ran it on our own code.</div><div class="gmail_default" style="font-family:monospace,monospace">And found bugs, of course.</div><div class="gmail_default" style="font-family:monospace,monospace">If you have questions about modes and insts ask them on the mailing list.</div><div class="gmail_default" style="font-family:monospace,monospace">It will be a big help, by getting the questions and answers where search</div><div class="gmail_default" style="font-family:monospace,monospace">engines can find them.</div><div class="gmail_default" style="font-family:monospace,monospace">I don't know if Fergus Henderson's PhD thesis might help you</div><div class="gmail_default" style="font-family:monospace,monospace">understand the *point* of modes better?</div><div class="gmail_default" style="font-family:monospace,monospace"><a href="https://pdfs.semanticscholar.org/d9fa/c21f57895d1d40037021c829a2df2c7b606c.pdf?_ga=2.112261900.989814282.1561975986-258283753.1542326724">https://pdfs.semanticscholar.org/d9fa/c21f57895d1d40037021c829a2df2c7b606c.pdf?_ga=2.112261900.989814282.1561975986-258283753.1542326724</a><br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">I went to University, and taught at Universities for quite a while.</div><div class="gmail_default" style="font-family:monospace,monospace">Let me give you an anecdote about a University I'm *not* associated with.</div><div class="gmail_default" style="font-family:monospace,monospace">My father had a whole bunch of letters after his name, including law</div><div class="gmail_default" style="font-family:monospace,monospace">degrees done remotely, up to LLM level. He wanted a PhD. He worked for</div><div class="gmail_default" style="font-family:monospace,monospace">a couple of years on his thesis, sent it in, and (famous English</div><div class="gmail_default" style="font-family:monospace,monospace">University) said it wasn't good enough. He sent the thesis off to a publisher.</div><div class="gmail_default" style="font-family:monospace,monospace">He chose another topic, worked a couple of years on it, went to (famous English</div><div class="gmail_default" style="font-family:monospace,monospace">University) for six months to wrap it up, handed it in, and (famous English</div><div class="gmail_default" style="font-family:monospace,monospace">University) said it wasn't good enough and gave him an MA as a consolation prize.</div><div class="gmail_default" style="font-family:monospace,monospace">He sent that thesis off to the publisher. BOTH the rejected theses became the</div><div class="gmail_default" style="font-family:monospace,monospace">standard reference works in their respective areas. He always said that the</div><div class="gmail_default" style="font-family:monospace,monospace">examiners rejected his theses because they didn't understand them and were</div><div class="gmail_default" style="font-family:monospace,monospace">ashamed to admit it.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">Me, I took a paper in tertiary education, and failed. It was in that paper that</div><div class="gmail_default" style="font-family:monospace,monospace">I heard someone say in all seriousness that there is no such thing as truth. It</div><div class="gmail_default" style="font-family:monospace,monospace">was a senior lecturer in Nursing. You may understand why I tremble in today's</div><div class="gmail_default" style="font-family:monospace,monospace">hospitals. (One of my grandmothers was a nurse, and two of the nicest young</div><div class="gmail_default" style="font-family:monospace,monospace">ladies I ever failed to work up the courage to ask out. Nurses I respect. People</div><div class="gmail_default" style="font-family:monospace,monospace">who deny the existence of truth scare me.)</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">As someone who has worked at two Computer Science departments and given lectures</div><div class="gmail_default" style="font-family:monospace,monospace">at a couple of others, I can assure you that very very few PhD graduates would</div><div class="gmail_default" style="font-family:monospace,monospace">find Mercury any more obvious than you. Some of them would have taught themselves</div><div class="gmail_default" style="font-family:monospace,monospace">Haskell, or perhaps F#. Some of the rest think that lambda expressions were</div><div class="gmail_default" style="font-family:monospace,monospace">invented by Brendan Eich. To be comfortable with Mercury (or the papers that</div><div class="gmail_default" style="font-family:monospace,monospace">explain the ideas behind Mercury) it helps to have studied logic and type theory.</div><div class="gmail_default" style="font-family:monospace,monospace">I think in the last 20 years we graduated one student with a thesis in type theory.</div><div class="gmail_default" style="font-family:monospace,monospace">Mercury is solidly rooted in 1980s ideas about AI and program verification and</div><div class="gmail_default" style="font-family:monospace,monospace">such-like.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">SO DON'T PUT YOURSELF DOWN. University schmuniversity. Learning's the thing!</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 30 Jun 2019 at 05:03, emacstheviking <<a href="mailto:objitsu@gmail.com">objitsu@gmail.com</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"><div dir="ltr">Firstly, thanks for writing The Craft of Prolog. It sits next to all the others I have and I hope one day be smart enough to truly grok!<div>Secondly, you are right...we are all doomed and thinking about it does indeed make you mad!</div><div><br></div><div>I was aware that see/seen was about reading the file, but I considered it only polite to close it after opening it. :)</div><div><br></div><div>Right now, I am *making myself* work through the PDF getting started book by Ralph Becket and not diverging if i can possibly help it. The thing I like about Mercury the most is that having spent too many hours scratching my head in SWI debugger wondering why a predicate silently fails, is that it throws back some of the burden of responsibility to the developer to know ahead of time exactly what this predicate is supposed to be doing, I mean, after all, *we* write them so we ought to know, even if it is non-deterministic!</div><div><br></div><div>The modes and inst-ness are giving me some headaches but I am sure it will all make sense eventually......it's harder for me at least because I didn't go to university so I don't have a maths or Cs degree i.e. everything that I've learned over the last 34 years has been self taught and I continue to learn daily as I am a learning junkie. Sometimes I almost think it was a good thing I didn't attend as I would never have left....</div><div><br></div><div>All the best,</div><div>Sean.</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 29 Jun 2019 at 15:42, Richard O'Keefe <<a href="mailto:raoknz@gmail.com" target="_blank">raoknz@gmail.com</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"><div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Using see + seen does not test whether a file *exists* but whether</div><div class="gmail_default" style="font-family:monospace,monospace">a file exists *and you are allowed to read it*.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">It has always been the case in Unix that the only way to determine</div><div class="gmail_default" style="font-family:monospace,monospace">if a file exists and you are allowed to read it is to try to open it</div><div class="gmail_default" style="font-family:monospace,monospace">for input, thanks to the existence of concurrent processes.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">With NFS, you can successfully open a file for input and</div><div class="gmail_default" style="font-family:monospace,monospace">then be told "you can't do that" when you try to read it.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">And then there's the possibility that a file might exist</div><div class="gmail_default" style="font-family:monospace,monospace">and you might be allowed to read it, but the name you</div><div class="gmail_default" style="font-family:monospace,monospace">have for it goes through a directory you aren't allowed</div><div class="gmail_default" style="font-family:monospace,monospace">to search.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">It you think too deeply about all the things that can go</div><div class="gmail_default" style="font-family:monospace,monospace">wrong with testing whether a file "exists" you will go</div><div class="gmail_default" style="font-family:monospace,monospace">mad. MAD, I say! We're all DOOMED!</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 29 Jun 2019 at 19:03, emacstheviking <<a href="mailto:objitsu@gmail.com" target="_blank">objitsu@gmail.com</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"><div dir="ltr">Hi,<div><br></div><div>All I have found is see/seen to see if a file exists. Have I missed something totally obvious ?</div><div>And how about checking the existence of a directory too?</div><div><br></div><div>It feels bad to have to use "see" and then "seen" (to undo see) just to test a file exists.</div><div><br></div><div>I am sure I have not found the docs but TBH they doc are just the code for the module and when you are learning this stuff it makes it pretty hard to find anything at times. </div><div><br></div><div>Thanks,</div><div>Sean.</div><div><br></div></div>
_______________________________________________<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>
</blockquote></div>
</blockquote></div>