<dsmith>The bot remembers by the "metaphone" of the nick. I supposed it's for sloppy/fuzzy matching. <dsmith>Except when addressing the bot. That used to be by metaphone also, but I've fixed that. <RhodiumToad>(though I suppose it could have been worse, like soundex) <dsmith>The metaphone for both ends up being "sn" <RhodiumToad>metaphone is definitely too loose for nicks without arranging to store multiple nicks per metaphone <buffergn0me>Does anyone have tips for how to handle the meta switch with a relative guile path so that Emacs opens the script file in Scheme major mode? <ryanprior>How do I interpolate a string? Like (let ((place "world")) (interpolate "Hello, {place}!")) <buffergn0me>One answer to my earlier question: # -*-Scheme-*- as the second line after #!/bin/sh <buffergn0me>Would be nice to do this by file extension instead, but I am not sure if there is a convenient mechanism for modifying the major mode search order for this case ***catonano_ is now known as catonano
<alextee[m]>not sure if there's a formant variant that takes named arguments ***jonsger1 is now known as jonsger
<ryanprior>(string-append "first " a " then " b " and then finally " c.") <ryanprior>(interpolate "first {a} then {b} and then finally {c}.") <ryanprior>The second one looks so much more obviously correct to me, whereas I strain to scan the first one to make sure all my spaces and quotes are correct. <lloda>You can use a regular macro to pick the names of the variables, the rest is just parsing the string. <ryanprior>Cool, I would like to work on that. I have not grasped the API of the Guile macro system yet despite reading the manual and looking at a dozen examples. In particular the examples I've found (in Guix and the Guile manual) have been either simplistic and don't do much, or inscrutible such that I don't really understand what they do or how. <ryanprior>So if you know anybody who writes cool macros that I should definitely learn from, I would love links. <lloda>i've written some macros, but i'm far from an expert <ryanprior>Otherwise my plan is to work my way through the codebases of some existing guile repos (ice-9 things maybe?) and search for better examples. <lloda>bear in mind it's for racket, so not all of what he talks about is available in Guile <lloda>then there's tspl4 by Dybvig <lloda>there are a couple of articles that cover syntax-rules only, not syntax-case <lloda>syntax-rules for the merely eccentric and for the mildly insane, iirc <ryanprior>Cool I will give those a read lloda & dsmith thank you! <pinoaffe>hi everybody! (string->symbol "17f658ff") fails with $1 = ice-9/boot-9.scm:1669:16: In procedure raise-exception: In procedure string->number: Value out of range: 658, is this a bug? <daviid>tohoyn: I pushed a series of patches to support GList/GSList 'inout, 'out arguments and GSList 'in arguments - so now you may use gtk-radio-menu-item-get-group and even gtk-radio-menu-item-set-group, for example ... although wrt the later, as mentined earlier, gtk-radio-menu-item-join-group is 'the recommended way' - note that you may (also) create instances using (make <gtk-radio-menu-item> #:label "Item xx), then <daviid>gtk-radio-menu-item-join-group ... <daviid>str1ngs: I've not implemented anything yet wrt callback support, I did a bit of thinking about it, but 'nothing yet' <daviid>str1ngs: now, I'm thinking to first work to offer proper support for interfaces (so they become goops classes, inheritable by those implementing 'their interface' ...), then work to provide the long waited 'short method names', then I'll get back to the callback support ... <daviid>fwiw, here a slightly better hello-world example, which uses a <gtk-alignment> and proper gtk-box-pack-start expand fill padding settings, so when the user changes the window size things a kept 'nice and pretty' :) - https://paste.debian.net/1148094/ - it only lacks short method names, coming ... ***apteryx is now known as Guest96237
***apteryx_ is now known as apteryx
<str1ngs>daviid: thanks for the update. generally I just use gtk-box-pack-start myself. <RhodiumToad>pinoaffe: interestingly, the same error occurs with entering #{17f658ff}# literally <RhodiumToad>or to be more precise, it's produced by trying to _output_ that symbol <RhodiumToad>in fact (symbol? (string->symbol "17f658ff")) returns #t with no error as one would expect <RhodiumToad>so it's a bug in the code that decides whether a symbol needs to be printed with extended read syntax or not <RhodiumToad>if (scm_is_true (scm_i_string_to_number (scm_symbol_to_string (sym), 10))) return 1; <RhodiumToad>and the string_to_number throws because it has the form of a number with exponent but the exponent is too large <dsmith>Surprising to me it's messing about with a symbol as a number. Should be just a sequence of chars, right? Oh! It's needing to know if it should do the #{..}#. <RhodiumToad>a lot of things seem to get #{...}# that don't appear to need them <RhodiumToad>so the check for a number seems to be redundant as it stands - it does that check if the first character in the symbol is +, -, or ascii 0-9 <RhodiumToad>but none of those appear to be in the class of valid initial characters that it checks later <RhodiumToad>is there a handy function somewhere to say what unicode classes a character is in? <RhodiumToad>so #{-10z}# prints as just -10z because that's not a number, while #{10z}# prints as #{10z}# because it starts with a category Nd character which is not allowed to be first in a symbol <RhodiumToad>so what that check actually needs is a function that says whether a string has the syntactic form of a number, regardless of whether it can be converted to a number or not <pinoaffe>RhodiumToad: ah okay, thanks for taking a look! <RhodiumToad>workaround, avoid printing your strangely-named symbols :-) <pinoaffe>I'm generating a lot of uuids and printing them as symbols, so this happens every now and then <pinoaffe>yeah, I might try and write a function to detect whether a uuid is going to trigger this and just generate a new one in that case <RhodiumToad>I guess you don't want to change the format of your uuid symbols <pinoaffe>I'm working with an external file format (the librepcb files), and I don't think they'll lightly make such a massive change in their file format :) <pinoaffe>I guess I could also write a simple printing / writing function, that might be easier <RhodiumToad>arrange to always print your symbols as strings instead? <lloda>arch = os.popen('../config/config.guess').read() <RhodiumToad>I guess someone should write up a bug report for the symbol thing? <sneek>dsmith-work, you have 1 message! <sneek>dsmith-work, chrislck says: {appropriate-time} greetings to you too! <RhodiumToad>the bug is caused by confusion between "has the syntax of a number" and "can be converted to a number", so maybe those two concepts need to be split apart somehow? <sneek>Welcome back RhodiumToad, you have 1 message! <sneek>RhodiumToad, chrislck says: you are very helpful <chrislck>a looong time ago gnucash was a guile app, very scriptable. soon, gnucash will run reports from commandline. <RhodiumToad>I guess the question is how hard should display of a symbol try to avoid using #{...}# ? <dsmith-work>ISTR fixing bug in gnucash is what drew wingo into guile <RhodiumToad>there are currently cases like (display '10z) where a symbol read without #{..}# is nonetheless printed with them <chrislck>I think wingo wanted a report which tells him how much he earned per DOW <RhodiumToad>if changing the behavior of (display '-10z) to output #{-10z}# is acceptable, then it would be sufficient to simply change the code to look for an initial + or - followed by a digit or . ***rekado_ is now known as rekado
***cantstanya is now known as frank
***frank is now known as cantstanya
<winny>hello, what is the return value of the display procedure? <winny>Working on glue to evaluate an expression and do the right thing when printing it back to IRC, as such no value should be echoed back as "(No value)" <dsmith-work>Unspecified. Same thing that (if #f #f) would return. <reepca>does 'write' ever produce newlines? <winny>as a solution I found (display (call-with-values thunk (lambda args (cond ((null? args) "(No value)") ((= 1 (length args)) (car args)) (else (cons 'values args)))))) works <winny>e.g. no args passed to the call-with-values receiver means something like display was called <winny>indeed, i'm asking here because i'm writing for guile ;) <RhodiumToad>right. so what seems to happen in guile is that display returns no values <RhodiumToad>so your call-with-values is probably the right approach <RhodiumToad>(lambda () (display 1)) is returning one value which is #<unspecified> <RhodiumToad>(call-with-values thunk (case-lambda (() "(No value)") ((a) (if (unspecified? a) "(unspecified)" a)) (rest (cons 'values rest))))