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 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 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

[racket-users] side-conditions

2020-12-21 Thread Beatriz Moreira
Hi, I have been using side-condition to check if a sequence of variables exist is in an environment , like this : *(side-condition (not (member (term ((s : _) ...)) (term (env-ß_1 ...)* being s a state variable and _ a value that i don't know. But it doesn't seem to work as expected, as

Re: [racket-users] side-conditions

2020-12-21 Thread Robby Findler
I recommend you define a metafunction or judgment form that captures what you want exactly and then use that. Robby On Mon, Dec 21, 2020 at 8:32 AM Beatriz Moreira wrote: > Hi, > I have been using side-condition to check if a sequence of variables exist > is in an environment , like this : >

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 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

[racket-users] Scribble and main.rkt

2020-12-21 Thread unlimitedscolobb
Hello, This is mainly a question out of curiosity, because I think I figured out how to do what I want. I'm setting up a small (8 functions and 2 macros) package called typed-compose. I called the main file typed-compose.rkt (not main.rkt) and put the following in the preamble of

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

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