Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Scheme/Racket output-file

Name: Anonymous 2011-03-12 20:17

hey, I have a question about the scheme programming language R5RS(now called racket or something)

All I want to do is open an output file. This seems easy. This is what I'm doing:

(define out_file (open-output-file out_file_n))

Where out_file_n is the name of the output file as a string. This works, however if the output file already exists, it throws an error. How do I open an output file, and if it already exists, a new one replaces it?

Thanks!

Name: Anonymous 2011-03-13 9:00

>>6
No, what I said is that it is that what open-output-file does is unspecified if the file already exists. It may replace it, it may append to it, it can send it to the FBI, it can throw an error, it can BSOD... Which you would know IF YOU READ THE FUCKING STANDARD. It is also why A) NO-ONE uses plain R5RS B) NO-ONE uses plain R5RS and C) NO-ONE USES PLAIN R5RS.
Can you at least detect if a file exists, and if it does, delete it?
HAHAHAHAHAHAHAHAHAHA
No, again, READ THE FUCKING STANDARD. file-exists? and delete-file were only standardised in R6RS.

And people tell me what a travesty R6RS is, maybe so, but I can write useful and portable programs in it.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List