help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why are there [v e c t o r s] in Lisp?


From: Emanuel Berg
Subject: Re: why are there [v e c t o r s] in Lisp?
Date: Fri, 16 Oct 2015 04:51:30 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Random832 <random832@fastmail.com> writes:

>> ... why? If lists are vectors, which they are in
>> terms of what they hold and how they look, then you
>> don't need more code compared to vectors, on the
>> contrary you need less code!
>
> The thing is, a vector in elisp terms is a specific
> type of object. It's in contiguous memory, and you
> can't take its cdr. It is an array whereas a list is
> a linked list.
>
> Maybe in some platonic ideal lisp there wouldn't be
> a difference ...

Indeed, this is what I think!

If a list just contains say a bunch of known integers
that don't need to be computed, is there anything that
stops this list from being stored in "contiguous
memory" with the list functions as well as the
constant access time "vector" functions available?

By the way: in my previous post strings were mentioned
and it sounded like they were sugar for lists of chars
- this isn't the case (you can't `car' a string) but
it could have been and it isn't harmful (I think) to
think of strings that way.

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

[Prev in Thread] Current Thread [Next in Thread]