Re: [racket-users] FFI | Unions

2016-04-04 Thread Pedro Caldeira
> No. Racket's evaluation model doesn't include the notion of an > allocation stack that is associated with a continuation. > > You could implement some form of stack manually, but heap allocation > (especially as managed by the GC) is usually the way to go. I see, so Racket only stores a

Re: [racket-users] FFI | Unions

2016-04-04 Thread Matthew Flatt
At Sat, 2 Apr 2016 12:18:45 -0700 (PDT), Pedro Caldeira wrote: > The way you've proposed allocates the union on the heap, is it > possible to declare an union on the stack? No. Racket's evaluation model doesn't include the notion of an allocation stack that is associated with a continuation. You

Re: [racket-users] FFI | Unions

2016-04-02 Thread Pedro Caldeira
On Friday, 1 April 2016 00:11:30 UTC+2, Matthew Flatt wrote: > At Thu, 31 Mar 2016 15:00:35 -0700 (PDT), Pedro Caldeira wrote: > > Hello everyone, > > > > I am trying to use a set of bindings to SDL2 and I am at loss on how to use > > C > > unions. > > > > If I understood correctly both

Re: [racket-users] FFI | Unions

2016-03-31 Thread Matthew Flatt
At Thu, 31 Mar 2016 15:00:35 -0700 (PDT), Pedro Caldeira wrote: > Hello everyone, > > I am trying to use a set of bindings to SDL2 and I am at loss on how to use C > unions. > > If I understood correctly both make-union-type and _union procedures create a > new ctype; but how do you actually

[racket-users] FFI | Unions

2016-03-31 Thread Pedro Caldeira
Hello everyone, I am trying to use a set of bindings to SDL2 and I am at loss on how to use C unions. If I understood correctly both make-union-type and _union procedures create a new ctype; but how do you actually create instances of these unions? Thank you for your attention. -- You