Re: What is a type error?

2006-07-11 Thread Marcin 'Qrczak' Kowalczyk
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 furt

Re: A critic of Guido's blog on Python's lambda

2006-05-13 Thread Marcin &#x27;Qrczak' Kowalczyk
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 wit

Re: A critic of Guido's blog on Python's lambda

2006-05-13 Thread Marcin &#x27;Qrczak' Kowalczyk
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 Py

Re: A critic of Guido's blog on Python's lambda

2006-05-10 Thread Marcin &#x27;Qrczak' Kowalczyk
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)

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-16 Thread Marcin &#x27;Qrczak' Kowalczyk
"[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

Re: Perl-Python-a-Day: Sorting

2005-10-13 Thread Marcin &#x27;Qrczak' Kowalczyk
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

Re: Perl-Python-a-Day: Sorting

2005-10-10 Thread Marcin &#x27;Qrczak' Kowalczyk
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

Re: Lisp-likeness

2005-03-16 Thread Marcin &#x27;Qrczak' Kowalczyk
"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

Re: Lisp-likeness

2005-03-15 Thread Marcin &#x27;Qrczak' Kowalczyk
[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

Re: Lisp-likeness

2005-03-15 Thread Marcin &#x27;Qrczak' Kowalczyk
[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