Re: [racket-users] Unsafe structs

2021-01-21 Thread Sam Tobin-Hochstadt
On Wed, Jan 20, 2021 at 5:16 PM Dominik Pantůček wrote: > > Hi Sam, > > I went through all my notes and prepared minimal (sometimes) working > examples for most of the issues I mentioned. Let's go through it one by > one. I assume that some of the complications I encountered were because > my

Re: [racket-users] Unsafe structs

2021-01-21 Thread George Neuner
On 1/20/2021 1:53 AM, Sorawee Porncharoenwase wrote: However, ‘struct-field-info-list’ returns only fields defined by the actual type and does not include fields that were inherited. What I don’t see is any simple way to get at the struct’s inheritance hierarchy —- it seems

Re: [racket-users] Unsafe structs

2021-01-20 Thread Dominik Pantůček
Hi Sam, I went through all my notes and prepared minimal (sometimes) working examples for most of the issues I mentioned. Let's go through it one by one. I assume that some of the complications I encountered were because my lack of experience with Typed Racket. I hope some of these examples will

Re: [racket-users] Unsafe structs

2021-01-19 Thread Sorawee Porncharoenwase
However, ‘struct-field-info-list’ returns only fields defined by the actual type and does not include fields that were inherited. What I don’t see is any simple way to get at the struct’s inheritance hierarchy —- it seems that you have to iterate ‘struct-type-info’ to enumerate the supertypes.

Re: [racket-users] Unsafe structs

2021-01-08 Thread Sam Tobin-Hochstadt
Thanks for this detailed account (and for trying it out). I have some questions inline: On Sat, Jan 2, 2021 at 5:34 PM Dominik Pantůček wrote: > And now for the worse part. TR rough edges: > > * Higher-order procedures and polymorphic functions in all imaginable > combinations. That was a total

Re: [racket-users] Unsafe structs

2021-01-02 Thread Robby Findler
On Sat, Jan 2, 2021 at 4:34 PM Dominik Pantůček < dominik.pantu...@trustica.cz> wrote: > Hello Racketeers (and Robby especially)! > > On 22. 12. 20 1:30, Robby Findler wrote: > > Is Typed Racket able to prove that your use of unsafe accessors is > > actually safe? > > Short answer: YES. > > One

Re: [racket-users] Unsafe structs

2021-01-02 Thread Dominik Pantůček
Hello Racketeers (and Robby especially)! On 22. 12. 20 1:30, Robby Findler wrote: > Is Typed Racket able to prove that your use of unsafe accessors is > actually safe? Short answer: YES. One question for a start: And what now? Disclaimer: The following text is by no means intended as critique

Re: [racket-users] Unsafe structs

2020-12-21 Thread Dominik Pantůček
On 22. 12. 20 4:40, Philip McGrath wrote: > On Mon, Dec 21, 2020 at 7:30 PM Robby Findler > wrote: > > Is Typed Racket able to prove that your use of unsafe accessors is > actually safe? > I can try adding type annotations everywhere, but as I

Re: [racket-users] Unsafe structs

2020-12-21 Thread Philip McGrath
On Mon, Dec 21, 2020 at 7:30 PM Robby Findler wrote: > Is Typed Racket able to prove that your use of unsafe accessors is > actually safe? > On a similar note, my understanding is that, even without types, in a program like this: #lang racket (struct cell (val)) (λ (x) (if (cell? x)

Re: [racket-users] Unsafe structs

2020-12-21 Thread Robby Findler
Is Typed Racket able to prove that your use of unsafe accessors is actually safe? Robby On Mon, Dec 21, 2020 at 3:36 PM Dominik Pantůček < dominik.pantu...@trustica.cz> wrote: > > On 21. 12. 20 18:07, David Storrs wrote: > > > > The struct-plus-plus module also provides reflection, so you

Re: [racket-users] Unsafe structs

2020-12-21 Thread Dominik Pantůček
On 21. 12. 20 18:07, David Storrs wrote: > > The struct-plus-plus module also provides reflection, so you might take > a look to see if there are any ideas in there that would be useful for > your own module. Accessors are included, as are constructors, rules, > wrappers, default values, and

Re: [racket-users] Unsafe structs

2020-12-21 Thread Dominik Pantůček
On 21. 12. 20 18:14, George Neuner wrote: > > On 12/20/2020 3:34 PM, Dominik Pantůček wrote: >> Hello Racketeers, >> >> there were some discussions about structs' introspection on the IRC >> lately and one of the questions that arose was how to get field index >> for arbitrary struct's

Re: [racket-users] Unsafe structs

2020-12-21 Thread George Neuner
On 12/20/2020 3:34 PM, Dominik Pantůček wrote: Hello Racketeers, there were some discussions about structs' introspection on the IRC lately and one of the questions that arose was how to get field index for arbitrary struct's arbitrary field. Not that it is possible... But the general

Re: [racket-users] Unsafe structs

2020-12-21 Thread David Storrs
The struct-plus-plus module also provides reflection, so you might take a look to see if there are any ideas in there that would be useful for your own module. Accessors are included, as are constructors, rules, wrappers, default values, and predicates. spp has two primary limitations: You

[racket-users] Unsafe structs

2020-12-20 Thread Dominik Pantůček
Hello Racketeers, there were some discussions about structs' introspection on the IRC lately and one of the questions that arose was how to get field index for arbitrary struct's arbitrary field. Not that it is possible... But the general discussion made me think about why there are no unsafe