spdegabrielle
2020-5-16 12:21:38

Mailing list posts are better than nothing. I pulled something from 2014 last week -worked perfectly I might add - so it does have value. I’m keen on adding examples to the docs as that has been noted as an issue before.


plragde
2020-5-16 13:19:56

Has anyone worked out how to hide/reveal content in Scribble rendered to HTML with a button to toggle the display? I know it can be done with CSS+JS but if someone’s already implemented this functionality I’d rather just borrow it. Thanks.


scolobb-slack
2020-5-16 13:25:25

OK, adding --avoid-main flag fixed it. Initially, raco setup would try to do something to the main installation which is normally read only to the user on NixOS.


scolobb-slack
2020-5-16 13:26:10

Is such information worth sharing on the Google Group? I’d say yes, but a second opinion would be helpful



greg
2020-5-16 13:56:04

@plragde The HTML5 <details> element? https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details


greg
2020-5-16 13:58:38

(You said “button”. I’m hoping you could use CSS to style the <summary> element to look sufficiently “button-y”.)


plragde
2020-5-16 14:46:20

Thank you @greg! That is exactly what I needed.


plragde
2020-5-16 14:47:38

I found it independently and came here to find I should have checked back earlier.


plragde
2020-5-16 14:47:56

I don’t care about the button shape, it’s the functionality that I wanted.


plragde
2020-5-16 14:50:28

Thank you also @soegaard2 as that page will be useful in other contexts.


soegaard2
2020-5-16 14:51:00

I found a few interesting examples as well.


alexknauth
2020-5-16 23:55:37

If I’m looking for an equality function that uses structural equality on immutable values, but reference equality on mutable values, is chaperone-of? exactly what I’m looking for?


alexknauth
2020-5-17 00:45:21

I mean, I think so, but the name gives me the feeling that’s not the purpose it’s meant for?


alexknauth
2020-5-17 01:32:16

and there aren’t chaperone-of?-based hash tables the way there are equal?-based hash tables


wswzk864864
2020-5-17 01:43:33

@wswzk864864 has joined the channel


samth
2020-5-17 02:32:31

@alexknauth yes, you can define egal? as (or (chaperone-of? a b) (chaperone-of? b a))


alexknauth
2020-5-17 02:43:31

Wait, is chaperene-of? not symmetric?


alexknauth
2020-5-17 03:13:36

Oh, not only is it not symmetric, but that non-symmetricness makes (or (chaperone-of? a b) (chaperone-of? b a)) return false in cases where I would want it to be true. (define h1 (make-hash)) (define h2 (contract (hash/c any/c any/c) h1 'pos 'neg)) (chaperone-of? h2 h1) ; #t (chaperone-of? h1 h2) ; #f makes it non-symmetric (chaperone-of? (list h1 h2) (list h2 h1)) ; so false (chaperone-of? (list h2 h1) (list h1 h2)) ; and flipping outside doesn't fix it


alexknauth
2020-5-17 05:02:39

It also doesn’t recognize two independently-created chaperones on the same object. If x2 and x3 are both chaperones of x1, (or (chaperone-of? x2 x3) (chaperone-of? x3 x2)) is false and I don’t even know how to fix it by traversing stuff (define h1 (make-hash)) (define h2 (contract (hash/c any/c any/c) h1 'pos 'neg)) (define h3 (contract (hash/c any/c any/c) h1 'pos 'neg)) (or (chaperone-of? h2 h3) (chaperone-of? h3 h2)) ; #f Is there a way of recognizing those as equivalent because both are equivalent to h1, without including structural equivalences on mutable data?


alexknauth
2020-5-17 05:24:03

I guess (chaperone-of? a b) is transitive but not symmetric, but (or (chaperone-of? a b) (chaperone-of? b a)) is symmetric without being transitive. Is there any way of getting all three: • symmetric • transitive • structurally traverse chaperones and immutable-data, not mutable-data


notjack
2020-5-17 05:29:43

Mentioned this on Twitter but repeating it here for exposure: there is no way to fix this problem other than making mutable types not implement equal? structurally. Two mutable objects should never be equal unless changes to one will be reflected in the other and vice-versa.


notjack
2020-5-17 05:31:17

alas that means there’s no way to fix this for the current racket collection APIs :disappointed:


yz489
2020-5-17 06:34:51

@yz489 has joined the channel