[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] riaxpander bug(?) with #!optional
From: |
Peter Wright |
Subject: |
[Chicken-users] riaxpander bug(?) with #!optional |
Date: |
Mon, 16 Jun 2008 22:06:29 +0800 |
User-agent: |
Mutt/1.5.17+20080114 (2008-01-14) |
After recently rereading Alex's informative post on Chicken macro
systems a month or so ago, I was trying out riaxpander as a
replacement for syntactic-closures, but have just run into some rather
odd behaviour.
System: Linux, Chicken 3.2.0 (SVN rev. 10664),
riaxpander Version: 0.8.1 (Release 200804042118).
; ------- wtf.scm -------
(use riaxpander)
(define (wtf x #!optional (y "Bob"))
(printf "Hello ~A! How is ~A?~%" x y))
(wtf "Jim")
; ------- wtf.scm -------
...but when I try to compile, I get:
$ csc wtf.scm -o wtf
Error: (cadr) bad argument type: "too many optional arguments"
Call history:
<syntax> (if (null? (cdr tmp#3)) (car tmp#3) (if #t
(##core#check (##sys#error (##core#immutable "too many op...
<syntax> (null? (cdr tmp#3))
<syntax> (cdr tmp#3)
<syntax> (car tmp#3)
<syntax> (if #t (##core#check (##sys#error
(##core#immutable "too many optional arguments") tmp#3)))
<syntax> (##core#check (##sys#error (##core#immutable
"too many optional arguments") tmp#3))
<syntax> (##sys#error (##core#immutable "too many
optional arguments") tmp#3)
<syntax> (##core#immutable "too many optional
arguments") <--
*** Shell command terminated with exit status 1: /usr/local/bin/chicken wtf.scm
-output-file wtf.c -quiet
Remove the "(use riaxpander)" (or replace it with syntactic-closures)
and all seems well.
A riaxpander bug, or have I misunderstood something?
Any suggestions appreciated, thanks.
Pete.
--
"I contend we are both atheists, I just believe in one fewer god than
you do. When you understand why you dismiss all the other possible
gods, you will understand why I dismiss yours." -- Stephen F Roberts
- [Chicken-users] riaxpander bug(?) with #!optional,
Peter Wright <=