f python?

Pascal J. Bourguignon pjb at informatimago.com
Wed Apr 11 11:32:42 EDT 2012


Shmuel (Seymour J.) Metz <spamtrap at library.lspace.org.invalid> writes:

> In <87wr5nl54w.fsf at sapphire.mobileactivedefense.com>, on 04/10/2012
>    at 09:10 PM, Rainer Weikusat <rweikusat at mssgmbh.com> said:
>
>>'car' and 'cdr' refer to cons cells in Lisp, not to strings. How the
>>first/rest terminology can be sensibly applied to 'C strings' (which
>>are similar to linked-lists in the sense that there's a 'special
>>termination value' instead of an explicit length)
>
> A syringe is similar to a sturgeon in the sense that they both start
> with S. LISP doesn't have arrays, and C doesn't allow you to insert
> into the middle of an array.

You're confused. C doesn't have arrays.  Lisp has arrays.
C only has vectors (Lisp has vectors too).

That C calls its vectors "array", or its bytes "char" doesn't change the
fact that C has no array and no character.


cl-user> (make-array '(3 4 5) :initial-element 42)
#3A(((42 42 42 42 42) (42 42 42 42 42) (42 42 42 42 42) (42 42 42 42 42))
    ((42 42 42 42 42) (42 42 42 42 42) (42 42 42 42 42) (42 42 42 42 42))
    ((42 42 42 42 42) (42 42 42 42 42) (42 42 42 42 42) (42 42 42 42 42)))

cl-user> (make-array 10 :initial-element 42)
#(42 42 42 42 42 42 42 42 42 42)



-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.



More information about the Python-list mailing list