summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--module/language/elisp/runtime.scm7
-rw-r--r--module/language/elisp/runtime/macro-slot.scm45
2 files changed, 28 insertions, 24 deletions
diff --git a/module/language/elisp/runtime.scm b/module/language/elisp/runtime.scm
index cb562c34b..0d783b6fa 100644
--- a/module/language/elisp/runtime.scm
+++ b/module/language/elisp/runtime.scm
@@ -1,6 +1,6 @@
;;; Guile Emacs Lisp
-;;; Copyright (C) 2009 Free Software Foundation, Inc.
+;;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
;;;
;;; This library is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU Lesser General Public
@@ -39,10 +39,9 @@
(define void (list 42))
-; Values for t and nil.
+; Values for t and nil. (FIXME remove this abstraction)
-; FIXME: Use real nil.
-(define nil-value #f)
+(define nil-value #nil)
(define t-value #t)
diff --git a/module/language/elisp/runtime/macro-slot.scm b/module/language/elisp/runtime/macro-slot.scm
index 11ab59b8c..e28fa31ce 100644
--- a/module/language/elisp/runtime/macro-slot.scm
+++ b/module/language/elisp/runtime/macro-slot.scm
@@ -1,6 +1,6 @@
;;; Guile Emacs Lisp
-;;; Copyright (C) 2009 Free Software Foundation, Inc.
+;;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
;;;
;;; This library is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU Lesser General Public
@@ -84,27 +84,32 @@
; The and and or forms can also be easily defined with macros.
(built-in-macro and
- (lambda (. args)
- (if (null? args)
- 't
- (let iterate ((tail args))
- (if (null? (cdr tail))
- (car tail)
- `(if ,(car tail)
- ,(iterate (cdr tail))
- nil))))))
+ (case-lambda
+ (() 't)
+ ((x) x)
+ ((x . args)
+ (let iterate ((x x) (tail args))
+ (if (null? tail)
+ x
+ `(if ,x
+ ,(iterate (car tail) (cdr tail))
+ nil))))))
(built-in-macro or
- (lambda (. args)
- (let iterate ((tail args))
- (if (null? tail)
- 'nil
- (let ((var (gensym)))
- `(without-void-checks (,var)
- (lexical-let ((,var ,(car tail)))
- (if ,var
- ,var
- ,(iterate (cdr tail))))))))))
+ (case-lambda
+ (() 'nil)
+ ((x) x)
+ ((x . args)
+ (let iterate ((x x) (tail args))
+ (if (null? tail)
+ x
+ (let ((var (gensym)))
+ `(without-void-checks
+ (,var)
+ (lexical-let ((,var ,x))
+ (if ,var
+ ,var
+ ,(iterate (car tail) (cdr tail)))))))))))
; Define the dotimes and dolist iteration macros.