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
somethingels
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
an
Hi, I'm still confused and irritated that the order of execution
in quasiquote lists are not (in my opinion) proper. I wrote about
this to this list some time ago, and got the expected answer that
the scheme standard does not specify the order.
However, there is nothing wrong still doing it acco
Han-Wen Nienhuys:
Hi, I'm still confused and irritated that the order of execution
in quasiquote lists are not (in my opinion) proper. I wrote about
this to this list some time ago, and got the expected answer that
the scheme standard does not specify the order.
However, there is nothing wrong
Jon Wilson:
Hi,
I've written a bit of code that lets you call any function from a
dynamically loaded shared lib with any args. Well, actually, since it
is just a proof of concept, it only lets you call functions that take
zero or one args. The arg (if there is one) must be of type int. The
Thien-Thi Nguyen:
greetings earthlings,
buggy optimizers? heh! we go for buggy everything!
http://www.gnuvola.org/software/guile/hjh/
to go cloud tripping you have to crouch REAL low first...
Wow, great that someone still keeps hobbit alive for guile.
When playing with it 3 years ago,
Hi,
I need (well) to inject variables into closures, and have
come up with the following macro to do so:
(define-macro (inject-variable name value)
(define env (gensym))
(define closure (gensym))
(define vars (gensym))
(define secondname (gensym))
(define secondval (gensym))
(define
On Thu, 29 Nov 2007, Kjetil S. Matheussen wrote:
Hi,
I need (well) to inject variables into closures, and have
come up with the following macro to do so:
(define-macro (inject-variable name value)
...
(cond ((null? (cdr ,env
On Thu, 29 Nov 2007, Kjetil S. Matheussen wrote:
(let ()
(display (defined? 'gakk))
(inject-variable gakk 90)
gakk)
=> #f90
By the way. I'm quite surprised the environments consist
of linked lists. Wouldn't it be much faster using hash
tables instead? Perhaps
On Thu, 29 Nov 2007, Clinton Ebadi wrote:
"Kjetil S. Matheussen" <[EMAIL PROTECTED]> writes:
Hi,
I need (well) to inject variables into closures, and have
come up with the following macro to do so:
(define-macro (inject-variable name value)
(define env (gensym))
Ludovic Court?s:
Hi,
"Kjetil S. Matheussen" <[EMAIL PROTECTED]> writes:
Now I wonder, is this safe and portable? Or are there
other and better ways to do this?
Neither `define-macro' nor `procedure->macro' is portable: both are
Guile-specific (SCM m
"Marco Maggi":
4. If a garbage collector allows to remove the need for
"scm_remember_upto_here" it must be adopted even if it
makes Guile slower and it raises memory usage a bit (or
more than a bit).
If we replace "should" with "must", I agree.
Regarding the HBGC, a few nonsc
On Tue, 4 Dec 2007, Kjetil S. Matheussen wrote:
>
> "Marco Maggi":
> >
> > 4. If a garbage collector allows to remove the need for
> > "scm_remember_upto_here" it must be adopted even if it
> > makes Guile slower and it raises memor
On Tue, 4 Dec 2007, Roland Orre wrote:
On Tue, 2007-12-04 at 19:34 +0100, Kjetil S. Matheussen wrote:
...
Oh, and another thing. My tests (available in the guile-devel archives)
also showed that the HBGC version usually use a bit less memory
than Guile's old garbage collector. (Yet an
"Marco Maggi":
3b. Death to structs! IMO they were "an attempt", but the
resulting code is awful (sorry, but can you disagree?).
Err.. but aren't structs the main part of how GOOPS is
implemented?
IMO Guile's structs do nothing that cannot be done better
with a good old C str
"Marco Maggi":
4. If a garbage collector allows to remove the need for
"scm_remember_upto_here" it must be adopted even if it
makes Guile slower and it raises memory usage a bit (or
more than a bit).
Who cares? I have written thousands and thousands of lines
of guile ext
Hi,
I'm trying to use guardians, but have a little bit of
trouble understanding how they work.
I have made a function "add-guardian-object" which
takes an object "object" and a function "cleanup-func".
"cleanup-func" is called before the object is freed.
Here is my implementation of "add-guard
Thien-Thi Nguyen:
(das-guardian (list cleanup-func object)))
Here, you add the compound object (constructed using `list'),
not just `object'. Is that what you want do, really?
Ah, of course. Thank you very much. Also for the mysteriously
quick reply. :-)
I have now changed "add-g
Ludovic Court?s:
Hi,
"Maciek Godek" <[EMAIL PROTECTED]> writes:
is there any portable and recommended way for passing C pointers around
in guile environment?
I think of something like scm_to_ptr (analogous to scm_to_int etc.).
Certainly such a value would be completely useless for the interpr
On Wed, 9 Jul 2008, Greg Troxel wrote:
> "Kjetil S. Matheussen" <[EMAIL PROTECTED]> writes:
>
> > Ludovic Court?s:
> >> Hi,
> >>
> >> "Maciek Godek" <[EMAIL PROTECTED]> writes:
> >>
> >>> is there any po
Ludovic Courtès:
> Sure, if you just do this now and then, SMOBs aren't a problem.
> But that doesn't change the fact that all the functionality SMOB
> provides is overkill when the only thing you need is to hold
> a pointer.
It's not overkill, it's exactly what you need: disjoint SMOB type,
`f
Ludovic Court?s:
"Maciek Godek" <[EMAIL PROTECTED]> writes:
I've been wondering if there's any way to recall
(or get inside) an environment of a closure (= to
directly access variables bound to a closure)
Yes, with `the-environment':
guile> ((lambda (a b) (the-environment)) 2 3)
(((a b)
On Fri, 11 Jul 2008, Kjetil S. Matheussen wrote:
>
>
> Ludovic Court?s:
> > "Maciek Godek" <[EMAIL PROTECTED]> writes:
> >
> >> I've been wondering if there's any way to recall
> >> (or get inside) an environment of a closure (=
On Fri, 11 Jul 2008, Maciek Godek wrote:
Kjetil S. Matheussen:
The function "local-eval" is probably what you want.
I use local-eval a lot, it's one of the really really
nice features provided by Guile:
(define-macro (with env . code)
`(local-eval (quote (begin ,@code)) ,
"Maciek Godek"
I don't know exactly how it works out that using a define in
local-eval falls foul of the define placement rule, but it is not hard
to imagine that it could do.
The other question is: is it really necessary to impose such
limitations on "define". Why is it required to make its p
On Mon, 14 Jul 2008, Maciek Godek wrote:
Kjetil S. Matheussen:
I think local-eval is necessary for making
a namespace system of the below type without having to use
codewalking macros to expand the bodies of functions:
(define-namespace bank)
(def-bank sum 0)
(def-bank (add n)
(set! sum
"Jose A. Ortega Ruiz":
Hi-
If you could ask someone to write a library or package a set of
functionality for Guile that it doesn't currently have, what would it
be? (My personal projects are near completion, and I may have some
Saturdays free.)
Bindings for OpenGL/GLU/GLUT would be great.
JonWilson:
It seems that snd has a significant amount of functionality that might
be generally useful. Would it be possible for the snd team to spend
some time factoring out these things? I know that snd-c and the GL
bindings have been mentioned here, but I suspect there are other things
as w
Clinton Ebadi:
As a matter of style, you probably want to avoid local-eval as it will
have to be removed whenever Guile ends up with a faster compiler (one
I've never heard this before, and I think you are way wrong.
first-class environments etc. is what makes Guile special
and it would be in
"Maciek Godek":
Subject: References/locations
To: guile-user@gnu.org
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1
Hi,
it's me again, asking silly questions.
Not at all, your questions are very good. :-)
This time I would like to know if there's
a s
"Ishan Arora":
> And is there a procedure to
> synchronously run a shell code and return the output as a String. Thanks.
>
Should do:
(use-modules (ice-9 rdelim))
(define (get-system-output command)
(let ((logfilename (tmpnam)))
(system (string-append command " > " logfilename))
(let
Sebastian Tennant:
Hi all,
An elementary scheme problem from an elementary schemer...
I need to create multiple variable bindings from a list of symbols. The
value of the variables is unimportant. It's the 'names' of the
variables that matter.
In pseudo-scheme code:
(map (lambda (v) (def
Sebastian Tennant:
Hi all,
Having read this interesting thread:
http://sourceware.org/ml/guile/1999-08/msg00118.html
I understand that internal definitions may not occur anywhere other than
at the beginning of the body of the enclosing expression, which explains
why this works:
((lambda (x)
Sebastian Tennant:
Quoth "Kjetil S. Matheussen" :
Yes, this limitation in Scheme is a horrible pest. There's no
decent reason why you shouldn't be allowed to use define other
places than right after a lambda, except the long discussion
involved how it should behave in var
Linas Vepstas:
I feel obligated to respond, having made all sorts of noise.
2009/1/15 Neil Jerram :
whether people think that scm_init_guile is really needed.
kill it. there seem to be perfectly adequate ways of
living without it. Unfortunately, the current documentation
describing how to
On Fri, 23 Jan 2009, Neil Jerram wrote:
2009/1/16 Kjetil S. Matheussen :
Snd uses scm_init_guile when compiled as a Pd external.
Pd is a graphical programming language for audio processing,
and "externals" are linked into the program during runtime.
When Snd is a Pd external, it
Mark Polesky:
;; Hi.
;;
;; How can I change the following code so that
;; it returns "2 0.25 0."? That is: return
;; integers without decimal point, otherwise
;; round to as many decimal places as needed,
;; but not more than 4.
(let ((a 2.0)
(b 1/4)
(c 1/3))
(format #t "~&~a ~a
On Sun, 22 Mar 2009, Mark Polesky wrote:
(define (my-format bool string . list-of-nums)
(apply format bool string (map set-precision list-of-nums)))
(let ((a 2.0)
(b 1/4)
(c 1/3))
(my-format #t "~&~a ~a ~a" a b c))
Kjetil,
Awesome. Thanks. I knew there was something simple
Richard Shann:
Does anyone know if there is a guile procedure to get the (text)
selection? (That is from doing Copy in another application)
Richard
Assuming you mean X selection, I've used the "xsel" program to do this:
(define-macro (include filename)
(define ret "")
(for-each-line-in-
39 matches
Mail list logo