From 052c10245a523aa714489bda59e18a6c1a4f473e Mon Sep 17 00:00:00 2001 From: Ludovic Courtes Date: Mon, 31 Oct 2005 23:26:24 +0000 Subject: Installed Autoconf/Automake machinery. Fixed a few things. * src/guile/skribilo/evaluator.scm (skribe-load): Search through `%load-path' and try with a `.scm' extension (rather than the `.skr' one provided by the user). (skribe-include): Added a few debugging statements. * src/guile/skribilo/lib.scm (fix-rest-arg): Handle the dot notation for rest arguments. * src/guile/skribilo/reader/skribe.scm (%make-skribe-reader): Use SQUARE-BRACKET-FREE-SYMBOL-MISC-CHARS. * src/guile/skribilo/skribe/index.scm: Use `define-public' instead of `define'. * src/guile/skribilo/packages/*.scm: Moved to `skribilo/package'. * LICENSE: Removed. * COPYING: New. * AUTHORS: New. * NEWS: New. * ChangeLog: New. * configure.ac: New. * Makefile.am: New. In various directories. git-archimport-id: lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2--patch-10 --- src/guile/skribilo/lib.scm | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'src/guile/skribilo/lib.scm') diff --git a/src/guile/skribilo/lib.scm b/src/guile/skribilo/lib.scm index 8667f7e..d916db4 100644 --- a/src/guile/skribilo/lib.scm +++ b/src/guile/skribilo/lib.scm @@ -99,12 +99,23 @@ (let loop ((args args) (result '()) (rest-arg #f)) - (if (null? args) - (if rest-arg (append (reverse result) rest-arg) (reverse result)) - (let ((is-rest-arg? (eq? (car args) #:rest))) - (loop (if is-rest-arg? (cddr args) (cdr args)) - (if is-rest-arg? result (cons (car args) result)) - (if is-rest-arg? (list (car args) (cadr args)) rest-arg)))))) + (cond ((null? args) + (if rest-arg + (append (reverse result) rest-arg) + (reverse result))) + + ((list? args) + (let ((is-rest-arg? (eq? (car args) #:rest))) + (loop (if is-rest-arg? (cddr args) (cdr args)) + (if is-rest-arg? result (cons (car args) result)) + (if is-rest-arg? + (list (car args) (cadr args)) + rest-arg)))) + + ((pair? args) + (loop '() + (cons (car args) result) + (list #:rest (cdr args))))))) (let ((name (car bindings)) (opts (cdr bindings))) -- cgit v1.2.3