chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] egg path?


From: Shawn Rutledge
Subject: Re: [Chicken-users] egg path?
Date: Thu, 16 Apr 2009 11:09:59 -0700

On Thu, Apr 16, 2009 at 2:15 AM, felix winkelmann <address@hidden> wrote:
> On Thu, Apr 16, 2009 at 9:40 AM, Shawn Rutledge
> <address@hidden> wrote:
>> With Chicken 3, (use egg) can load a compiled egg.so in the cwd.  This
>> is especially handy during egg development - you can compile and test
>> repeatedly without having to install.  Chicken 4 doesn't seem to do
>> that.  Is there some concept of an egg path, where it will look for
>> the library?
>
> `use' also does an `import', so you probably should use `require-library'
> or `require', unless your compiled file also contains a module definition.
> Loading from the cwd should still work. See also `repository-path' in the
> manual.

You're right, it's the import in that case.  As part of the egg
porting I should switch to the module system anyway, I guess, since
this egg has a dbus: prefix on everything.  Currently it has (declare
(export ...))  And then (use dbus) will work, right?

#;1> (use dbus)

Error: (import) during expansion of (import ...) - cannot import from
undefined module: dbus

        Call history:

        <syntax>                (use dbus)
        <syntax>                (##core#require-extension (dbus) #t)
        <syntax>                (begin (begin (##sys#require (quote
dbus)) (import dbus)) (##core#undefined))
        <syntax>                (begin (##sys#require (quote dbus))
(import dbus))
        <syntax>                (##sys#require (quote dbus))
        <syntax>                (quote dbus)
        <syntax>                (import dbus)   <--

#;1> (require "dbus")
; loading ./dbus.so ...

Error: unbound variable: dbus:vtable

        Call history:

        <eval>          (require "dbus")
        ##sys#peek-c-string
        dbus.scm: 78   max
        dbus.scm: 164  make-vector
        dbus.scm: 165  make-vector
        dbus.scm: 166  make-vector
        dbus.scm: 175  gensym
        dbus.scm: 573  dbus:vtable                      <--

#;1> (require-library "dbus")

Error: invalid extension specifier: "dbus"

        Call history:

        <syntax>                (require-library "dbus")
        <syntax>                (##core#require-extension ("dbus") #f)  <--
#;1> (require-library dbus)
; loading ./dbus.so ...
Segmentation fault

(the segfault doesn't occur if I try it from a fresh csi instance though)

dbus:vtable is like this:

        (define-foreign-record (dbus:vtable "struct DBusObjectPathVTable")
                (constructor: dbus:make-vtable-impl)
                (destructor: dbus:free-vtable)
                (c-pointer unregister_function)
                (c-pointer message_function)
                (c-pointer dbus_internal_pad1)
                (c-pointer dbus_internal_pad2)
                (c-pointer dbus_internal_pad3)
                (c-pointer dbus_internal_pad4))

BTW apparently I still have to ask for my egg dirs to be created in
svn under release/4?  If so, please create the ones for dbus and gps.




reply via email to

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