chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] [PATCH] always use temporary filenames in csc


From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH] always use temporary filenames in csc
Date: Sat, 10 Nov 2012 14:18:58 +0100
User-agent: Mutt/1.4.2.3i

On Sat, Nov 10, 2012 at 01:11:01PM +0100, Felix wrote:
> > Chicken always writes a comment to the C file.  If the first line
> > for the C file that you're about to generate which corresponds to
> > foo.scm doesn't match "/* Generated from foo.scm by the CHICKEN compiler",
> > csc could abort with a message stating that there's a
> > non-Chicken-generated file in the way.  I think this would solve Alan's
> > original problem neatly and require a minimal change in Chicken's
> > behavior.
> 
> I don't think this is a good idea. Scanning files for comments is
> always a maintenance problem (what if the comment changes? what if the
> comment happens to look like a generated one? Someone might have
> cat(1)ed files together). It's a hack, I'm sure you agree with me
> here.

I totally agree.  More politically correct programmers would call it a
"heuristic" and leave it at that.  Like I said, I think this is all a
lot of fuss about nothing (I think the current behaviour is just fine).
This "heuristic" would at least take care of the kind of mistake Alan
is talking about, and prevent Chicken from overwriting completely
user-generated C.  "it's better than nothing"

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth



reply via email to

[Prev in Thread] Current Thread [Next in Thread]