From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noah Lavine Newsgroups: gmane.lisp.guile.devel Subject: Re: propose deprecation of generalized-vector-* Date: Mon, 18 Feb 2013 11:29:47 -0500 Message-ID: References: <0F432FA1-CFF8-4A22-A477-5291A1B9925D@bluewin.ch> <87ip9mgzp4.fsf@gnu.org> <878v7m5xdh.fsf@pobox.com> <2E5FFE0D-9001-409C-BCD4-9EE3BF9883F0@bluewin.ch> <87mww0nu8l.fsf@pobox.com> <2D31D517-08F8-4D07-84DB-098E335AE0AD@bluewin.ch> <874nh9boqe.fsf@pobox.com> <1361204702.74716.YahooMailNeo@web120402.mail.ne1.yahoo.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b6d9340be3eb004d6023bda X-Trace: ger.gmane.org 1361205006 17646 80.91.229.3 (18 Feb 2013 16:30:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Feb 2013 16:30:06 +0000 (UTC) Cc: Andy Wingo , Daniel Llorens , guile-devel To: Mike Gran Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Feb 18 17:30:28 2013 Return-path: Envelope-to: guile-devel@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 1U7Tbn-000644-SM for guile-devel@m.gmane.org; Mon, 18 Feb 2013 17:30:28 +0100 Original-Received: from localhost ([::1]:36805 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7TbT-00019i-4h for guile-devel@m.gmane.org; Mon, 18 Feb 2013 11:30:07 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:44693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7TbF-000173-HU for guile-devel@gnu.org; Mon, 18 Feb 2013 11:30:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7TbA-000059-3L for guile-devel@gnu.org; Mon, 18 Feb 2013 11:29:53 -0500 Original-Received: from mail-vb0-f43.google.com ([209.85.212.43]:63376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7Tb9-000051-Um for guile-devel@gnu.org; Mon, 18 Feb 2013 11:29:48 -0500 Original-Received: by mail-vb0-f43.google.com with SMTP id fs19so3701108vbb.30 for ; Mon, 18 Feb 2013 08:29:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=H0Pj06I1+Fp8V4qRe8WbtLEGoevzXRM1M74o/Mjr1H8=; b=ID5mnTyyeVrJj7ZLjTxD8BEIPaAOE3ayuPTfsWIj3+BQLDoai4yQga1YYZqKKyL6p1 eiCtVtIBqrJ5crdM4+CV1R8isd3e6HdKVKET9P50rygMKkL84Opnw54Z0en9FdNBtM5K WyLlWS6ksFS1uEyRn5Wa5x0vuYhIDNEC8OMqk/rgfwHVJAk7a6PcDyidEV0SZ1r1GQpC cz/Vs8DwPxGEZdeFfVrfyoUtW3eJb/cg1lyHtmueXEb2FG5cCZz9QISJrFpq3hS1aciW Rdq+lYBCFa9muoMk2cRZTOK4dvS7TeCenVDnrDlBaDLOU82jNyoKDWK+Jb8/+ENC/80S nB+g== X-Received: by 10.58.85.134 with SMTP id h6mr16980764vez.18.1361204987444; Mon, 18 Feb 2013 08:29:47 -0800 (PST) Original-Received: by 10.58.171.41 with HTTP; Mon, 18 Feb 2013 08:29:47 -0800 (PST) In-Reply-To: <1361204702.74716.YahooMailNeo@web120402.mail.ne1.yahoo.com> X-Google-Sender-Auth: AyBhmcasjW8AoD4-7BQd-_5FuXo X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.212.43 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:15764 Archived-At: --047d7b6d9340be3eb004d6023bda Content-Type: text/plain; charset=ISO-8859-1 On Mon, Feb 18, 2013 at 11:25 AM, Mike Gran wrote: > From: Noah Lavine > > I haven't worked with the array functionality, so I might be missing > > something, but I don't see why this is natural for array-ref. > > One could imagine a Matlab-like syntax where array-ref has to have > the same number of indices as the underlying array, but, if an > index were replaced with a symbol, it would return a slice. > > if np is [[1, 2, 3], [4, 5, 6], [7, 8, 9]] > (array-ref np 1 1) -> 5 > (array-ref np 1 :) -> [4, 5, 6] > (array-ref np : 1) -> [[2], [5], [8]] > Yes, that would be cool. But I'm not arguing that we shouldn't have some cool array-slicing functions - I'm just saying that they might belong in a separate function, not in array-ref. > Or maybe that's already in Scheme. I'll admit I've never done matrices > in scheme. > As far as I know, there's no standard Scheme way to do arrays. I haven't done arrays or matrices in Scheme either, so don't take what I say too seriously. I would like to do it some time, but it'll probably only happen if I need to do a lot of array programming for work some time. I think the only way to get the interface right is to have someone write some serious array-processing software in Guile, and then basically do whatever they say. :-) Noah --047d7b6d9340be3eb004d6023bda Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable



On Mon, Feb 18, 2013 at 11:25 AM, Mike Gran <<= a href=3D"mailto:spk121@yahoo.com" target=3D"_blank">spk121@yahoo.com&g= t; wrote:
From: Noah Lavine <noah.b.lavine@gmail.com>
> I haven't worked with the array functionality, so I might be missi= ng
> something, but I don't see why this is natural for array-ref.
=A0
One could imagine a Matlab-like syntax where array-ref has to have the same number of indices as the underlying array, but, if an
index were replaced with a symbol, it would return a slice.
=A0
if np is [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
(array-ref np 1 1) -> 5
(array-ref np 1 :) -> [4, 5, 6]
(array-ref np : 1) -> [[2], [5], [8]]

Yes, that would be cool. But I'm not arguing that we shouldn= 9;t have some cool array-slicing functions - I'm just saying that they = might belong in a separate function, not in array-ref.
=A0
Or maybe that's already in Scheme. I'll admit I've never done m= atrices
in scheme.

As far as I know, ther= e's no standard Scheme way to do arrays.

=
I haven't done arrays or matrices in Scheme either, so don&#= 39;t take what I say too seriously. I would like to do it some time, but it= 'll probably only happen if I need to do a lot of array programming for= work some time. I think the only way to get the interface right is to have= someone write some serious array-processing software in Guile, and then ba= sically do whatever they say. :-)

Noah

= --047d7b6d9340be3eb004d6023bda--