On Aug 31, 3:59 am, John Fremlin <[email protected]> wrote:
> Nico de Jager wrote:
> > The following simplified code snipped works fine when ran interpreted
> > in LispWorks 5.1.2 Pro, but fails when the code is compiled....
>
> I don't have Lispworks except at work :-(
>
> Can you show a macroexpansion of the smallest form triggering the bug?
> (In and outside with-call/cc.) Then we should be able to fiddle with
> cl-cont so it generates a more correct transform.

Thank you. There you go:

SCRATCH 17 > (pprint (macroexpand '(defun/cc test2 ()
                                    (multiple-value-bind (x) 10
                                      (let/cc k
                                        (setf *k* k)
                                        x)))))

(PROGN
  (SETF (FDEFINITION 'TEST2)
        (CL-CONT::MAKE-FUNCALLABLE (LAMBDA (#:G1159)
                                     (DECLARE (IGNORABLE #:G1159))
                                     (LET ((#:G1160 #:G1159))
                                       (DECLARE (IGNORABLE #:G1160))
                                       (FUNCALL (LAMBDA (&REST
#:G1162)
                                                  (FUNCALL (LAMBDA
(#:G1163) (CL-CONT::APPLY/CC #:G1163 #:G1160 (APPEND #:G1162)))
                                                           (CL-
CONT::MAKE-FUNCALLABLE (LAMBDA (#:G1164 &OPTIONAL (X) &REST #:|m-v-b-
&rest1161|)
 
(DECLARE (IGNORABLE #:G1164))
 
(DECLARE (IGNORE #:|m-v-b-&rest1161|))
 
(FUNCALL (LAMBDA (K) (SETF *K* K) X) #:G1164)))))
                                                10)))))
  (FUNCALL #'VALUES 'TEST2))


SCRATCH 18 > (pprint (macroexpand '(with-call/cc (test2))))

(FUNCALL (LAMBDA (&OPTIONAL #:G1165 &REST #:G1166)
           (DECLARE (IGNORABLE #:G1165))
           (DECLARE (IGNORE #:G1166))
           (CL-CONT::FUNCALL/CC #:G1165 #'VALUES))
         #'TEST2)


It seems that the bug occurs before the with-call/cc:

SCRATCH 22 > (test2)

Error: Undefined function called with arguments (#<funcallable
200DDAC2> 10).
  1 (continue) Return some values from the call.
  2 Try invoking a different function with the same arguments.
  3 (abort) Return to level 0.
  4 Return to top loop level 0.

Type :b for backtrace, :c <option number> to proceed,  or :? for other
options

SCRATCH 23 : 1 > :b
Call to (HARLEQUIN-COMMON-LISP:SUBFUNCTION 1 CL-CONT::FDESIGNATOR-TO-
FUNCTION/CC)
Call to CL-CONT::FUNCALL/CC
Call to (HARLEQUIN-COMMON-LISP:SUBFUNCTION 2 CL-CONT::MAKE-
FUNCALLABLE)
Call to EVAL
Call to CAPI::CAPI-TOP-LEVEL-FUNCTION
Call to CAPI::INTERACTIVE-PANE-TOP-LOOP
Call to (HARLEQUIN-COMMON-LISP:SUBFUNCTION MP::PROCESS-SG-FUNCTION
MP::INITIALIZE-PROCESS-STACK)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"weblocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/weblocks?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to