From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Daniel Llorens Newsgroups: gmane.lisp.guile.user Subject: Re: name an array function Date: Mon, 21 Nov 2016 14:10:12 +0100 Message-ID: <89CFAA9E-77F7-4428-AA59-72F9AB8796D7@bluewin.ch> References: <20161121125556.GA12982@tuxteam.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1479733905 27728 195.159.176.226 (21 Nov 2016 13:11:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 21 Nov 2016 13:11:45 +0000 (UTC) Cc: guile-user@gnu.org To: tomas@tuxteam.de Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Nov 21 14:11:40 2016 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8oNl-0006Sd-Fc for guile-user@m.gmane.org; Mon, 21 Nov 2016 14:11:37 +0100 Original-Received: from localhost ([::1]:49430 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8oNo-0000b3-Tp for guile-user@m.gmane.org; Mon, 21 Nov 2016 08:11:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8oMZ-00008X-T4 for guile-user@gnu.org; Mon, 21 Nov 2016 08:10:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8oMV-0002it-Th for guile-user@gnu.org; Mon, 21 Nov 2016 08:10:23 -0500 Original-Received: from vimdzmsp-sfwd04.bluewin.ch ([195.186.227.132]:33724 helo=smtpauths.lb.bluewin.ch) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c8oMV-0002iT-NO for guile-user@gnu.org; Mon, 21 Nov 2016 08:10:19 -0500 Original-Received: from 4box.hq.corp.viasat.com ([213.193.80.99]) by vimdzmsp-sfwd04.bluewin.ch Swisscom AG with SMTP id 8oMQcOFIE1MaO8oMRcqGNj; Mon, 21 Nov 2016 14:10:16 +0100 X-Bluewin-Spam-Analysis: v=2.1 cv=C7hJsV7+ c=1 sm=1 tr=0 a=DzaHVtLsrNCQ5PccsnG91A==:117 a=DzaHVtLsrNCQ5PccsnG91A==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=N659UExz7-8A:10 a=sWr-V4xTF6EFIirvC3oA:9 a=pILNOxqGKmIA:10 X-Bluewin-Spam-Score: 0.00 X-FXIT-IP: IPv4[213.193.80.99] Epoch[1479733816] X-Bluewin-AuthAs: dll@bluewin.ch In-Reply-To: <20161121125556.GA12982@tuxteam.de> X-Mailer: Apple Mail (2.1878.6) X-CMAE-Envelope: MS4wfKQ8Nti2HoyaM2PgfPY3SHLuNutnjTXmjwUhCUslBkXRhZBSjJUnELujCE+OowUXEIRwW9VASOC7kxdtCzxt5SFkJ546SNxwR7NeEfFee/oTDgUUhyfe 0PlGWy0JycBMa+q/KH4fbSIMggqqhANEvSqZu5Uxeq+AAF9U7/rcg30ETPzUDf+6ZuNXYPCDZaSLkxtVoMApbkYh+rmseDT+0lM= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 195.186.227.132 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:12997 Archived-At: On 21 Nov 2016, at 13:55, wrote: > > it (numpy, to mention a popular one. You don't need to say A[i, :, = :], > > you can just say A[i].). However, the maintainers spoke against = this, > > so these functions need different names. >=20 > Understandable... but a pity, really. yeah... > Uh, oh. That's NSFW material ;-) My head exploded (faint memories > of APL). check out =91J for C programmers=92, I think it has good explanations. > I do like slice. But I'm perhaps off because I don't quite understand > your mumblings about "the rank of the result would be positive". > What do they return otherwise? Do they throw an exception? They return the element itself. E.g. (array-from #2((a b) (c d)) 0) =3D> #1(a b) (array-from #2((a b) (c d)) 0 0) =3D> a the rank of the second result would be zero (so #0(a)) if the result was = always a =91slice=92. This is what I meant. There's a variant which = always returns a =91slice=92: (array-from* #2((a b) (c d)) 0) =3D> #1(a b) (array-from* #2((a b) (c d)) 0 0) =3D> #0(a)