Conversation
Now this is where drracket:tool^ is available.
Now editors->string knows it's only ever called with two arguments.
Fix racket#17 by loading the language metadata from the DrRacket configuration and prepending it to a clone of the definitions editor before serializing this clone. Warning: This hard-codes the module name to `'handin`, which doesn't sound very good.
This uses many internal APIs, but I don't see how to do that otherwise. I already simplified significantly the code (as done elsewhere in the handin-client), removing various calls to internal APIs in the process.
|
@albertxing: still interested? |
|
Did you try using |
|
@Blaisorblade Only partially. I used a workaround (saving a temporary file and then reading and sending that to the server). However as @rfindler mentioned |
|
One gotcha to watch out for: the |
TL; DR. I looked into it, but it seemed problematic for many reasons. (1) A simple test confirms Below I elaborate in too much detail, because I've tried hard to see whether my analysis was missing something, also because my Racket is still limited; yet all the evidence seems to agree.
--- a/handin-client/client-gui.rkt
+++ b/handin-client/client-gui.rkt
@@ -742,6 +742,7 @@
(write-editor-global-header stream)
(for ([ed (in-list (list definitions-with-fake-header interactions))]) (send ed write-to-file stream))
(write-editor-global-footer stream)
+ (send definitions save-port (current-output-port))
(send base get-bytes)))
; Adapted fromYou'll find example output at https://gist.github.com/Blaisorblade/99435d25e5a46e0ae645.
|
|
Oh, I see. I thought that on/after-save-file were called by save-port. Thank you for the careful investigation! I can see how it would be better to copying that bit of code than create a temporary file as part of the handin process (after all, who knows what the state of that disk might be). |
Thank you for accepting it! (In frankness, I've been so thorough because I'm no Racket expert user yet: still need to learn properly about classes and units 😉 ). |
|
Unsubscribing from notifications, please tag me if needed. |
Improved version of #22, fixing #17.
In comparison:
Warning: I haven't stress-tested this yet.