New submission from Marcin 'Qrczak' Kowalczyk:
Python 3.0a1 (py3k, Sep 8 2007, 15:57:56)
[GCC 4.2.1 20070719 (release) (PLD-Linux)] on linux2
Type help, copyright, credits or license for more information.
import pickle
help(pickle)
Traceback (most recent call last):
File stdin, line 1
Chris Smith [EMAIL PROTECTED] writes:
No what happens if right here you code
b := 16;
Does that again change the type of b? Or is that an illegal
instruction, because b has the local type of (18..22)?
It arranges that the expression b after that line (barring further
changes) has
Ken Tilton [EMAIL PROTECTED] writes:
I think the point is that, with the variable actually being just
a string and with dedicated new explicit functions required as
accessors, well, you could hack that up in any language with
dictionaries. It is the beginnings of an interpreter, not Python
Alexander Schmolck [EMAIL PROTECTED] writes:
I'd like to see a demonstration that using the same binding syntax
for special and lexical variables buys you something apart from bugs.
There are 3 fundamental operations related to plain mutable variables:
A1. Making a new mutable variable with
Followup-To: comp.lang.lisp
Bill Atkins [EMAIL PROTECTED] writes:
The cool thing about ITERATE is that it lets you express looping
concepts in a language designed explicitly for such a purpose, e.g.
(iter (for x in '(1 3 3))
(summing x)) = 7
(iter (for x in '(1 -3 2))
[EMAIL PROTECTED] [EMAIL PROTECTED] writes:
The python code below generates a cartesian product subject to any
logical combination of wildcard exclusions. For example, suppose I want
to generate a cartesian product S^n, n=3, of [a,b,c,d] that excludes
'*a*b*' and '*c*d*a*'. See below for
Abdulaziz Ghuloum [EMAIL PROTECTED] writes:
Python FAQs contain an entry to the schwartzian transform.
http://www.python.org/doc/faq/programming.html#i-want-to-do-a-complicated-sort-can-you-do-a-schwartzian-transform-in-python
This entry is obsolete: it should mention the 'key' option of the
Followup-To: comp.lang.scheme
Xah Lee [EMAIL PROTECTED] writes:
Since this is frequently used, Python provides a somewhat shorter
syntax for it, by specifying the column used as the ordering “key”.
[...]
Because Python's implementation is not very refined , this specialized
syntax is
Carl Banks [EMAIL PROTECTED] writes:
BTW, the fact that a closure refers to a variable itself rather to
its current value can be used to check the true attitude of
languages with respect to functional programming, by observing how
they understand their basic loops :-)
Closing on a value
[EMAIL PROTECTED] (Thomas A. Russ) writes:
(defun addn (n)
#'(lambda (x)
(+ x n)))
The same as
def addn(n):
def fn(x):
return n + x
return fn
Is this really equivalent?
What happens if you call addn more than once with different
parameters.
[EMAIL PROTECTED] (Thomas A. Russ) writes:
(defun addn (n)
#'(lambda (x)
(+ x n)))
The same as
def addn(n):
def fn(x):
return n + x
return fn
Is this really equivalent?
What happens if you call addn more than once with different
parameters.
11 matches
Mail list logo