[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
MCL bug?
- To: info-mcl-digest@cambridge.apple.com (confirm)
- Subject: MCL bug?
- From: Josep Puyol <puyol@ceab.es>
- Date: Mon, 7 Feb 1994 15:38:05 UTC
- Conversion: Prohibited
- Return-receipt-to: Josep Puyol <puyol@ceab.es>
- X400-content-type: P2-1984 (2)
- X400-mts-identifier: [/PRMD=iris/ADMD=mensatex/C=es/;940207153805]
- X400-originator: puyol@ceab.es
- X400-received: by mta iris-dcp in /PRMD=iris/ADMD=mensatex/C=es/; Relayed; Mon, 7 Feb 1994 15:38:12 UTC+0100
- X400-received: by /PRMD=iris/ADMD=mensatex/C=es/; Relayed; Mon, 7 Feb 1994 15:38:05 UTC
- X400-recipients: info-mcl-digest@cambridge.apple.com
Dear MCL members,
We have detected a bug (?) in the MCL compiler. Look at the next code:
(defun make-object ()
(labels
((method1-fun () 'method1)
(dispatch ()
#'method1-fun))
#'dispatch))
Please notice that the funcall returns NIL.
? (setq o1 (make-object))
#<COMPILED-LEXICAL-CLOSURE DISPATCH #x11DC76E>
? (funcall o1)
NIL
Changing the order in the labels declaration:
(defun make-object ()
(labels
((dispatch ()
#'method1-fun)
(method1-fun () 'method1))
#'dispatch))
It works returning the function METHOD1-FUN.
? (setq o1 (make-object))
#<COMPILED-LEXICAL-CLOSURE DISPATCH #x11DE6A6>
? (funcall o1)
#<Compiled-function METHOD1-FUN (Non-Global) #x11DE2E6>
We have used a lot this kind of constructs and we never had any problem.
Can anybody explain us what is going on?
Thanks in advance.