On Sep 25, 7:07 pm, Zentrader <[EMAIL PROTECTED]> wrote:
> Note that in list comprehension, [x for x in (1, 2, 3)], the
> for loop allocates memory the same way, but the scope changes so that
> "x" is visible outside the for loop,
How is this different? The variable spilling of list comprehension
On Sep 24, 10:10 pm, Zentrader <[EMAIL PROTECTED]> wrote:
> > Your for loops both use the same counting index.
>
> Since those variables are local to the for loop,
No, "for" loops don't introduce a scope. The one variable named "j" is
shared.
> for j in range( 10 ):
> print j, "first loop"
>
Paul Rubin wrote:
> [EMAIL PROTECTED] writes:
> > > a = 'hello'
> > > a[0] = 'H' # attempt to change first letter to upper case
> >
> > As CLPython mirrors Python semantics, this results in a TypeError. The
> > internal representation of an immutable Python string is a mutable Lisp
> > string
Paul Rubin wrote:
> I thought it was of some interest though I'm a little surprise by the
> choice of CL rather than Scheme as a target.
In many aspects Python is a subset of CL. In CLPython, exceptions are
Lisp conditions with a custom metaclass (strictly spoken not portable
CL), Python (meta)cla