From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: why are there [v e c t o r s] in Lisp? Date: Fri, 16 Oct 2015 04:51:30 +0200 Message-ID: <87d1wfplu5.fsf@debian.uxu> References: <87mvvjeg29.fsf@kuiper.lan.informatimago.com> <87io67pmr7.fsf@debian.uxu> <87mvvjzgup.fsf@fastmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1444963371 5709 80.91.229.3 (16 Oct 2015 02:42:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Oct 2015 02:42:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 16 04:42:41 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zmuyb-0007PR-VM for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Oct 2015 04:42:38 +0200 Original-Received: from localhost ([::1]:50555 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zmuyb-0000Hj-DV for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Oct 2015 22:42:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmuyR-0000Hd-1k for help-gnu-emacs@gnu.org; Thu, 15 Oct 2015 22:42:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmuyM-0001ou-Vn for help-gnu-emacs@gnu.org; Thu, 15 Oct 2015 22:42:26 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:50903) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmuyM-0001ok-OP for help-gnu-emacs@gnu.org; Thu, 15 Oct 2015 22:42:22 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZmuyK-00075a-56 for help-gnu-emacs@gnu.org; Fri, 16 Oct 2015 04:42:20 +0200 Original-Received: from nl106-137-244.student.uu.se ([130.243.137.244]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 16 Oct 2015 04:42:20 +0200 Original-Received: from embe8573 by nl106-137-244.student.uu.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 16 Oct 2015 04:42:20 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 32 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nl106-137-244.student.uu.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:PB+V8UvUhkjLe5k4To1fB2/uAYU= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:107668 Archived-At: Random832 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