X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=ecmalisp.lisp;h=c060ffb4ef5b8b3044362c8022669d9f680511bb;hb=d61e7afecb594002dcb449a7d07523270b0917a7;hp=51187e6310f3bb5209a5e655127edc09905207f6;hpb=d31c3cdb3813d512f682c10c64ec71ec9c8486b0;p=jscl.git diff --git a/ecmalisp.lisp b/ecmalisp.lisp index 51187e6..c060ffb 100644 --- a/ecmalisp.lisp +++ b/ecmalisp.lisp @@ -1,6 +1,6 @@ ;;; ecmalisp.lisp --- -;; Copyright (C) 2012 David Vazquez +;; Copyright (C) 2012, 2013 David Vazquez ;; Copyright (C) 2012 Raimon Grau ;; This program is free software: you can redistribute it and/or @@ -71,7 +71,7 @@ (defun null (x) (eq x nil)) - (defmacro return (value) + (defmacro return (&optional value) `(return-from nil ,value)) (defmacro while (condition &body body) @@ -393,12 +393,11 @@ t)) (defun assoc (x alist) - (let ((found nil)) - (while (and alist (not found)) - (if (eql x (caar alist)) - (setq found t) - (setq alist (cdr alist)))) - (car alist))) + (while alist + (if (eql x (caar alist)) + (return) + (setq alist (cdr alist)))) + (car alist)) (defun string= (s1 s2) (equal s1 s2)))