Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!ginosko!uunet!mcvax!unido!ecrcvax!jiyang From: jiyang@ecrcvax.UUCP (Jiyang Xu) Newsgroups: comp.lang.prolog Subject: Re: Bootstrapping precedence grammars. Summary: Implement read(X) in Prolog Message-ID: <752@ecrcvax.UUCP> Date: 4 Aug 89 08:21:23 GMT References: <3635@csd4.milw.wisc.edu> Organization: ECRC, Munich 81, West Germany Lines: 19 In article <3635@csd4.milw.wisc.edu>, markh@csd4.milw.wisc.edu (Mark William Hopkins) writes: > Can Prolog's read(X) predicate be defined using only the character > predicates for I/O? In other words, does Prolog have the capacity to > bootstrap its own precedence grammar, using the operator declarations > made by the op predicate? Certainly you can, as defined in the famous O'Keefe's reader, which is also used in SB-Prolog and possibly many other Prologs. > op(Prec, Type, Rator) > > cannot be used in the mode > > op(OUTPUT, OUTPUT, INPUT), There is another predicate "current_op/3" for this purpose. The predicate is implemented in most Prolog systems.