Re: FFI nuisance

2011-03-02 Thread Ludovic Courtès
Hi,

Aidan Gauland  writes:

> I'm trying to use SDL through Guile's dynamic FFI.  There's a slight
> nuisance with the procedure `dynamic-link': the name of the so file on
> my system (Debian squeeze) is `libSDL-1.2.so.0'

Isn’t it a packaging bug?  There should be a
‘libSDL-1.2.so’ -> ‘libSDL-1.2.so.0’ symlink.

Thanks,
Ludo’.




Re: FFI nuisance

2011-03-02 Thread Andreas Rottmann
l...@gnu.org (Ludovic Courtès) writes:

> Hi,
>
> Aidan Gauland  writes:
>
>> I'm trying to use SDL through Guile's dynamic FFI.  There's a slight
>> nuisance with the procedure `dynamic-link': the name of the so file on
>> my system (Debian squeeze) is `libSDL-1.2.so.0'
>
> Isn’t it a packaging bug?  There should be a
> ‘libSDL-1.2.so’ -> ‘libSDL-1.2.so.0’ symlink.
>
Only in the -dev package, which should not be required for running Guile
programs that excercise the FFI.  It is also good practice to use the
entire SONAME of the library in the Guile program, as to avoid random
breakage when the ABI changes (which does imply a SONAME bump on
sanely-maintained libraries).

Regards, Rotty
-- 
Andreas Rottmann -- 



How can I tell guile to shut up? ;)

2011-03-02 Thread Juhani Viheräkoski
It seems there is no option to disable these annoying messages in guile
2.0. I do scripts using guile and I would appreciate not getting these
messages that interfere with other output. It is possible to use
2>/dev/null but what would I do if my script would output error messages
(as it will probably do at some point)? I don't want to do precompilation
when scripting.

My suggestion is to add option --quiet to guile.

$ ./test-script
;;; note: source file /home/misty/moonshine/yarg/scripts/./race
;;;   newer than compiled
/home/misty/.cache/guile/ccache/2.0-LE-4-2.0/home/misty/moonshine/yarg/scripts/test-script.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;   or pass the --no-auto-compile argument to disable.
;;; compiling /home/misty/moonshine/yarg/scripts/./test-script
;;; compiled
/home/misty/.cache/guile/ccache/2.0-LE-4-2.0/home/misty/moonshine/yarg/scripts/test-script.go


Best Regards,
-- 
Juhani Viheräkoski





Re: FFI nuisance

2011-03-02 Thread Ludovic Courtès
Hi,

Andreas Rottmann  writes:

> l...@gnu.org (Ludovic Courtès) writes:
>>
>> Aidan Gauland  writes:
>>
>>> I'm trying to use SDL through Guile's dynamic FFI.  There's a slight
>>> nuisance with the procedure `dynamic-link': the name of the so file on
>>> my system (Debian squeeze) is `libSDL-1.2.so.0'
>>
>> Isn’t it a packaging bug?  There should be a
>> ‘libSDL-1.2.so’ -> ‘libSDL-1.2.so.0’ symlink.
>>
> Only in the -dev package, which should not be required for running Guile
> programs that excercise the FFI.  It is also good practice to use the
> entire SONAME of the library in the Guile program, as to avoid random
> breakage when the ABI changes (which does imply a SONAME bump on
> sanely-maintained libraries).

Unfortunately, I think this cannot be done portably, because the mapping
of a library’s set of supported interfaces to the SONAME and file name
is system-dependent, at least when using Libtool.

Thanks,
Ludo’.



Re: FFI nuisance

2011-03-02 Thread Aidan Gauland
On Wed, Mar 02, 2011 at 03:49:22PM +0100, Andreas Rottmann wrote:
> l...@gnu.org (Ludovic Courtès) writes:
> 
> > Hi,
> >
> > Aidan Gauland  writes:
> >
> >> I'm trying to use SDL through Guile's dynamic FFI.  There's a slight
> >> nuisance with the procedure `dynamic-link': the name of the so file on
> >> my system (Debian squeeze) is `libSDL-1.2.so.0'
> >
> > Isn’t it a packaging bug?  There should be a
> > ‘libSDL-1.2.so’ -> ‘libSDL-1.2.so.0’ symlink.
> >
> Only in the -dev package, which should not be required for running Guile
> programs that excercise the FFI.  It is also good practice to use the
> entire SONAME of the library in the Guile program, as to avoid random
> breakage when the ABI changes (which does imply a SONAME bump on
> sanely-maintained libraries).

When I try to use the entire soname of the library, I get an error.
(`libSDL-1.2.so.0' is actually a link to the regular file
`libSDL-1.2.so.0.11.3'.)  What am I doing wrong?

Example session:
GNU Guile 2.0.0
Copyright (C) 1995-2011 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> (define sdl (dynamic-link "libSDL-1.2.so.0.11.3"))
ERROR: In procedure dynamic-link:
ERROR: In procedure dynamic-link: file: "libSDL-1.2.so.0.11.3", message: "file 
not found"

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]> ,bt
In current input:
  1:0  1 (#:1:0 ()>)
In unknown file:
   0 (dynamic-link "libSDL-1.2.so.0.11.3")
scheme@(guile-user) [1]> ,q
scheme@(guile-user)> ,q

By the way, there is a symlink libSDL.so -> libSDL-1.2.so.11.3, so
there is no packaging bug.  Now I'm trying to figure out how to do as
Andreas says and use the entire soname of the library.

--Aidan


signature.asc
Description: Digital signature


[r6rs] with-syntax should have a body like let

2011-03-02 Thread Marco Maggi
The following program:

#!r6rs
(import (rnrs))
(with-syntax ((a 1))
  (define b 1)
  (write 2))

fails with:

;;; note: source file /home/marco/var/tmp/proof.sps
;;;   newer than compiled 
/home/marco/.cache/guile/ccache/2.0-LE-4-2.0/home/marco/var/tmp/proof.sps.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;   or pass the --no-auto-compile argument to disable.
;;; compiling /home/marco/var/tmp/proof.sps
;;; WARNING: compilation of /home/marco/var/tmp/proof.sps failed:
;;; key syntax-error, throw_args (#f "definition in expression context" #f 1 b)
module/ice-9/psyntax.scm:896:30: In procedure dobody:
module/ice-9/psyntax.scm:896:30: Syntax error:
unknown location: definition in expression context in subform b of 1

but it is my understanding  that WITH-SYNTAX has a body like
let.
-- 
Marco Maggi



Re: FFI nuisance

2011-03-02 Thread Andreas Rottmann
Aidan Gauland  writes:

> On Wed, Mar 02, 2011 at 03:49:22PM +0100, Andreas Rottmann wrote:
>> l...@gnu.org (Ludovic Courtès) writes:
>> 
>> > Hi,
>> >
>> > Aidan Gauland  writes:
>> >
>> >> I'm trying to use SDL through Guile's dynamic FFI.  There's a slight
>> >> nuisance with the procedure `dynamic-link': the name of the so file on
>> >> my system (Debian squeeze) is `libSDL-1.2.so.0'
>> >
>> > Isn’t it a packaging bug?  There should be a
>> > ‘libSDL-1.2.so’ -> ‘libSDL-1.2.so.0’ symlink.
>> >
>> Only in the -dev package, which should not be required for running Guile
>> programs that excercise the FFI.  It is also good practice to use the
>> entire SONAME of the library in the Guile program, as to avoid random
>> breakage when the ABI changes (which does imply a SONAME bump on
>> sanely-maintained libraries).
>
> When I try to use the entire soname of the library, I get an error.
> (`libSDL-1.2.so.0' is actually a link to the regular file
> `libSDL-1.2.so.0.11.3'.)  What am I doing wrong?
>
You are doing nothing wrong, that seems to be a limitation of Guile.  I
just wrote a mail regarding that to guile-devel, unfortunatly it doesn't
show up in the mail archive yet; check
 in
a few hours -- it should be there then.

Regards, Rotty
-- 
Andreas Rottmann --