On 2006-12-12, André Thieme <[EMAIL PROTECTED]> wrote:
>> Contrast the much more common
>> 
>>   a[i] = b[n]
>> 
>> with
>> 
>>   (setf (aref a i) (aref b n))
>> 
>> and the attractions of Python may make more sense.
>
> Here Python and Lisp are equal, 7 tokens vs 7 tokens, but in
> Python one has to write less since "[]" are 2 chars while
> "aref" are 4, plus the setf.  But from counting the brain units
> which I regard as an important factor they are both equal.

A comparison of brain units of the above snippets is irrelevant,
since the snippets are not equivalent.  

The Python snippet will work for any object a that provides
__setitem__ and any object b that provides __getitem__.

I don't know what an equivalent Lisp snippet would be (or even
exactly how close the above snippet comes to matching the Python
code), but whatever it is would be a better foundation for
comparing brain units with the above Python.

-- 
Neil Cerutti
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to