On 5/28/06, Peter Bex <[EMAIL PROTECTED]> wrote:
On Sun, May 28, 2006 at 12:31:14PM +0200, felix winkelmann wrote:
> > Adding a quote in front of the define doesn't work either as that expands
> > to (quote (define with-x #t))
>
> Try "'...'" (one pair of double-quotes for scheme, and one pair of single
> quotes for the shell).
It would be nice if you could document this in the manual.
Yes, there are a lot of things that should be mentioned there... ;-)
> As Kon replied: register-feature! is the way. But that is at run-time,
> of course.
> To have it available at compile-time (I'm not 100% sure in what way you
> want to use this), things are (as usual) a tiny little bit more complicated.
Could you elaborate on how to do it? I though cond-expand was compile-time.
I guess I was wrong :)
Anyway, what I want to do: I have a definition for a C function that only
exists if Imlib2 is compiled without X. So, if X is not found, I don't want
a binding for that function. I guess this has to be done compile time, since
the function doesn't even exist, meaning the (foreign-lambda ...) can't be
translated.
I think the best method is this: compile with or without "-feature XXX"
and then test in your code (at compile-time):
(cond-expand (XXX <code for XXX>) (else <code for not having XXX>))
cheers,
felix
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users