IRC channel logs

2024-06-14.log

back to list of logs

<lloda>cpli: transpose-array can be used to get the 'diagonal' of array (the one i know about, that is A[i,i,i] for an array A[i,j,k]). Say (transpose-array #3(((1 2) (3 4)) ((5 6) (7 8))) 0 0 0) => #1(1 8). This is an old APL idiom
<lloda>your uses of make-shared-array are incorrect, the dimensions of the result are given in rest args, not as a list argument
<lloda>the error you get is admittedly unclear
<janneke>having some trouble with simply.scm
<janneke>(butfirst "1075")
<janneke>While compiling expression:
<janneke>In procedure imag-part: Wrong type argument in position 1: "1075"
<janneke>bf works a bit better, but not when used as an argument:
<janneke>(+ 3 (bf 1075))
<janneke>ice-9/boot-9.scm:1685:16: In procedure raise-exception:
<janneke>In procedure +: Wrong type argument in position 1: "075"
<janneke>i'm using simply.scm from: https://people.eecs.berkeley.edu/~bh/downloads/simply/
<janneke>is there a newer version of simply.scm or does someone have a fix?
<janneke>there seems to be a version for racket, but that uses define-values letrec-values and i don't know what they are...
<lampilelo>janneke: seems like (bf 1075) returns a string, so you can't add it to a number, you'd need to convert it with number->string first
<lloda>guile has define-values. Doesn't have letrec-values but presumably letrec in srfi-71 would be equivalent
<lampilelo>and the (butfirst "1075") expression doesn't like the string as its argument either
<janneke>lampilelo: this is in the context of simply.scm, of course, using (strings-are-numbers #t)
<janneke>lloda: thanks, i'll try that
<lampilelo>does simply.scm define it's own + procedure?
<janneke>yes
<janneke>hmm, using srfi-71 and changing letrec-values to letrec doesn't work, that would need more thought and care
<lloda>you need to replace the (values ...) by srfi-71's syntax for it
<lloda>so with let-values it's (let-values (((a b c) (values 1 2 3)) ...) ...) but with srfi-71 it's (let ((a b c (values 1 2 3)) ...) ...)
<janneke>right, thanks
<janneke>this is terrible
<janneke>some funky hash thingy: #%app
<janneke>that seems to be something like apply
<janneke>ACTION gives up on the racket version for now
<trev>might be a silly questions, but is it possible to use sigaction to catch a SIGRTMIN signal from within a guile script?
<trev>when i do pkill -SIGRTMIN guile it always kills my program and says "unknown signal"
<trev>dangit, ignore me. it does work, just not within fibers
<trev>nope, works there too! i'm an idiot
<lechner>Hi, which package does the plain "guile" about a third down the page refer to, please? The caption reads: "This is Emacs with a few settings that make working with Guile easier for people new to Emacs. Features include: CUA mode, Geiser, tool bar icons to evaluate Guile buffers, support for Guile's very own picture language, code completion, a simple mode line, etc."
<lechner> https://www.gnu.org/software/guile/libraries/
<mange>I expect it's guile-studio: https://elephly.net/guile-studio/ The description in Guix's package definitions matches that text.
<lechner>mange / thanks! how may I file a patch for the website, please?
<mange>No idea, sorry. :)
<Arsen> https://git.savannah.gnu.org/cgit/guile/guile-web.git I'm guessing posting on the same ML as guile works.. not sure
<lechner>Arsen / bug-guile@gnu.org ?
<Arsen>either that or https://mail.gnu.org/mailman/listinfo/guile-devel/ - I don't fully recall
<lechner>mange / Arsen / thanks!
<janneke>simply.scm adapted for guile -- https://lilypond.org/janneke/simply-scheme/simply.scm
<janneke>guile --no-auto-compile -l simply.scm
<janneke>scheme@(guile-user)> (+ 3 (butfirst 1075))
<janneke>$1 = 78
<janneke>\o/
<janneke>(using module-define! instead of set!)
<lampilelo>so what does simply.scm do?
<janneke>it goes with https://people.eecs.berkeley.edu/~bh/ss-toc2.html
<janneke>berkeley's "Simply Scheme: Introducing Computer Science"
<lampilelo>ah, ok
<janneke>ACTION mails guile-user
<RavenJoad>Is there a way to modify initargs when writing an initialize method? I want (make <child>) to set a slot in the parent automatically when initializing a <child> instance, without the user needing to do (make <child> #:parent-slot "value").
<RavenJoad>I am doing (set! initargs (append initargs)), and that works, but I feel like there may be a better way.
<RavenJoad>I have already tried using parameterize and with-fluids, and initargs is neither a parameter or fluid, so I am not sure there is a better way to modify initargs other than a set!.
<lechner>mwette / Thanks for the fh-object-set! fix. Unfortunately, I cannot test is since Guix applies a graft to 1.08.1 I was using before. Would you know why?
<lechner>here is my package definition https://bpa.st/EISQ
<mwette>lechner: the fix is not released yet. If you want to develop, take the ffi-help-rt.scm file from the dev-1.10 branch (from nyacc git repo sv.gnu.org) and copy it you your local files, overriding what's installed in guix
<lechner>mwette / i just figured out i can pick off the file because we are in Scheme, but doesn't my package definition pull from the most recent commit on the dev-11.0 branch?
<mwette>I think you can do that, but it requires a git source I think, with the commit number. I'm only an occasionally guix user (on my laptop with small disk).
<lechner>mwette / okay, thanks and sorry to bother you. i'll ask over there
<mwette>good luck
<mwette>I've just recently been using callbacks. I'm working on a "tkinter" like module that runs on top of all-scheme gtk2+ generated by nyacc, including a packer container derived from GtkContainer. <= inheriting gobject classes 100% in scheme.