[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

another mvbind problem?



>>>>> "Paul" == pg  <pg@das.harvard.edu> writes:

Paul> I'm using Clisp of 1995-06-23 (June 1995) with the new patch to
Paul> fix the recent mvbind bug, and there seems to be another kind of
Paul> problem with mvbind

I assumed you actually meant to return `x' and not `y'
(for which the results you report appear to be correct).

That is:

(defun foo ()
  (multiple-value-bind (x y)  (cdr '(a b)) 
    x))

and not 

(defun foo ()
  (multiple-value-bind (x y)  (cdr '(a b)) 
    y))

In any case, the first case didn't work.  If I missed
your point, please clarify.

The diffs below and a copy of the fixed `compiler.lsp'
are available at:

  http://sayre.sysc.pdx.edu:8001/clisp/bugfixes

Also, most of the binary distributions on sayre are up-to-date with
this fix.

Thanks!

Index: compiler.lsp
===================================================================
RCS file: /u/marcus/cvs/clisp/src/compiler.lsp,v
retrieving revision 1.6
diff -c -r1.6 compiler.lsp
*** compiler.lsp	1996/03/26 00:51:04	1.6
--- compiler.lsp	1996/05/03 08:14:13
***************
*** 6718,6729 ****
                             `(,anode1
                               ,@(let ((len (length symbols))
                                       (type (anode-type anode1)))
!                                     (cond ((equal type '(PRIMOP VALUES))
                                             (let ((count (length (remove-if-not #'anode-p (anode-code anode1)))))
                                               (if (eql count len)
!                                                  `((NV-TO-STACK ,len))
!                                                  `((MV-TO-STACK) (PUSH-NIL ,(- len count)))
!                                                  )))
                                            ((member type '(VAR VARSET CONST))
                                             `((MV-TO-STACK) (PUSH-NIL ,(1- len))))
                                            (t `((NV-TO-STACK ,len)))
--- 6718,6731 ----
                             `(,anode1
                               ,@(let ((len (length symbols))
                                       (type (anode-type anode1)))
!                                     (cond ((equal type '(PRIMOP VALUES-LIST))
!                                            `((NV-TO-STACK ,len)))
!                                           ((and (consp type) (eq (car type) 'PRIMOP))
                                             (let ((count (length (remove-if-not #'anode-p (anode-code anode1)))))
                                               (if (eql count len)
!                                                 `((NV-TO-STACK ,len))
!                                                 `((MV-TO-STACK) (PUSH-NIL ,(- len count)))
!                                                 )))
                                            ((member type '(VAR VARSET CONST))
                                             `((MV-TO-STACK) (PUSH-NIL ,(1- len))))
                                            (t `((NV-TO-STACK ,len)))