How can you attach some sort of metadata tag to a procedure, so that some code could examine that procedure and do something special if it has the tag?
@bkovitz see prop:procedure
for the ability to make structs into procedures
So basically you make the procedure a struct, then?
yes
OK, got it.
or something like this (not tested): (struct v (proc data) #:prop:procedure 0)
(define (get-metadata x) (if (v? x) (v-data x) #f))
(define (add-metadata f md)
(v f md))
Hmm, I’ll think about that. Now off to the colloquium…
How can you start a REPL in DrRacket that inputs from the user in the same way as normal, i.e. not with a text field followed by an “eof” button? When I call (read-eval-print-loop)
, I get the text field. ((current-prompt-read))
brings up the text field.
You can’t, is the short answer
@modality has joined the channel