在 2012年2月4日星期六UTC+8上午8时27分56秒,Antti J Ylikoski写道:
> In Python textbooks that I have read, it is usually not mentioned that
> we can very easily program Common LISP-style closures with Python. It
> is done as follows:
>
> -
>
> # Ma
On 2/3/2012 4:27 PM, Antti J Ylikoski wrote:
In Python textbooks that I have read, it is usually not mentioned that
we can very easily program Common LISP-style closures with Python. It
is done as follows:
Most dynamic languages have closures. Even Perl and Javascript
have closures
On Feb 3, 6:27 pm, Antti J Ylikoski wrote:
> In Python textbooks that I have read, it is usually not mentioned that
> we can very easily program Common LISP-style closures with Python. It
> is done as follows:
> [...]
do my eyes not see nor my ears not hear?
a thread about common
On 5.2.2012 22:58, Ian Kelly wrote:
On Sat, Feb 4, 2012 at 9:19 PM, Antti J Ylikoski wrote:
I'm not sure how naughty this is, but the same thing can be done without
using
nonlocal by storing the local state as an attribute of the enclosed
function
object:
...
Yes, I do know that, but then it
On Sat, Feb 4, 2012 at 9:19 PM, Antti J Ylikoski wrote:
>> I'm not sure how naughty this is, but the same thing can be done without
>> using
>> nonlocal by storing the local state as an attribute of the enclosed
>> function
>> object:
>>
>> ...
>
> Yes, I do know that, but then it would not be a c
On 02/05/2012 05:19 AM, Antti J Ylikoski wrote:
Yes, I do know that, but then it would not be a closure :-)
Forgive me if this is terribly naive, but what is the advantage of using
a closure as opposed to, say, some other function that returns the same
value in the same context, but
On 5.2.2012 3:31, John O'Hagan wrote:
On Sat, 04 Feb 2012 02:27:56 +0200
Antti J Ylikoski wrote:
[...]
# Make a Common LISP-like closure with Python.
#
# Antti J Ylikoski 02-03-2012.
def f1():
n = 0
def f2():
nonlocal n
n += 1
return n
return
On Sat, 04 Feb 2012 02:27:56 +0200
Antti J Ylikoski wrote:
[...]
>
> # Make a Common LISP-like closure with Python.
> #
> # Antti J Ylikoski 02-03-2012.
>
> def f1():
> n = 0
> def f2():
> nonlocal n
> n += 1
> return n
> return f2
>
[...]
>
> i.
On Sat, Feb 4, 2012 at 5:58 AM, Arnaud Delobelle wrote:
> I think what Chris asking is: what is the feature of Common-Lisp
> closures that Python closures share but other languages don't?
>
> I think what he is implying is that there is no such feature. Python
> closures are no more "Common-Lisp-
On Sat, 4 Feb 2012, Antti J Ylikoski wrote:
> On 4.2.2012 12:58, Arnaud Delobelle wrote:
> > On 4 February 2012 10:14, Antti J Ylikoski wrote:
> > > On 4.2.2012 4:47, Chris Rebert wrote:
> > > > Out of curiosity, what would be non-Common-Lisp-style closures?
> > > >
> > > > Cheers,
> > > > Chris
On 4.2.2012 12:58, Arnaud Delobelle wrote:
On 4 February 2012 10:14, Antti J Ylikoski wrote:
On 4.2.2012 4:47, Chris Rebert wrote:
Out of curiosity, what would be non-Common-Lisp-style closures?
Cheers,
Chris
I understand that a "closure" is something which is typical of functional
program
On 4 February 2012 10:14, Antti J Ylikoski wrote:
> On 4.2.2012 4:47, Chris Rebert wrote:
>> Out of curiosity, what would be non-Common-Lisp-style closures?
>>
>> Cheers,
>> Chris
>
>
> I understand that a "closure" is something which is typical of functional
> programming languages. -- Scheme-st
On 4.2.2012 12:14, Antti J Ylikoski wrote:
On 4.2.2012 4:47, Chris Rebert wrote:
On Fri, Feb 3, 2012 at 4:27 PM, Antti J
Ylikoski wrote:
In Python textbooks that I have read, it is usually not mentioned that
we can very easily program Common LISP-style closures with Python. It
is done as
On 4.2.2012 4:47, Chris Rebert wrote:
On Fri, Feb 3, 2012 at 4:27 PM, Antti J Ylikoski wrote:
In Python textbooks that I have read, it is usually not mentioned that
we can very easily program Common LISP-style closures with Python. It
is done as follows
On Fri, Feb 3, 2012 at 4:27 PM, Antti J Ylikoski wrote:
>
> In Python textbooks that I have read, it is usually not mentioned that
> we can very easily program Common LISP-style closures with Python. It
> is done as follows:
>
> -
>
> #
In Python textbooks that I have read, it is usually not mentioned that
we can very easily program Common LISP-style closures with Python. It
is done as follows:
-
# Make a Common LISP-like closure with Python.
#
# Antti J Ylikoski 02-03-2012.
def f1
16 matches
Mail list logo