leif
2018-1-9 18:40:48

Is there any way to use snip styles to, say, change a word to another language?


leif
2018-1-9 18:40:59

(Rather than just recoloring it and changing the font.)


leif
2018-1-9 18:48:09

I guess I ‘could’ extend the text% class to have change-style take in different arguments. But that still seems cludgy.


cowbs
2018-1-9 19:02:25

Quick question, how does equal-hash-code compose hash values for lists? I’m implementing something similar for our reference checking but I’d like to do it the Racket Way™


mflatt
2018-1-9 19:09:44

@leif I don’t think snip styles will work for that


mflatt
2018-1-9 19:12:22

@cowbs https://github.com/racket/racket/blob/master/racket/src/racket/src/hash.c#L1556 or https://github.com/racket/racket7/blob/master/racket/src/cs/rumble/hash-code.ss#L108 Those are not the same, obviously, and the latter is based on Chez Scheme’s code, but they’re similar.


cowbs
2018-1-9 19:12:48

@mflatt thanks!


ryanc
2018-1-9 21:23:52

@samth The test is checking to make sure that the #:use-place connection option achieves its goal of allowing other Racket threads to execute during long queries. The test works by spawning a thread that increments a counter between naps, running the query, and then comparing the counter against the elapsed time. There’s already a fudge factor of 0.5 compared to absolutely fair scheduling.


ryanc
2018-1-9 21:26:26

I can relax the test even more, but I wonder whether this is a Travis idiosyncrasy or a change to the Mac OS scheduler. And if the latter, is there anything that Racket can and/or should do to compensate? (@mflatt?)


samth
2018-1-9 21:28:14

Can you look back to see when it started failing, and see if that corresponded to some Racket change?


samth
2018-1-9 21:28:31

I can do that once I’m back at a real computer


leif
2018-1-9 21:29:35

@mflatt Sad, thanks though.


ryanc
2018-1-9 21:31:33

My recollection is it happened around the time that people said Travis changed the Mac OS version they used. I can’t dig into it right now, though.


jbclements
2018-1-10 00:47:39

should be easy: can I write a pict to a file? Slideshow can do it, right? I’m hoping to write to… an SVG? A PDF? I feel like I must just not be looking in quite the right place in the docs.


lexi.lambda
2018-1-10 01:02:21

@jbclements maybe draw-pict combined with svg-dc% or pdf-dc%?


blerner
2018-1-10 01:10:54

From https://docs.racket-lang.org/pict/Pict_Datatype.html?q=convertible#%28tech._pict%29: “A pict is a convertible datatype through the file/convertible protocol. Supported conversions include ’png-bytes, ’eps-bytes, ’pdf-bytes, ’svg-bytes, and variants such as ’png-bytes+bounds and ’png-bytes+bounds8.”


blerner
2018-1-10 01:12:00

so, (convert your-pict 'png-bytes) will give you a byte-string that’s easy to save as a .png file


lexi.lambda
2018-1-10 01:12:30

huh, I didn’t know about file/convertible


blerner
2018-1-10 01:12:38

when it works, it’s great :slightly_smiling_face:


zenspider
2018-1-10 01:20:33

I’ve used that… it’s really elegant