On Wed, Mar 21, 2018 at 4:43 PM Alexis King wrote:
> > On Mar 21, 2018, at 15:32, Eric Griffis wrote:
> >
> > This would be a code smell if I didn't trust that our Racket ancestors
> > knew what they were doing, so the notion of "fixing" structs (or even
> > struct-copy) seems misguided.
> >
> >
> On Mar 21, 2018, at 15:32, Eric Griffis wrote:
>
> This would be a code smell if I didn't trust that our Racket ancestors
> knew what they were doing, so the notion of "fixing" structs (or even
> struct-copy) seems misguided.
>
> [snip]
>
> I can appreciate the architectural decision that str
I bump into struct subtleties all the time. For example, my attempts to
#:auto always degenerate into custom constructor procedures; This usually
involves #:constructor-name and #:omit-define-syntaxes, which might not be
a big deal if I had a solid understanding of what these flags actually do.
So
Just read your GitHub link and see the problem goes beyond my simple #:auto
issue. Thanks for that link. I’m pretty green to all the thorny issues when it
comes to dressing primitive datatypes up in fancy bindings and hope the
magicians of indirection can somehow pull a rabbit out of the hat on
On Mar 20, 2018, at 9:21 AM, Kevin Forchione wrote:
>
>
Sorry, wrong example!
>(struct fish (color (weight #:auto)) #:transparent)
>(define marlin (fish 'orange-and-white))
>(define dory (struct-copy fish marlin [color 'blue]))
../../Applications/Racket/collects/racket/private/define-struct.r
On Mar 19, 2018, at 2:35 PM, Alexis King wrote:
>
> I’m late to this thread, but perhaps I can clarify some things that I
> don’t think have been made entirely clear.
>
> First of all, you are absolutely correct that structures, at runtime,
> know nothing whatsoever about field names. At runtim
I’m late to this thread, but perhaps I can clarify some things that I
don’t think have been made entirely clear.
First of all, you are absolutely correct that structures, at runtime,
know nothing whatsoever about field names. At runtime, structures are
fancy vectors; the names provided for their f
Does this help?
```
(define-syntax (dump-struct-info stx)
(syntax-case stx ()
[(_ info)
(pretty-write
`(GOT ,(extract-struct-info (syntax-local-value #'info (λ () #f)
#'(void)]))
```
Then we can do:
```
> (struct point (x y [z #:auto #:mutable]) #:transparent)
> (dump-s
> On Mar 17, 2018, at 9:24 AM, Eric Griffis wrote:
>
> How about a list of identifiers bound to getters or setters? The
> `extract-struct-info` procedure in Section 5.7 of the Racket Reference
> appears to give you that.
>
> Eric
Souned promising, but it sounds like you have to roll a stru
How about a list of identifiers bound to getters or setters? The
`extract-struct-info` procedure in Section 5.7 of the Racket Reference
appears to give you that.
Eric
On Fri, Mar 16, 2018 at 2:56 PM Kevin Forchione wrote:
>
>
> > On Mar 16, 2018, at 2:38 PM, Kevin Forchione wrote:
> >
> > Hi
> On Mar 16, 2018, at 2:38 PM, Kevin Forchione wrote:
>
> Hi guys,
> I’ve noticed that struct-copy doesn’t appear to work when fields are defined
> with #:auto. So this leads to my question, which may not be answerable since
> it would presumably be used to fix struct-copy, but is there a wa
11 matches
Mail list logo