Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!swrinde!gatech!news.mathworks.com!newshost.marcam.com!uunet!in1.uu.net!allegra!alice!pereira
From: pereira@alta.research.att.com (Fernando Pereira)
Subject: Re: symbolic global constants (not)
In-Reply-To: stevew@debretts.comp.vuw.ac.nz's message of 29 Apr 1995 09:10:22 GMT
X-Nntp-Posting-Host: alta.research.att.com
Message-ID: <PEREIRA.95Apr29150358@alta.research.att.com>
Sender: usenet@research.att.com (netnews <9149-80593> 0112740)
Reply-To: pereira@research.att.com
Organization: AT&T Bell Laboratories
References: <STEVEW.95Apr27234121@debretts.comp.vuw.ac.nz>
	<3nq7vp$ihl@goanna.cs.rmit.edu.au>
	<STEVEW.95Apr29211022@debretts.comp.vuw.ac.nz>
Date: Sat, 29 Apr 1995 19:03:58 GMT
Lines: 40

In article <STEVEW.95Apr29211022@debretts.comp.vuw.ac.nz> stevew@debretts.comp.vuw.ac.nz (Stephen Wray) writes:
   I'm not worried about efficiency.
   I think this 
   1. looks ugly.
   2. is inconvenient.
   3. is not intuitive.
Pray tell me why you think

	eof(-1).

	...

	scan(C, L, L) :- eof(C).


is less intuitive, more inconvenient or more ugly than

	#define EOF -1

	...

	TokenList scan(int c, TokenList l)
	{
		...
		if (c == EOF) return l;
		...
	}

The difference seems trivial, at least for anyone who is comfortable
with both languages.

--
Fernando Pereira
2B-441, AT&T Bell Laboratories
600 Mountain Ave, PO Box 636
Murray Hill, NJ 07974-0636
pereira@research.att.com
1-908-582-3980


