[racket] Scriblogify Error -- I'm baaack!

2012-10-26 Thread Patrick King
When last I wrote on my problems with Scriblogify, I attributed them to Windows 7 security... I was way too optimistic, and way too ashamed to bother the community again. I have found a couple smoking guns since then, and found that they, too, had nothing to do with my problem. The following is rep

Re: [racket] [FFI] _union and define-cstruct

2012-10-26 Thread Jon Rafkind
Actually I think I know why it is like the way it is now.. To get an X11 event you pass in an XEvent* to XNextEvent which copies the event to the input pointer. Essentially void XNextEvent(XEvent * input){ switch (event_type){ case Keyboard: { XKeyboardEvent real_event; mem

Re: [racket] [FFI] _union and define-cstruct

2012-10-26 Thread Jon Rafkind
I agree with this. The code Laurent is talking about is my x11 ffi bindings. Laurent, feel free to make this change and push to the repo. I'm not sure why I didn't use the super struct thing to begin with, maybe it didn't exist when I initially wrote the bindings. https://github.com/kazzmir/x11

Re: [racket] [FFI] _union and define-cstruct

2012-10-26 Thread Matthew Flatt
That seems like an ok solution. I would be tempted to write (define-cstruct _XEvent ([type _int])) (define-cstruct (_XAnyEvent _XEvent) ([serial _ulong] )) (define-cstruct (_XKeyEvent _XEvent) ([serial _ulong] .

Re: [racket] Web-Server: Continue Tutorial, Templates and Dispatch

2012-10-26 Thread Helmut Dobretzberger
>"JM" == Jay McCarthy writes: JM> You probably shouldn't use the 'plt-web-server' cmdline program for serious sites. Oh, okay. "plt-web-server" was easy usable for executing the examples in the default-web-root, so I thought it is reasonable for my own servlets too, because iI didn't reali

Re: [racket] [FFI] _union and define-cstruct

2012-10-26 Thread Laurent
Oooohh, I think I understand now: the way it was is already sufficiently general. The writer of the initial code took a different direction. Instead of defining a union type, he changes the tag of the pointer depending on what kind of type he needs in the union: (cpointer-push-tag! e XAnyEvent-tag)

[racket] [FFI] _union and define-cstruct

2012-10-26 Thread Laurent
Hi, I am trying to convert an FFI cstruct definition into a union. More exactly, the previous definition was : (define-cstruct _XEvent ((type EventType))) with EventType being defined elsewhere. But this was an incomplete definition, and I now want to translate the following C union: typedef