guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Python slices in Scheme


From: Jay Sulzberger
Subject: Re: Python slices in Scheme
Date: Fri, 23 Jun 2023 13:26:50 +0000 ()


On Mon, 19 Jun 2023, lloda <lloda@sarc.name> 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 target. 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 ... in numpy. guile-newra's arrays are
applicative, so you can do (thearray firstindex secondindex ...),
without special brackets.

Dear lloda, I have not yet run your code, but I just now ran my eyes over

https://lloda.github.io/guile-newra/#Slicing

Heaven forwarding, I will run some of your code before the snows come.

Thank you!

oo--JS.



You need wrappers to use it with Guile's native array types, so it
may not 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 = 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>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]