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: why are there [v e c t o r s] in Lisp? Date: Fri, 16 Oct 2015 03:12:16 +0200 Message-ID: <87oafzpqfj.fsf@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1444957467 18602 80.91.229.3 (16 Oct 2015 01:04:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Oct 2015 01:04:27 +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 03:04:17 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 1ZmtRM-0000bu-RW for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Oct 2015 03:04:12 +0200 Original-Received: from localhost ([::1]:50366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmtQZ-0004Ra-RD for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Oct 2015 21:03:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmtQP-0004RS-QY for help-gnu-emacs@gnu.org; Thu, 15 Oct 2015 21:03:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmtQM-0001jW-Kd for help-gnu-emacs@gnu.org; Thu, 15 Oct 2015 21:03:13 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:45595) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmtQM-0001jP-DI for help-gnu-emacs@gnu.org; Thu, 15 Oct 2015 21:03:10 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZmtQI-0007sE-M9 for help-gnu-emacs@gnu.org; Fri, 16 Oct 2015 03:03:06 +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 03:03:06 +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 03:03:06 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 43 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:WMpQuws22kvTVHqyw5fDc10Hgso= 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:107664 Archived-At: One of the things I like the most with Lisp is the way it is typed and written. It is just so much more enjoyable both to type and read. And otherwise interact with (e.g., the help). Long words are prefered, with everything spelled out - compare `gnus-action-message-log' to the argc, argv, etc. of typical C! Also dashes instead of the ugly underscore, which is less readable, and slower as well (two keys instead of one for the dash) - and then to think of the worst case, the CamelCase of Java (no pun intended - still, better keep the sick bags nearby!). And then while not exactly ugly, who needs the curly braces to delimit functions (virtually all other languages, apparently), or for that matter the square brackets of array indexes and iteration? Or the semi-colon to delimit expressions and statements? They are just a bit tricky to type (except for the semi-colon) and they make the code look like an anthill - for no reason as Lisp shows. But there is one thing that clouds the perfect sky - vectors. I realized this when I was thinking about this. Why is there a special syntax for vectors? In linear algebra, an n-dimensional vector is a sequence of n numbers, and collectively they make for something that has direction and magnitude (in particular, it doesn't have a position). But whatever the math, isn't that (a sequence of numbers) something that the lists of Lisp can handle just as well, or actually better, as it will be more generic (a lot of stuff that doesn't work on "real" Lisp vectors will work on vectors that are also lists). And using lists doesn't mean nobody cannot write hundreds of "math vector" specific stuff to modify those list vectors! Right? Have a look: (vectorp [1 2 3]) ; t (vectorp '(1 2 3)) ; nil - really? -- underground experts united http://user.it.uu.se/~embe8573