[Top][All Lists]
[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: |
Fri, 9 Nov 2012 21:08:14 +0100 |
User-agent: |
Mutt/1.4.2.3i |
On Fri, Nov 09, 2012 at 09:02:09PM +0100, Peter Bex wrote:
> Personally, I think there's no shame in expecting the user to know that
> Chicken will overwrite the .c file in the current working directory
> with the same basename as the .scm file. "cc" will also clobber a file
> called "a.out"; if you happen to have one by that name, tough luck.
Having said that, a cleaner way to avoid clobbering user files would
be like CVS: detect that the file exists, and if you think it isn't
yours, bomb.
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.
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
Re: [Chicken-hackers] [PATCH] always use temporary filenames in csc, Felix, 2012/11/10