From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: why are there [v e c t o r s] in Lisp? Date: Sat, 17 Oct 2015 01:53:04 -0400 Organization: A noiseless patient Spider Message-ID: References: <87mvvjeg29.fsf@kuiper.lan.informatimago.com> <87eggvebfs.fsf@kuiper.lan.informatimago.com> <87pp0eckss.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1445061326 22244 80.91.229.3 (17 Oct 2015 05:55:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 17 Oct 2015 05:55:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 17 07:55:20 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 1ZnKSd-0008LQ-5G for geh-help-gnu-emacs@m.gmane.org; Sat, 17 Oct 2015 07:55:19 +0200 Original-Received: from localhost ([::1]:57126 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnKSb-0000Eg-VN for geh-help-gnu-emacs@m.gmane.org; Sat, 17 Oct 2015 01:55:17 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!1.eu.feeder.erje.net!news.albasani.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!barmar.motzarella.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 57 Injection-Info: barmar.motzarella.org; posting-host="2be9e9f5dd9af768b8861af71b85fc28"; logging-data="4607"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+QyAI5ho+DxeazjLkWw78g" User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Cancel-Lock: sha1:mNoIWntAWi9vkOSzc58NzFdYgD8= Original-Xref: usenet.stanford.edu gnu.emacs.help:215413 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:107697 Archived-At: In article , Emanuel Berg wrote: > "Pascal J. Bourguignon" > writes: > > >> Why the syntax is there at all is to provide fast > >> (faster) access to the vector data type which has > >> other time and space properties than do lists. > > > > ABSOLUTELY NOT. > > > > For example, in C++ you have vectors and lists, but > > you don't have any literal syntax for them. > > > > You can have fast and slow data structures without > > having any literal syntax for it. > > > > Why do you keep confusing the two concepts? > > The original question was why there is a special > syntax for vectors, even as lists are perfectly fitted > to be vectors. > > The question was not why there are lists AND vectors. > But that issue is also interesting so that discussion > wasn't wasted on anyone who read it (perhaps). > > As for the syntax, the "literal" > > [1 2 3] > > is a faster and more readable way than > > (vector 1 2 3) > > to tell the computer when it should use what, because > the computer isn't advanced enough to figure this out > on it own. Which is similar to the reason why we have literal lists: '(1 2 3) when you could just use (list 1 2 3) Literals are just a convenience feature. When arrays were added to MacLisp, they didn't have a literal syntax. Common Lisp added the syntax #(1 2 3) for them (and a more general syntax for multi-dimensional arrays). Common Lisp also added a syntax for structure literals. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***