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: Tue, 20 Jun 2023 08:39:30 +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="11574"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Tue Jun 20 08:40:20 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 1qBV2K-0002qh-8l for guile-user@m.gmane-mx.org; Tue, 20 Jun 2023 08:40:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qBV1q-0004o1-Sf; Tue, 20 Jun 2023 02:39:54 -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 1qBV1n-0004nq-K1 for guile-user@gnu.org; Tue, 20 Jun 2023 02:39:48 -0400 Original-Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qBV1l-0005fe-Mm for guile-user@gnu.org; Tue, 20 Jun 2023 02:39:47 -0400 Original-Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-51a3e7a9127so7535252a12.1 for ; Mon, 19 Jun 2023 23:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687243182; x=1689835182; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=eie6QJJ6RHkrlt0CwE7nCD/+B1aQ40vbOyaikYxfFdM=; b=jv/lRNZCw3RYfh4vQPIOA3g8Xshz0JmZ8EGMKISFPTmMnNkiFzkaemdoPFb1B5hZXF lXo2RK5487qbw2QTv2LRo6T7iaiOynPsvBe9+p9WOsYMvZTf9Pnm+2qLm/OZfnF3Ct50 3dw5HF3BWcKmfW484bnxu5Z/sH3CjjHiR15cGVCl7FPUzM32fHS4L6Ow927wiSZNvHSZ sQI08i9UxKzRvnYjdl4+U6wD6rXQVUcRsI3UJ2On7lGAO21tGe21i5IkNrwDx6MFTFa0 4hRNkQSc88kIgVVxv5ywozrBOW00xjUmznjAVjZVmftmra518lMN1G+Fw45nqxS6OfmC lWTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687243182; x=1689835182; 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=eie6QJJ6RHkrlt0CwE7nCD/+B1aQ40vbOyaikYxfFdM=; b=Yy1H+OIyWRcjOpVvVtp8sDnf2yErsGnikuC0FIy902/194PqxMUKGr96dTEBQHT3qN r1EqVqQCQQ3kGluBmzCVSKg10DFsyyq/CuN/+Du9LpXctOx473M2unpOu45ytzZ3qA9g eX9SoqWpzgFV5bCdyIbSBc0ZCh3EbVbEh11iSVNy/2r7/cvdBaMCJhqYb1eSEcDQBcst 2L+xJzMgYGrV21pmEro1NEX9itfa2FvELgyAcE6Q1I+t7ZHdnE5x0eVO/5x5IwYKPwkY YZZ8ZWXzQO+lGRkW8A9EUk8+voj+im2/yTk/WjaxcVhISp/DR6IXokE8AT1mJTeje15J k63Q== X-Gm-Message-State: AC+VfDxqiWG3d68DYsE3ufzxBD30OnxICA/q4X31XNcewPIKDXY2Wu3A JeATeOcxyYcYN59flF8R1n2FeOd3wMkuAaWSlImt5Ghq X-Google-Smtp-Source: ACHHUZ40GrG8pR0vP+Mr7VSFEGPfXhNwAG2CF5mtAhYpRV5BmYSwCkbMO3eiZvUS87r9x0OEYJqHortXQ36HLgN6y9Y= X-Received: by 2002:a05:6402:2816:b0:51a:41fd:9732 with SMTP id h22-20020a056402281600b0051a41fd9732mr10543009ede.11.1687243181649; Mon, 19 Jun 2023 23:39:41 -0700 (PDT) In-Reply-To: <5A5012F2-7712-49AD-9337-D688F0F2CC27@sarc.name> Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=damien.mattei@gmail.com; helo=mail-ed1-x52b.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:19053 Archived-At: it seems a big work , thanks 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> > >