The racket documentation is organized into two documents. One that is intended to be the useful, commonly-used bits (called the guide) and one is intended to be comprehensive, showing every possibly knob and button (called the reference). If you don't know about that, it can be easy to flip into the wrong one. In this case, it sounds like you wanted to be reading the Guide's chapter on structs, not the reference's (although both mention 'transparent).
Guide: http://docs.racket-lang.org/guide/define-struct.html Reference: http://docs.racket-lang.org/reference/define-struct.html hth, Robby On Fri, Aug 24, 2018 at 7:15 PM Ben Kovitz <bkov...@gmail.com> wrote: > > On Thursday, August 23, 2018 at 2:49:32 PM UTC-4, David K. Storrs wrote: > >> For me, the first resorts in Racket are list and hash. If I'm going to do >> any heavy lifting with it then I move to struct: >> >> (hash 'username 'bob 'age 18) ; quick and easy, works well with database, >> useful print representation. Weak against typos, not easy to identify what >> a hash represents >> >> (struct user (username age) #:transparent) ; transparent means "show field >> values when printing" >> (user 'bob 18) ; well-defined accessors and setters so not vulnerable to >> typos, has an inbuilt predicate to identify 'user' structs. > > > Ah, thanks! I spent about an hour trying to figure out inspectors and didn't > get anywhere, and I never would have guessed that :transparent means to make > the struct printable. This is the kind of thing I'm looking for: very simple > stuff that's crucial to know to be productive and usually takes only a couple > minutes to explain in person but is omitted in documentation. > > I take it, then, that no collection of these little things exists yet? > > Ben > > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.