
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.

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.

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.

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


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

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

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

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

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

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

I found a few interesting examples as well.

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?

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

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

@wswzk864864 has joined the channel

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

Wait, is chaperene-of?
not symmetric?

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

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?

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

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.

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

@yz489 has joined the channel