Re: Problem with define-macro from compiled file (Guile 1.9)

2011-01-07 Thread Hans Aberg

On 6 Jan 2011, at 19:18, Patrick Bernaud wrote:


I have a case where a macro is defined in a file that is then loaded
by another which makes use of the macro. And it produces a 'wrong type
to apply' error from the VM.

(Works fine with GUILE_AUTO_COMPILE=0 and compiled files removed).

For example, with the 'when' macro from the manual:

-%< when.scm %<-
(define-macro (when cond exp . rest)
`(if ,cond
 (begin ,exp . ,rest)))
-%< when.scm %<-

-%< test.scm %<-
(load "when.scm")
(when #t (display "Launching missiles!\n"))
-%< test.scm %<-


If you are writing your own macro, I find 'define-syntax' easier:

(use-syntax (ice-9 syncase))

(define-syntax when
 (syntax-rules ()
   ((when cond x ...)
 (if cond (begin x ...)))
))

(when #t (display "Launching missiles!\n"))





Re: How to unquote arbitrary length elements in a backquote

2011-01-07 Thread Ludovic Courtès
Hi,

Rock  writes:

> Given that Guile hasn't adopted R6RS style quasiquotation yet

Would you like to submit a patch?  That would be greatly appreciated.

Otherwise can you report the bug in the tracker at
?

Thanks,
Ludo’.




Re: Problem with define-macro from compiled file (Guile 1.9)

2011-01-07 Thread Andreas Rottmann
Hans Aberg  writes:

> On 6 Jan 2011, at 19:18, Patrick Bernaud wrote:
>
>> I have a case where a macro is defined in a file that is then loaded
>> by another which makes use of the macro. And it produces a 'wrong type
>> to apply' error from the VM.
>>
>> (Works fine with GUILE_AUTO_COMPILE=0 and compiled files removed).
>>
>> For example, with the 'when' macro from the manual:
>>
>> -%< when.scm %<-
>> (define-macro (when cond exp . rest)
>> `(if ,cond
>>  (begin ,exp . ,rest)))
>> -%< when.scm %<-
>>
>> -%< test.scm %<-
>> (load "when.scm")
>> (when #t (display "Launching missiles!\n"))
>> -%< test.scm %<-
>
> If you are writing your own macro, I find 'define-syntax' easier:
>
> [...]

It's not only easier, it also not inherently broken (as `define-macro'
is).  See  for a discussion
of the hygiene issue.

For example, the following invocation of `when' will break when
implemented with `define-macro' as above:

(let ((begin #f))
  (when #t
(display "Launching missiles!\n")))

Regards, Rotty
-- 
Andreas Rottmann -- 



Problems building GNU Greg testing framework

2011-01-07 Thread romel
Hello,

I'm trying to build GNU Greg 1.4 in order to build Guile DBI but when I
run ./configure something goes wrong.

$ ./configure --prefix $HOME/opt/
loading cache ./config.cache
checking host system type... Invalid configuration
`x86_64-unknown-linux-gnu': machine `x86_64-unknown' not recognized

checking target system type... Invalid configuration
`x86_64-unknown-linux-gnu': machine `x86_64-unknown' not recognized

checking build system type... Invalid configuration
`x86_64-unknown-linux-gnu': machine `x86_64-unknown' not recognized

checking for gcc... (cached) gcc
checking whether the C compiler (gcc  -I/home/romel/opt/include
-I/home/romel/opt/include/guile/2.0 -L/home/romel/opt/lib) works... yes
checking whether the C compiler (gcc  -I/home/romel/opt/include
-I/home/romel/opt/include/guile/2.0 -L/home/romel/opt/lib) is a
cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking how to run the C preprocessor... (cached) gcc -E
checking for ranlib... (cached) ranlib
checking for ld used by GCC... (cached) /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... (cached) yes
checking for BSD-compatible nm... (cached) /usr/bin/nm -B
checking command to parse /usr/bin/nm -B output... (cached) yes
checking for _ prefix in compiled symbols... (cached) no
checking whether ln -s works... (cached) yes
ltconfig: you must specify a host type if you use `--no-verify'
Try `ltconfig --help' for more information.
configure: error: libtool configure failed

I'm using guile 1.9.14 builded in ~/opt and I have set the following
environment variables:

export LDFLAGS="-L$HOME/opt/lib"
export CPPFLAGS="-I$HOME/opt/include -I$HOME/opt/include/guile/2.0"
export PKG_CONFIG_PATH="$HOME/opt/lib/pkgconfig"
export LD_LIBRARY_PATH="$HOME/opt/lib/"
export PATH="$HOME/opt/bin:$PATH"

I'm running Trisquel 4 taranis in an AMD 64 machine.

Anybody can bring some light to this issue?

Thanks in advance.

Regards,

Romel Sandoval