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

[vax135!melmac!ilan@ucbvax.Berkeley.EDU: KCL scoping bug?]



From: vax135!melmac!ilan@ucbvax.Berkeley.EDU
Date: Tue, 3 May 88 10:25:26 edt
To: ilan@ucbvax.Berkeley.EDU, vax135!froggy.ics.utexas.edu!boyer
Subject: KCL scoping bug?

Hi,

I'm not sure how to post stuff to the KCL board at the moment, so I'm
sending this to you.  If you deem it worthwhile please post it
to the KCL mailing-list.

The following produces a scoping error in the interpreter (June 3, 87) -
the compiler handles the code correctly. (The example is lifted 
directly from CLtL p. 155).


---------

>
(setq x 'x-dyn z 'z-dyn)Z-DYN

>
(load "nonsense.l")Loading nonsense.l
Finished loading nonsense.l
T

>
#'foo
(LAMBDA-BLOCK FOO (&REST ARGS) (PRINT ARGS) (LIST ARGS))

>#'nonsense
(LAMBDA-BLOCK NONSENSE (K X Z)
  (FOO Z X)
  (LET ((J (FOO K X)) (X (* K K)))
    (DECLARE (INLINE FOO) (SPECIAL X Z))
    (FOO X J Z)))

>(nonsense 1 2 3)
(3 2)
(1 2)			;;; <---- SHOULD BE (1 X-DYN)
(1 ((1 2)) Z-DYN)	;;; <---- SHOULD BE (1 ((1 X-DYN)) Z-DYN)
((1 ((1 2)) Z-DYN))	;;; <---- SHOULD BE ((1 ((1 X-DYN)) Z-DYN))

>(compile 'nonsense)End of Pass 1.  
End of Pass 2.  
OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3
NONSENSE

>
(nonsense 1 2 3)
(3 2)
(1 X-DYN)
(1 ((1 X-DYN)) Z-DYN)
((1 ((1 X-DYN)) Z-DYN))

------------------


--Ilan Caron ..!ucbvax!vax135!lcuxlj!ilan