From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Damien Mattei Newsgroups: gmane.lisp.guile.user Subject: Re: Python slices in Scheme Date: Fri, 23 Jun 2023 21:14:35 +0200 Message-ID: References: <5A5012F2-7712-49AD-9337-D688F0F2CC27@sarc.name> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38759"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri Jun 23 21:15:26 2023 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qCmFh-0009kT-Rv for guile-user@m.gmane-mx.org; Fri, 23 Jun 2023 21:15:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qCmFH-0001lo-JQ; Fri, 23 Jun 2023 15:14:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCmFG-0001le-GS for guile-user@gnu.org; Fri, 23 Jun 2023 15:14:58 -0400 Original-Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qCmF7-0004sE-Qz for guile-user@gnu.org; Fri, 23 Jun 2023 15:14:58 -0400 Original-Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-51beb527a89so1046150a12.1 for ; Fri, 23 Jun 2023 12:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687547687; x=1690139687; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=eqyFcDhsTfqNioyCWUwBDtyfq+LX5xvYe1aY2FdQpuQ=; b=WXXLMfcqfqAUkXkb97Xhr5QMMVO+wapSdUz8x1qiG9JnV2ZiHAoMYEn+/Z2Pfsvqs7 GHPoTpbw0USSzvcZl4smyPwEO+REN4E+ql9sCBNG0rKQJjnSt8/3UD4VdxAdLhA5+FCX CFWdXCDgMqkCJYzE0I5ehljYgkx+HYKpJkjui75C9Hbp8Kean+/Vsd8hqTYNpJQUjjqg oMFMspa1jpXrwCeiKQ9jbGATlbnKW5F5A5aMXPjr8SZUqUVcJ23pA8h0g1Weg7fcnnMc il6YbvijPiLrlb1Bxo0PodDmlu62CBMiQCYviOhN8TGts5DtXPKMWRhUtwDnjfZKPR5Y T7Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687547687; x=1690139687; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eqyFcDhsTfqNioyCWUwBDtyfq+LX5xvYe1aY2FdQpuQ=; b=R1Y/n7natHiVjKE9e9hMGDPMI91SdUYfL+FW06GtyO5hIpr3zoh/ODVdEnOtvE1f1T /4S3vnJbuggfvayg5aoDcZ4MfJh3ikE98BXx6Smude/8nYi/A6F9V7ItdzkPJuz98VHa cF11VGKwwInk8ek3pfxepu231lZJ4lq2ivUGHvWC4A9OgyWRT6K3VEVtJNC1jHOOcb5t 2BOo7l5yCL+RLWM0boX77T36n0hXgAhEwXU9qsDh5N+ZvJqD0dKUyhe9pZrI1RKNiXgr nj+SMvQzX4d6T1Yw7DEZGSWWjOrOMz2pC3GeiHwSt/ttukrqPaGGCONmAvoyNJqZihx2 dKrg== X-Gm-Message-State: AC+VfDw2r2qIfIWZ92fvcfnHrBjAizu62n8Z44yVOMJoXflkRX1TDmZX Q9diM5Sdj/Fc/49CvTDUKoG7ZJEwgO4QOZXNVJEisSrk X-Google-Smtp-Source: ACHHUZ7teaTJ6N6rCozAQggvEOpg4KBN8QDvNd1AogdoYLYQRSD7IiJW5ucKWMuF18C0jnedNJmE+s4iAto+eM2dXRo= X-Received: by 2002:a05:6402:648:b0:51b:fc77:63c7 with SMTP id u8-20020a056402064800b0051bfc7763c7mr1347970edx.20.1687547686788; Fri, 23 Jun 2023 12:14:46 -0700 (PDT) In-Reply-To: <5A5012F2-7712-49AD-9337-D688F0F2CC27@sarc.name> Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=damien.mattei@gmail.com; helo=mail-ed1-x52c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19064 Archived-At: seems a great work on array Lloda , for Guile , i can not use it directly in Scheme+ because i search portable code compatible with Racket too (and any scheme that support SRFI 105 curly infix), but perhaps there is not a lot of work to port it , indeed your library seems very powerful ,make me thing of Numpy arrays in pythons. Thanks again. Damien On Mon, Jun 19, 2023 at 6:37=E2=80=AFPM lloda wrote: > > My library guile-newra (1) has quite general multidimensional array > slicing. The indices can be linear ranges or arbitrary integer arrays and > they can have any rank. You can also use the indexed array as write targe= t. > If all the indices are linear ranges then the operation is done without > copies. It also has placeholders, so you can skip axes, like : and ... i= n > numpy. guile-newra's arrays are applicative, so you can do (thearray > firstindex secondindex ...), without special brackets. > > You need wrappers to use it with Guile's native array types, so it may no= t > be as convenient. Or maybe you don't need to handle arbitrary rank, then = it > might not be the best option. It's also far from finished, although the > stuff I mentioned above does work. > > I didn't adopt Pythons -1 =3D end convention because in Guile arrays can > have any base index, not necessarily 0 (whether that's a good idea or not= ). > > (1) https://lloda.github.io/guile-newra/#Slicing < > https://lloda.github.io/guile-newra/#Slicing> > https://github.com/lloda/guile-newra/ < > https://github.com/lloda/guile-newra/> > https://notabug.org/lloda/guile-newra < > https://notabug.org/lloda/guile-newra> > >