chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Foreign pointers in chicken4


From: Alexey Bakhirkin
Subject: Re: [Chicken-users] Foreign pointers in chicken4
Date: Thu, 4 Jun 2009 18:43:39 +0400

2009/6/3 Kon Lovett <address@hidden>:
>
> On Jun 3, 2009, at 1:29 AM, Alexey Bakhirkin wrote:
>
>> I started porting cairo egg from chicken3 to chicken4 and encountered
>> the following:
>> Consider a pointe defned in the egg as follows (you can find the egg
>> I'm working on here: http://bitbucket.org/mr_cat/cairo-chicken4/):
>>
>> (define-foreign-type cairo_t (pointer "cairo_t")
>>   values
>>   (cut tag-pointer <> 'cairo))
>>
>> I found out, that the code which uses this egg fails with
>> "unbound-variable: tag-pointer" unless it also imports lolevel
>> explicitly.
>> Is it a bug or a feature? Or maybe I am doing something wrong?
>
> None of the above. 'tag-pointer' is just defined in Unit lolevel so must be
> imported.
>
> The Chicken 3 'cairo' egg did a '(require 'lolevel)' for the same reason.
>

I'm talking not about the egg itself, but about the code which uses the egg.

My cairo egg defines a module:

(module cairo *
 (import chicken scheme lolevel foreign foreigners)

;...skip...
(define-foreign-type cairo_t (pointer "cairo_t")
   values
   (cut tag-pointer <> 'cairo))
;...skip...
)

Then in a separate program I load it:

(require-extension cairo)

And when in this separate program I'm trying to call a function
returnung a pointer of this type (i.e. cairo-create) I get an error,
telling me, that tag-pointer is not defined, unless in this program I
also load lolevel:

(require-extension lolevel).

Is that ok?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]