bkovitz
2018-10-19 18:40:46

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?


samth
2018-10-19 18:41:42

@bkovitz see prop:procedure for the ability to make structs into procedures


bkovitz
2018-10-19 18:42:17

So basically you make the procedure a struct, then?


samth
2018-10-19 18:44:02

yes


bkovitz
2018-10-19 18:44:23

OK, got it.


samth
2018-10-19 18:45:46

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))


bkovitz
2018-10-19 18:47:46

Hmm, I’ll think about that. Now off to the colloquium…


bkovitz
2018-10-19 20:46:58

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.


samth
2018-10-20 00:11:10

You can’t, is the short answer


modality
2018-10-20 04:04:46

@modality has joined the channel