libera/#sicl - IRC Chatlog
Search
12:14:44
scymtym
relaxed clause ordering and more flexible accumulation would be very useful in my opinion. collecting into vectors or other data structures could be one feature. collecting in arbitrary sub-forms (like iterate allows) could be another. maybe via loop-collect like we already have loop-finish
12:40:30
yitzi
scymtym: Khazern already has some relaxed clause ordering. Termination clauses like REPEAT, WHILE, etc can be intermixed with FOR/AS and WITH.
12:42:34
yitzi
Also, I was thinking of adding a CLEANUP clause that works like FINALLY but puts the forms into UNWIND-PROTECT. FOR/AS clauses can do that vie KHAZERN:WRAP-FORMS, but the user cannot. For example they cannot do cleanup on WITH bindings.
12:43:32
scymtym
yitzi: that's good. still not sure what can be done pratically since conforming code can't rely on any of the extensions. maybe the situation will be like that of package-local nicknames, so one or more semi-standard extensions, at some point
12:45:52
yitzi
And khazern-extrinsic can be used as the primary LOOP in a single system via SHADOWING-IMPORT-FROM.
12:45:53
scymtym
a similar issue i have been sad about for years is format's ~{...~} not accepting sequences but that would be for
12:47:36
yitzi
I added a section on it recently https://github.com/s-expressionists/Khazern/?tab=readme-ov-file#replacing-builtin-loop-with-khazern
12:48:53
yitzi
If you imprort khazern-extension-extrinsic instead of khazern-extrinsic you'll get the extension stuff.
12:49:29
yitzi
Err, actually I should probably add details for that also, since it may not be obvious
12:51:41
scymtym
(cl:defpackage #:the-real-cl21 (:use #:common-lisp) (:shadowing-import-from #:khazern-extensions-extrinsic #:loop #:loop-finish))
12:52:39
yitzi
No, sorry for not being clear. It is still import from khazern-extrinsic, but the asdf depends changes. I'll come up with an example
13:01:01
yitzi
Updated that section https://github.com/s-expressionists/Khazern?tab=readme-ov-file#replacing-builtin-loop-with-khazern
13:03:07
yitzi
duuqnd: I'll think about that one. You could probably do with for-as-arithmetic followed by for-as-equals-then using MOD. For the 2d array, I suppose it would be useful if there was an inverse array-row-major-index
13:14:32
duuqnd
yitzi: Just so I'm being clear, the loop I would want to be able to produce would be roughly equivalent to (dotimes (y 240) (dotimes (x 320) [...])). I guess I could do that by doing modulos on a total index counter, or making y's :THEN be (+ (if (zerop x) 1 0) y), where x is then getting modulo'd before y gets updated... but that doesn't feel as clean... but maybe I don't actually need what I think I do.
13:24:51
duuqnd
sometimes the array may be 2D, sometimes it's 1D and it's just intended to be used as an image
13:26:13
duuqnd
Or sometimes I may want to walk a 2D grid and :COLLECT things from it. I can imagine quite a few uses, though nesting LOOP does work so I can't complain all too much. It's just clunky.
18:17:27
yitzi
beach: I'll start working on Salmagundi on a separate branch so I don't break SICL. It will take me a while to figure everything out, but I suspect that system reorganization will help avoid a lot of the duplicated intrinsic/extrinsic system declarations and lisp code.