🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #3158

Re: behavior of read/get0 at end_of_file

#3158
From: Gunnar Blomberg
Date: Fri, 25 Mar 1988 12:50
38 lines
2361 bytes
In article <801@cresswell.quintus.UUCP> ok@quintus.UUCP (Richard A. O'Keefe) writes:
>Another thing it is useful for is leaving test data in a source file.
>One can do
>	<declarations>
>	<clauses>
>	end_of_file.
>	<test cases>
>and include the test cases in the program or not just by moving the
>end_of_file around.
>
>Ah, you'll say, but that's what nested comments are for!
>Well no, they don't work.  That's right, "#| ... |#" is NOT a reliable
>way of commenting code out in Common Lisp, and "/* ... */" is NOT a
>reliable way of commenting code out in PopLog.  But end_of_file, in
>Edinburgh Prolog, IS a reliable way of commenting out the rest of the file.

	Well, considering the fact that nested comments can comment out
*any* part of the file, not just the last part, and that the cases
where nested comments do not work must be so exceedingly rare as to be
practically non-existent, I would definitely prefer nested comments.
Honestly, how often do you have unmatched beginning-of-nested-comment
of end-of-nested-comment buried inside your code?
	Well, just because nested comments are much more useful than
plain ones does not mean that BSI should adopt them.  There is the
question of supporting "old" code.  It would be interesting to know
how many programs would break if Prolog comments were changed to be
nesting.  Do you know of any?
[I have actually seen the following style used in C:
	/* #define wantFOO 1	/* To get foo feature */
	#define wantBAR 1	/* To get bar feature */
	/* #define wamtBAZ 1	/* To get baz feature */
 It gave me a good laugh at the time.]
	In any case, I have always considered the use of end_of_file
to get some kind of half-baked ability to comment out a part of a file
as an abomination (which does not mean I didn't use it and find it
useful).
-- 
Gunnar Blomberg, ZYX, +46 8 6653205, grzm@zyx.se
Technical Details
Message-ID: <2412@zyx.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!mcvax!enea!zyx!grzm
References: <608> <1197@kulcs.kulcs.uucp> <783@cresswell.quintus.UUCP> <518@ecrcvax.UUCP> <801@cresswell.quintus.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!mcvax!enea!zyx!grzm
From: grzm@zyx.UUCP (Gunnar Blomberg)
Newsgroups: comp.lang.prolog
Subject: Re: behavior of read/get0 at end_of_file
Message-ID: <2412@zyx.UUCP>
Date: 25 Mar 88 12:50:44 GMT
References: <608> <1197@kulcs.kulcs.uucp> <783@cresswell.quintus.UUCP> <518@ecrcvax.UUCP> <801@cresswell.quintus.UUCP>
Reply-To: grzm@zyx.SE (Gunnar Blomberg)
Organization: ZYX Sweden AB, Stockolm, Sweden
Lines: 38
Keywords: get0 read end_of_file