Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!batcomputer!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.prolog Subject: Re: Does Prolog have an unambiguous syntax definition? Message-ID: <4834@goanna.cs.rmit.oz.au> Date: 27 Feb 91 07:18:38 GMT References: <12388@darkstar.ucsc.edu> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 31 In article <12388@darkstar.ucsc.edu>, kjell@saturn.ucsc.edu (Kjell Post) writes: > But what about this example? > :- op(500,xfy,@). % infix > :- op(600,xf,@). % postfix > :- op(700,xf,#). % postfix > display(a @ #). > Quintus Prolog Release 2.2 (Sun-3, Unix 3.5) => @(a,#) > SICStus 0.6 #18: Mon Oct 22 13:46:21 PDT 1990 => #(@(a)) It's amazing the problems you don't run into when you don't use postfix operators. I wish DHDW had never bothered to put them into DEC-10 Prolog. I think that #(@(a)) is the better answer here. I would point out that in SICStus 0.7, with these declarations, ?- writeq((a @) #). % #(@(a)) and ?- writeq(a @ (#)). % @(a,#) both produce the same output a@ # I think this brings out an EXTREMELY important point. A standard is at very much the same level as the "specification" of Prolog syntax we already have. We need a model implementation and a whole lot of nasty test cases like this that show that what the standard specifies can in fact be done. Thanks to Chris Moss for the syntax tests we do have; has someone got an additional collection of examples like this one? I would like to fix the public-domain reader. -- The purpose of advertising is to destroy the freedom of the market.