Re: [racket] forward pointer declarations

2015-02-02 Thread Anthony Carrico
Along these lines, I also am a little foggy on unions. This: http://docs.racket-lang.org/foreign/C_Union_Types.html says, "Unions are always treated like structs." But I have no idea what that phrase means. I don't get the impression that unions have tags like structs can have. Or can they? Mayb

Re: [racket] forward pointer declarations

2015-02-02 Thread Sam Tobin-Hochstadt
Maybe a ctype which is a delay node, along the lines of 'recursive-contract', is the right thing here. Sam On Mon, Feb 2, 2015, 8:05 AM Anthony Carrico wrote: > On 02/02/2015 01:17 AM, Matthew Flatt wrote: > > It's also valid to reference `wl_interface-pointer` directly: > ... > > > > I don't h

Re: [racket] forward pointer declarations

2015-02-02 Thread Anthony Carrico
On 02/02/2015 01:17 AM, Matthew Flatt wrote: > It's also valid to reference `wl_interface-pointer` directly: ... > > I don't have a nicer solution if you want to refer to > `_wl_message-pointer`, though. > The forward reference is actually in wl_message, like this: (define-cstruct _wl_message

Re: [racket] forward pointer declarations

2015-02-01 Thread Matthew Flatt
At Sun, 01 Feb 2015 19:08:08 -0500, Anthony Carrico wrote: > On 02/01/2015 05:57 PM, Anthony Carrico wrote: > > I get a "duplicate definition" error if I declare a pointer ahead: > > > > (define _wl_interface-pointer (_cpointer 'wl_interface)) > > This isn't perfectly satisfying, but one option i

Re: [racket] forward pointer declarations

2015-02-01 Thread Anthony Carrico
On 02/01/2015 05:57 PM, Anthony Carrico wrote: > I get a "duplicate definition" error if I declare a pointer ahead: > > (define _wl_interface-pointer (_cpointer 'wl_interface)) This isn't perfectly satisfying, but one option is to use a different name for the forward declaration: (define _wl_int