[Chicken-users] Furry paws...

2009-09-02 Thread Eduardo Cavazos
... is sooo frickin amazing. Is there an interactive interpreter/repl for FP somewhere? Ed ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users

Re: [Chicken-users] Furry paws...

2009-09-02 Thread Eduardo Cavazos
On Sep 2, 2009, at 10:13 PM, Eduardo Cavazos wrote: ... is sooo frickin amazing. Is there an interactive interpreter/repl for FP somewhere? Kon Lovett wrote: Doesn't fp -i enter interactive mode? Hello Kon! Hmmm... I don't have an 'fp' binary here. Just 'fpc'. Ed

[Chicken-users] SRFI-19

2009-04-14 Thread Eduardo Cavazos
Hello, I installed the SRFI-19 egg a little while ago on Chicken 3.4.0. However, it seems that basic procedures like 'current-time' aren't available: ~ # csi CHICKEN (c)2008 The Chicken Team (c)2000-2007 Felix L. Winkelmann Version 3.4.0 - linux-unix-gnu-x86 [ manyargs dload ptables

[Chicken-users] -prologue

2009-03-25 Thread Eduardo Cavazos
Hello, I just noticed that something like this: csc somefile.scm -dynamic -prologue SOME-DIRECTORY doesn't produce an error. Does it make sense to pass a directory to '-prologue'? Just wondering if maybe 'csc' should print an error in the above case. Ed

Re: [Chicken-users] define-macro in Chicken 4.0

2009-03-14 Thread Eduardo Cavazos
On Fri, Mar 13, 2009 at 8:48 PM, Eduardo Cavazos wayo.cava...@gmail.com wrote: Is there a way to define 'define-macro' in terms of the new explicit renaming macros of Chicken 4.0? Or is it offered somewhere and I just missed it? I know I know... 'define-macro' is bad. :-) But I have a bunch

[Chicken-users] define-macro in Chicken 4.0

2009-03-13 Thread Eduardo Cavazos
Hello, Is there a way to define 'define-macro' in terms of the new explicit renaming macros of Chicken 4.0? Or is it offered somewhere and I just missed it? I know I know... 'define-macro' is bad. :-) But I have a bunch of code that I'd like to have just work in Chicken 4.0 and worry about

[Chicken-users] cons-wm

2009-03-13 Thread Eduardo Cavazos
Hello, cons-wm is a window manager for the X Window System. Features: * Written in Scheme * Runs in Ypsilon, Larceny, and Chicken * Minimalist * Internals based on dwm 5.4.1 cons-wm aims to be a simple window manager which can serve as a starting point and example for aspiring window manager

[Chicken-users] FFI with XQueryTree

2009-03-12 Thread Eduardo Cavazos
Hello, XQueryTree is a function from xlib: extern Status XQueryTree( Display*/* display */, Window/* w */, Window*/* root_return */, Window*/* parent_return */, Window**/* children_return */, unsigned int*/* nchildren_return */

[Chicken-users] pointer-pointer-ref

2009-03-12 Thread Eduardo Cavazos
Eduardo Cavazos wrote: XQueryTree is a function from xlib: extern Status XQueryTree( Display*/* display */, Window/* w */, Window*/* root_return */, Window*/* parent_return */, Window**/* children_return */, unsigned int

Re: [Chicken-users] pointer-pointer-ref

2009-03-12 Thread Eduardo Cavazos
Nicholas Indy Ray wrote: Something simular to you're pointer-pointer-ref is what I was using. and semantically it seems to be best. Indy It's a good sign that you settled on a similar solution. Thanks Indy! ___ Chicken-users mailing list

[Chicken-users] Re: FFI with XQueryTree

2009-03-12 Thread Eduardo Cavazos
Eduardo Cavazos wrote: XQueryTree is a function from xlib: extern Status XQueryTree( Display*/* display */, Window/* w */, Window*/* root_return */, Window*/* parent_return */, Window**/* children_return */, unsigned int

Re: [Chicken-users] setting a callback in xlib

2009-03-07 Thread Eduardo Cavazos
Eduardo Cavazos wayo.cava...@gmail.com wrote: Here's how I'm defining 'XSetErrorHandler' on the Chicken side: (define XSetErrorHandler (foreign-safe-lambda c-pointer XSetErrorHandler (function int (c-pointer c-pointer And finally, a test error handler: (define-external

Re: [Chicken-users] setting a callback in xlib

2009-03-07 Thread Eduardo Cavazos
Eduardo Cavazos wayo.cava...@gmail.com wrote: In this particular case, like this: (XSetErrorHandler xerrorhandler) felix winkelmann wrote: If you say (XSetErrorHandler (location xerrorhandler)) does it work, then? If I install it that way, when I trigger an error this appears

[Chicken-users] setting a callback in xlib

2009-03-06 Thread Eduardo Cavazos
Hello, Xlib has a function 'XSetErrorHandler'. You pass a callback to it to specify the new error handler. Here's the relevant code from 'Xlib.h': -- typedef int (*XErrorHandler) ( Display*/* display */,

Re: [Chicken-users] Passing blobs to glGetDoublev in (hacked) OpenGL egg

2009-02-24 Thread Eduardo Cavazos
Eduardo Cavazos wrote: What could I change that to such that blobs are allowed as the second argument? Jim Ursetto wrote: void glGetDoublev( GLenum pname, ___byte_vector params ); (The egg should probably be updated to replace or alias ___blob to ___byte_vector...) Note: you

[Chicken-users] extreme kludge: load that compiles

2009-02-18 Thread Eduardo Cavazos
Hello, Even after R6RS, 'load' is all one can really count on. :-) Below is a hacked version of load that I'm using for Chicken. If an '.so' file doesn't exist for the file your loading, the file is compiled and one is generated. If it does exist but it's out of date, your file is

[Chicken-users] bytevectors

2009-02-17 Thread Eduardo Cavazos
Hello, I'm working on code which uses these procedures: make-bytevector bytevector-length bytevector-ieee-double-native-ref bytevector-ieee-double-native-set! Thankfully, Larceny, Ikarus, and Ypsilon all support these. I'd like to have the code work in Chicken. Is there any

[Chicken-users] Re: bytevectors

2009-02-17 Thread Eduardo Cavazos
Eduardo Cavazos wrote: So... do you think chicken can support the bytevectors api? :-) Hmmm... After poking around some, I see that I can probably cook up a compatability layer. Something along these lines: -- (use srfi-4

[Chicken-users] efficient bytevector-ieee-double-native-ref

2009-02-17 Thread Eduardo Cavazos
Eduardo Cavazos wrote: (define (bytevector-ieee-double-native-ref blob i) (f64vector-ref (blob-f64vector/shared blob) i)) So the obvious problem here is the conversion is going to impact performance. If somebody who is familiar with Chicken internals can suggest a way to extract an 'f64

[Chicken-users] Re: efficient bytevector-ieee-double-native-ref

2009-02-17 Thread Eduardo Cavazos
Eduardo Cavazos wrote: If somebody who is familiar with Chicken internals can suggest a way to extract an 'f64' element from a blob directly, I think I'll be set. :-) Aha... (let ((i 0)) (pointer-f64-ref (pointer-offset (object-pointer blob) (* i 8 Ed

[Chicken-users] Re: bytevectors

2009-02-17 Thread Eduardo Cavazos
Eduardo Cavazos wrote: Hmmm... After poking around some, I see that I can probably cook up a compatability layer. Something along these lines: This is what I ended up using. I loaded into Chicken and it's handling some R6RS code of mine. These procedures are in tight loops. Chicken

Re: [Chicken-users] Re: bytevectors

2009-02-17 Thread Eduardo Cavazos
Eduardo Cavazos wrote: -- (use srfi-4) (define (make-bytevector n) (u8vector-blob/shared (make-u8vector n))) (define bytevector-length blob-size) (define (bytevector-ieee-double-native-ref bv i) (f64vector-ref (blob

[Chicken-users] memory usage of object

2007-06-20 Thread Eduardo Cavazos
Hello, Is there a way to get the memory usage of a datum? (memory-usage abcdefg) or (memory-usage (lambda (n) (+ n 1))) etc. Ed ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users

Re: [Chicken-users] Is there another way to return data from a C function?

2007-06-17 Thread Eduardo Cavazos
Felix wrote: On 6/12/07, Eduardo Cavazos [EMAIL PROTECTED] wrote: That only works with the compiler (csc). Is there a way to box/unbox data in the interpreter so I can call xquerypointer from csi? Just curious as it's easier to experiment via csi instead of recompiling my file each time

[Chicken-users] Is there another way to return data from a C function?

2007-06-12 Thread Eduardo Cavazos
Hey! I'm new to the Chicken FFI... The xlib function XQueryPointer accepts a few pointers to indicate where to return the data. I read about locations in the manual and have successfully called used xquerypointer like this: (let-location ((root-return unsigned-long)