Stefan Ram
2024-06-24 10:24:27 UTC
Sebastian Wells <***@here.com.invalid> wrote or quoted:
|..etc, taking into account that Python "lists" are really
|arrays, and there's no real Lisp equivalent to tuples,
Well, you could say that, in LISP, the dotted pair
( 1 . ( 2 . NIL ))
represents the list (1 2) while
( 1 . 2 )
represent the tuple "1,2".
|but they're essentially arrays also.
On an implementation level, an array is cache-friendly, while
a linked list is not. LISP lists are linked lists, not arrays.
|Lisp, there's no reader that will give you the original structure
|from its string representation without having to also evaluate it
In Python, the ast module can yield the structure of a module
of Python code (including list and tuple literals) without
the need to execute that code.
Newsgroups: comp.lang.python
|..etc, taking into account that Python "lists" are really
|arrays, and there's no real Lisp equivalent to tuples,
Well, you could say that, in LISP, the dotted pair
( 1 . ( 2 . NIL ))
represents the list (1 2) while
( 1 . 2 )
represent the tuple "1,2".
|but they're essentially arrays also.
On an implementation level, an array is cache-friendly, while
a linked list is not. LISP lists are linked lists, not arrays.
|Lisp, there's no reader that will give you the original structure
|from its string representation without having to also evaluate it
In Python, the ast module can yield the structure of a module
of Python code (including list and tuple literals) without
the need to execute that code.
Newsgroups: comp.lang.python