Changeset 3524


Ignore:
Timestamp:
08/26/03 01:36:23 (19 years ago)
Author:
piso
Message:

MULTIPLE-VALUE-BIND macro.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/boot.lisp

    r3513 r3524  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: boot.lisp,v 1.99 2003-08-25 18:00:29 piso Exp $
     4;;; $Id: boot.lisp,v 1.100 2003-08-26 01:36:23 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    387387     (format s ">")
    388388     nil))
     389
     390
     391;;; MULTIPLE-VALUE-BIND (from CLISP)
     392
     393(defmacro multiple-value-bind (varlist form &body body)
     394  (let ((g (gensym))
     395        (poplist nil))
     396    (dolist (var varlist) (setq poplist (cons `(,var (pop ,g)) poplist)))
     397    `(let* ((,g (multiple-value-list ,form)) ,@(nreverse poplist))
     398           ,@body)))
Note: See TracChangeset for help on using the changeset viewer.