This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: guiledraw (was: problem with compiled module)


On Apr 14, Lars Arvestad decided to present us with:
> 
> I have also started on libplot bindings, but my work is so incomplete
> and buggy that I didn't want to make an announcement just yet. I have
> now made my code available as
> http://www.nada.kth.se/~arve/drawing.tar.gz for those
> interested. Perhaps we can make a joint effort?  Unfortunately, the
> main reason I have not completed the coding (I haven't even started
> thinking about putting it in a module) is that I have more urgent
> things on my mind (such as finishing my degree...) so I will not be
> able to code other than on unusual occasions.

As you see, I'm currently working on the module interface and
setup functions, so our work should get together like clockwork.
If you "have something but not a module" I assume what you have
are wrappers for libplot functions, and this is exactly what I
don't have, so, cool :-)

> I looked at your code, though, and one thing caught my eye: 
>     SCM_NEWCELL (plotter);
>     SCM_SETCAR (plotter, smob_plotter);
>     SCM_SETCAR (plotter, handle);
> 
> I believe it is supposed to be SCM_SETCDR in the last line!

Ooops. Copy-and-paste-and-forget-to-fix again!

> Also, is it necessary to put the plotter handle in an smob? The handle 
> is only an integer, which can safely be passed to SCM, and since the
> actual plotter structures are kept by libplot in a global array, they
> should not need further protection, right? I am rusty on the GC issue, 
> so please correct me if I am wrong!

I put it on a smob because:

1: I want to have a "(plotter? pl)" function

2: The handle is currently just an integer, but this might not
be true in the future. Actually, I'm talking to the libplot
maintainer and it looks like it would be better to base the
Guile binding on the C++ binding, because it's more thread-safe
(no global variables) and more "schemely" [you do
`myplotter->label("string")' for example, which would translate
to (draw-label myplotter "string") or something]. The C++
binding does not use a handle, but a C++ object. I'm only
waiting for his reply on where can I fetch the C++ binding to
make a decision.

[]s,
                                               |alo
                                               +----
--
      I am Lalo of deB-org. You will be freed.
                 Resistance is futile.

http://www.webcom.com/lalo      mailto:lalo@webcom.com
                 pgp key in the web page

Debian GNU/Linux       --        http://www.debian.org