<morganw>Possibly an annoying beginner question (apologies), but if two modules both have procedures with the same name is the only (or best) option to use a renamer when importing? ***chris2 is now known as chrislck
<fnstudio>hi, given an array, is there a simple/smart way to iterate over its elements while maintaining awareness of each element's coordinates? <fnstudio>i can think of a convoluted way that involves creating a second ad-hoc matrix for storing indexes and then using some variation of array-index-map! <chrislck>ah i don't use arrays. you'll probably use for-each while keeping an internal (index++ mod ncols) <fnstudio>chrislck: ah i see, ok, for-each will be then - thanks!! <fnstudio>RhodiumToad: hm, i wonder if i should consider switching to a different data structure? <fnstudio>RhodiumToad: or do you know of a recommended way of doing this directly from arrays? <fnstudio>here's my problem, in a nutshell: given an array with elements #f and #t, i'd like to get a list of all coordinates of #t elems <RhodiumToad>you could use array-index-map! with a dummy destination array <fnstudio>yeah, is the idea that the dummy array should be of the form (i, j) for every (i, j)? <fnstudio>the proc provided to array-index-map!, i mean <RhodiumToad>(let ((res '())) (array-index-map! ary (lambda args (let ((elt (apply array-ref ary args))) (when elt (set! res (cons args res))) elt))) res) *RhodiumToad finds the mutation somewhat obnoxious <fnstudio>thanks RhodiumToad, let me absorb that :) <fnstudio>thanks RhodiumToad, that solved my problem <RhodiumToad>I don't think it's very efficient, if you plan on doing it a lot, might be better to consider another data structure <lampilelo>or write a c module with new functionality for arrays <fnstudio>lampilelo: hm too much work for the current task, but good to know that that's also an option <chrislck>fnstudio: I meant array-for-each initially <Zelphir>Hello! I accidentally posted a question in #guix a minute ago, which I wanted to post here. Sorry for that. So here we go: <Zelphir>So I got the following code: https://paste.debian.net/1214099/ and I am wondering what I am doing wrong. I have also put the strack trace displayed by Geiser using ,bt and a trace displayed by Geiser using ,trace in the paste. Often I have these kind of traces, where 90% is Guile internal stuff, that I do not understand. Then I can see somewhere after `(min-length)` I get an error. I am not calling min-length myself, so it must be some internal stuff <Zelphir>or SRFI-43 stuff. I have tried "print debugging", but the error seems to happen inside the form of `vector-map`. Anything before I can print, but as soon as vector-map is called the error comes and I don't know what I did wrong. Somewhere internally some call of `cdr` seems to get an empty list and I don't know what is causing it. <lampilelo>Zelphir: your vector-map call has only 1 argument, you put the vector outside the call, what threw an error is a check if the minimal amount of arguments was passed <Zelphir>Oh. This is a little embarrassing. Oops! Thank you! Definitely been up too late yesterday (today). <Zelphir>So `min-length` is used on the list of arguments. Aha! I was already wondering, whether I have anything in the code, which requires there to be at least 1 element in a vector or so. <lampilelo>Zelphir: actually... i think the fact that this error was thrown is a bug, the code for vector-map allows a single argument to be passed but it fails later on, min-length call doesn't check the amount of arguments, it checks what is the length of the shortest vector that was passed <avp>Hello Guilers. Guile documentation snarfer ('doc-snarf') does not work with GOOPS code (for example it fails to properly read procedures defined with 'define-method'). Did anyone try to fix it? <roptat>civodul, do you have a solution for local-time? <avp>Huh, it seems that the last update to 'doc-snarf' was in 2011. <avp>Well that might be the case. But when I use GOOPS in my code, 'doc-snarf' fails to get documentation from it. <lampilelo>should've ended that statement with a smiley face, i was joking <civodul>did you try (setenv "TZ" "...") before calling localtime? <civodul>in the end it's just a matter of settin TZ and calling tzset(3) i think <roptat>civodul, setting TZ means even (tm:gmtoff (localtime (current-time))) doesn't work <roptat>I think this is because setting TZ automatically gives a value to zone, which calls localtime in a new environment where only TZ is set <roptat>I also tried (setenv "TZ" "Asia/Tokyo") (tzset) (unsetenv "TZ") (tm:gmtoff (localtime (current-time))), but that gives me the offset of my own timezone, not Tokyo's <ArneBab>I tried to write a Zen for Scheme, in the spirit of the Zen of Python, but a different form (because in Scheme it is more explicit that there are exceptions to rules and differences in opinion). I would love to hear your opinions on it: https://www.draketo.de/software/zen-for-scheme <civodul>roptat: hmm, something must be buggy <civodul>ok, looks like you had reached that conclusion much earlier :-) <roptat>civodul, should I send a bug report? <roptat>I think I see where it's not behaving correctly, but I don't really know how to fix it properly