🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #267

Re: Bootstrapping precedence grammars.

#267
From: David Bowen
Date: Wed, 02 Aug 1989 03:17
21 lines
1176 bytes
>	op(Prec, Type, Rator)
> 
> cannot be used in the mode
> 
>       op(OUTPUT, OUTPUT, INPUT),
> 
> to find the precedence and fixity of an operator, but only in the mode
> 
>       op(INPUT, INPUT, INPUT).


The predicate that you need is current_op/3.  This can be called
with any or all of its arguments unbound.

There is a reasonably well-accepted rule that predicates
which cause side-effects, like op/3, should be kept separate
from predicates which merely inspect the state of the system,
like current_op/3.  A benefit of this rule is that if you
accidentally call a predicate like op/3 with an unbound variable
as an argument, you should get an error, rather than having
the goal either fail quietly or fill in some value and continue.
Technical Details
Message-ID: <1236@quintus.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!sun-barr!newstop!sun!quintus!dave
References: <3635@csd4.milw.wisc.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!sun-barr!newstop!sun!quintus!dave
From: dave@quintus.UUCP (David Bowen)
Newsgroups: comp.lang.prolog
Subject: Re: Bootstrapping precedence grammars.
Message-ID: <1236@quintus.UUCP>
Date: 2 Aug 89 03:17:12 GMT
References: <3635@csd4.milw.wisc.edu>
Reply-To: dave@quintus.UUCP (David Bowen)
Organization: Quintus Computer Systems, Inc.
Lines: 21