Re: C structures

2006-01-04 Thread Kjetil S. Matheussen


Leonardo Lopes Pereira:


I would like to know if is there any way to convert C structs to any type of 
Guile data.



SND has some neat features for doing that:
http://ccrma.stanford.edu/software/snd/

Example:

(load-from-path "eval-c.scm")
#

(define-ec-struct 
   data
   datas
   somethingelse)
#

(define test ( #:data 1
 #:datas '(2 3 4)))
#

(-> test data)
1

(-> test data 5)
#

(-> test data)
5

(-> test datas)
(2 3 4)

(-> test datas '(9 2 3 4))
#

(-> test datas)
(9 2 3 4)

I think there are direct support for chars, floats, ints, floats, doubles, 
strings and SCMs. Everything else is treated as pointers.




--


___
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


Re: JIT compiler

2006-01-04 Thread Kjetil S. Matheussen


Neil Jerram:


Leonardo Lopes Pereira <[EMAIL PROTECTED]> writes:


I would like to know if there is any Just-in-time compiler related
resourse on Guile.


There is guile-hobbit, which is a normal compiler, but I'm not sure if
it is working with all features of current Guile.  I'm not aware of
any JIT compiler work, or if guile-hobbit can be used in a JIT way.



Hobbit works fine with guile 1.6. However, it has some bugs which
needs workarounds. Look at the file hobbit.scm in the SND distribution to
get a convenient interface for it and to automatically workaround the 
bugs.



--


___
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user