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>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>ice-9/boot-9.scm:1685:16: In procedure raise-exception: <janneke>In procedure +: Wrong type argument in position 1: "075" <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) <lampilelo>does simply.scm define it's own + procedure? <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>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>mange / thanks! how may I file a patch for the website, please? <janneke>guile --no-auto-compile -l simply.scm <janneke>scheme@(guile-user)> (+ 3 (butfirst 1075)) <janneke>(using module-define! instead of set!) <janneke>berkeley's "Simply Scheme: Introducing Computer Science" <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? <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>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.