Re: [racket-users] Class constracts and equality

2015-09-11 Thread Konrad Hinsen
Asumu Takikawa writes: > On 2015-09-02 08:41:21 +0200, Konrad Hinsen wrote: > > That would be great, but if that's not possible, the next-best option would > > be to document the restriction. > > I now have a pull request that should address this: > > https://github.com/plt/racket/pull/

Re: [racket-users] Class constracts and equality

2015-09-10 Thread Asumu Takikawa
On 2015-09-02 08:41:21 +0200, Konrad Hinsen wrote: > That would be great, but if that's not possible, the next-best option would > be to document the restriction. I now have a pull request that should address this: https://github.com/plt/racket/pull/1044 I've only found one issue with this so

Re: [racket-users] Class constracts and equality

2015-09-01 Thread Konrad Hinsen
Hi Asumu, > In particular, the code for class contracts explicitly installs a value for > the > inspector that doesn't allow inspection (there's a comment saying "No > inspection"). Thanks for exploring this, at least I now know what's going on! > But maybe it's worth revisiting this part

Re: [racket-users] Class constracts and equality

2015-09-01 Thread Asumu Takikawa
Hi Konrad, On 2015-09-01 20:42:42 +0200, Konrad Hinsen wrote: > Thanks for the reference, but my interpretation of this is different. I > don't care about eq?, nor about testing how objects were created. I want > comparison by equal? by recursive application to the fields - just as for > transpare

Re: [racket-users] Class constracts and equality

2015-09-01 Thread Konrad Hinsen
On 01/09/15 18:45, Daniel Feltey wrote: I think this is expected, if you want to check for equality on instances of contracted classes you should use the `object=?` function which can "see through" the contract wrappers. http://docs.racket-lang.org/reference/objectutils.html?q=object%3D%3F#%28d

[racket-users] Class constracts and equality

2015-09-01 Thread Konrad Hinsen
Hi everyone, I am trying to add a contract to a class but find that the mere presence of the contract breaks my code. Here is a minimal example that illustrates the problem: -- #lang racket (define foo% (class object% (inspect #f) (super-