IRC channel logs

2021-12-09.log

back to list of logs

<KE0VVT>Has anybody used noweb? I am having difficulty getting this into a PDF: https://bpa.st/JVXQ
***regtur_ is now known as regtur
<ArneBab>sneek: later tell KEOVVT I’m using noweb in Emacs org-mode. There it works pretty well. See for example https://hg.sr.ht/~arnebab/draketo/browse/software/wisp-code-katas.org?rev=tip#L99https://www.draketo.de/software/wisp-code-katas.html#orgd759959
<sneek>Okay.
<attila_lendvai>is there some construct to "compose" OR (besides CUT)? IOW, a shorter way to write e.g. (or (string? x) (number? x))
<attila_lendvai>well, cut won't work here either, because it doesn't walk the form, only processes the topmost level
<pinoaffe>attila_lendvai: if `predicates` is a list of predicates, `(compose (cut any apply predicates <>) (cut make-list (length predicates) <>) (cut list <>))` is a point-free way to check whether any of them are true when applied to a value
<pinoaffe>though it's probably not a good idea to use this :)
<attila_lendvai>pinoaffe, thanks! probably not (i desire readability and being short). it's good for learning, though!
<pinoaffe>or slightly less weird, but still not a good idea: `(lambda (x) (any apply predicates (list (length predicates) x) (list (length predicates) '())))`
<pinoaffe>oh and `(any (cut <> 3) predicates)` is actually readable
<attila_lendvai>indeed!
***chris is now known as Guest3662
***Guest3662 is now known as chris-l
***chris is now known as Guest6594
***Guest6594 is now known as chris-l
<ArneBab>attila_lendvai: I only know and=>
<dsmith-work>Morning Greetings, Guilers
<fnstudio>hi, if i wanted to create an empty array with same dimensions as an existing array, what would i do? (make-array #t (array-dimensions a)) is wrong, of course
<lloda>(apply make-array #t (array-dimensions a))
<lloda>that isn't empty tho, it will have #t in it
<fnstudio>lloda: oh great, i know apply tends to come up in similar cases, but i thought i had to combine it with a lambda in this case; great solution, thank you!
<lloda>np
<fnstudio>noted with regard to the array not being empty, right...
<lloda>you cannot have an empty array of type #t, it has to have something in it
<fnstudio>can an array have not-null dimensions and still be empty?
<lloda>no
<fnstudio>i see, ok, it's not super relevant for my immediate problem, but it's very good to know in general
<lloda>if your array has a type, like 'f64, and you construct it with *unspecified*, it won't be initialized and it will have random stuff in it
<lloda>like (make-typed-array 'f64 *unspecified* 10 10) or w/e
<lloda>but if you do that with an array of scheme values it will have *unspecified* objects in it which is kinda strange
<fnstudio>lloda: oh ok, good to know, thanks
<ArneBab>fnstudio: an array is something with memory inside. Either you give it the value it should have, or it has the values the memory inside represents. And the memory has the value it had before it became part of the array, so it’s something that looks random.