Article View: comp.lang.prolog
Article #1516Re: a question about read
From: Michael Brady
Date: Wed, 30 Sep 1992 13:45
Date: Wed, 30 Sep 1992 13:45
24 lines
1639 bytes
1639 bytes
In article <23753@alice.att.com>, pereira@alice.att.com (Fernando Pereira) wrote: [About DEC10 Prolog's behaviour of read/1 and get/1] etc. but > according to the manual and my recollection both read(X) and get(C) > advance the input appropriately and try to unify the object scanned > with their argument. If the unification fails, the advancing of the input > stream is not undone, but the calls fail. My memory, which could easily be wrong, was that if for read(Term), it read in the first term it came across, and failed if that term wasn't unifiable with Term. It would also report syntax errors... For get0(Char), it read in a character, and if the character didn't unify with Char, it would advance to the next character and try again, ad infinitum until the right character was read. Is my memory playing tricks on me? The real question is what is the most desirable action in these cases. I agree with Lee about read/1, but how about get0/1 and get/1? --------------------- Mike Brady Computer Science Department, Trinity College Dublin, Ireland
Technical Details
Message-ID:
<brady-300992144101@brady.cs.tcd.ie>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!ieunet!tcdcs!brady.cs.tcd.ie!userReferences:
<10468@uqcspe.cs.uq.oz.au> <14755@goanna.cs.rmit.oz.au> <290992115341@brady.cs.tcd.ie> <23753@alice.att.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.prolog Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!ieunet!tcdcs!brady.cs.tcd.ie!user From: brady@cs.tcd.ie (Michael Brady) Subject: Re: a question about read Message-ID: <brady-300992144101@brady.cs.tcd.ie> Followup-To: comp.lang.prolog Sender: usenet@cs.tcd.ie (NN required at ashe.cs.tcd.ie) Nntp-Posting-Host: brady Organization: University of Dublin, Trinity College References: <10468@uqcspe.cs.uq.oz.au> <14755@goanna.cs.rmit.oz.au> <290992115341@brady.cs.tcd.ie> <23753@alice.att.com> Date: Wed, 30 Sep 1992 13:45:58 GMT Lines: 24