Article View: comp.lang.prolog
Article #551Re: Prefix operators and blanks (was: WG17)
From: Peter G Ludemann
Date: Thu, 07 Dec 1989 07:00
Date: Thu, 07 Dec 1989 07:00
29 lines
1354 bytes
1354 bytes
The only canonical way of writing out a compound term so that
it can be read in without regard to operator definitions is to
quote everything and use no operator notation. For example:
a+b ===> '+'('a','b')
:- (a,b) ===> ':'(','('a','b'))
Why all the quotes? Well, someone could have defined `a' to be
an operator and therefore '+'(a,b) would get a syntax error.
What I am suggesting is that if `+' is an operator, then you will
be forbidden to write in your program:
+(a,b) or
+ (a,b)
You must write instead:
'+'(a,b) or
'+'((a,b)) etc.
(BTW, there is no ambiguity if comma is not an operator. That is
the one big advantage of the Waterloo syntax - `&' is used instead
and comma is only used as an argument separator. But I am NOT
suggesting deviating that far from Edinburgh syntax.)
- peter ludemann pgl@cup.portal.com sun!portal!cup!pgl
--- standard disclaimer ---
Technical Details
Message-ID:
<24783@cup.portal.com>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!samsung!brutus.cs.uiuc.edu!apple!fox!portal!cup.portal.com!pglReferences:
<24703@cup.portal.com> <2892@munnari.oz.au>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!samsung!brutus.cs.uiuc.edu!apple!fox!portal!cup.portal.com!pgl From: pgl@cup.portal.com (Peter G Ludemann) Newsgroups: comp.lang.prolog Subject: Re: Prefix operators and blanks (was: WG17) Message-ID: <24783@cup.portal.com> Date: 7 Dec 89 07:00:13 GMT References: <24703@cup.portal.com> <2892@munnari.oz.au> Organization: The Portal System (TM) Lines: 29