Is it possible to create a temporary file, write to it, run a command on it, 
and the possibly delete the file from within a macro? Or is it possible to run 
a command (as in `system`) in a context where it pretends that some file exists?

And, how does this play with DrRacket's background expansion?

The reason I'm thinking about this is that I want to call out to an external 
compiler (for a language other than racket, not implemented in racket), get 
information back from that compiler, and display that information in the form 
of DrRacket's mouse-over-tooltips.

I tried this, and it said "forbidden (write) access" to the temporary file name 
that it generated. I get this error from DrRacket's background expansion.

Is there a way to do this in a way I can use while generating DrRacket tooltips?

#lang racket
(require (for-syntax racket/file))

(define-syntax m
  (λ (stx)
    (define tmp (make-temporary-file))
    (display-to-file "hello there\n" tmp #:exists 'replace)

;open-output-file: forbidden (write) access to

Alex Knauth

You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
For more options, visit

Reply via email to