Re: [racket] A safe version of unsafe-struct-ref [for Whalesong]

2014-07-03 Thread Sam Tobin-Hochstadt
Can't you just delete the whole second binding for accs? Sam On Jul 3, 2014 8:11 PM, "Jens Axel Søgaard" wrote: > Thanks to all for the advice. It seems the following version of match > works for Whalesong: > > https://github.com/soegaard/whalesong-libs > > Admitted I have only made superfic

Re: [racket] A safe version of unsafe-struct-ref [for Whalesong]

2014-07-03 Thread Jens Axel Søgaard
Thanks to all for the advice. It seems the following version of match works for Whalesong: https://github.com/soegaard/whalesong-libs Admitted I have only made superfical tests. In match/compiler.rkt I replaced (define (gen-clause k rows x xs esc) <...> ;; it's a structure [(box?

Re: [racket] A safe version of unsafe-struct-ref [for Whalesong]

2014-07-03 Thread Sam Tobin-Hochstadt
The output of `match` when it uses `unsafe-struct-ref` can't be faithfully implemented safely. In particular, `match` has access to the accessor function, which may give you results that you can't get from safe reflection such as `struct->vector`. Instead, I think you should just implement `unsafe

Re: [racket] A safe version of unsafe-struct-ref [for Whalesong]

2014-07-02 Thread Vincent St-Amour
Would `struct->vector' + `vector-ref' work? Vincent At Wed, 2 Jul 2014 21:06:50 +0200, Jens Axel Søgaard wrote: > > Is it possible to implement unsafe-struct-ref using safe constructs only? > > The reason behind this peculiar question, is that I am porting racket/match > to Whalesong. The matc

Re: [racket] A safe version of unsafe-struct-ref [for Whalesong]

2014-07-02 Thread J. Ian Johnson
ure how not-bad the corresponding unsafe-struct-ref would be :P -Ian - Original Message - From: "J. Ian Johnson" To: "Jens Axel Søgaard" Cc: "racket" Sent: Wednesday, July 2, 2014 3:15:25 PM GMT -05:00 US/Canada Eastern Subject: Re: [racket] A safe version

Re: [racket] A safe version of unsafe-struct-ref [for Whalesong]

2014-07-02 Thread J. Ian Johnson
cking. -Ian - Original Message - From: "Jens Axel Søgaard" To: "racket" Sent: Wednesday, July 2, 2014 3:06:50 PM GMT -05:00 US/Canada Eastern Subject: [racket] A safe version of unsafe-struct-ref [for Whalesong] Is it possible to implement unsafe-struct-ref using safe con

[racket] A safe version of unsafe-struct-ref [for Whalesong]

2014-07-02 Thread Jens Axel Søgaard
Is it possible to implement unsafe-struct-ref using safe constructs only? The reason behind this peculiar question, is that I am porting racket/match to Whalesong. The match compiler uses various unsafe constructs that Whalesong doesn't implement. It is straightforward to replace, say, unsafe-vect