<wklew>does anyone know if there's a fix for cond-expand not expanding correctly inside define-library? <wklew>I meant to ask if there's plans to release a fix, a patch was posted in the thread but I haven't tried rebuilding guile ***sneek_ is now known as sneek
<leoprikler>linas: I'm sure cogserver has a purpose, I just wanted to point you to something else so that you don't need to rely on it "just to have a REPL server". <rekado>linas: I don’t understand the “telnet” comment. You don’t need to use telnet to talk to a REPL server. <rekado>if you have a test case to demonstrate “crashy” we would be very interested in reproducing the problem. <lampilelo>how to get a terminal width in guile when COLUMNS env var is not set? ***zap1 is now known as zzappie
<manumanumanu>zzappie: regarding your question: you are trying to display the syntax transformer from the match macro? ***jonsger1 is now known as jonsger
<zzappie>manumanumanu: hello! No actually It was a WAT moment when I was working with g-expressions and guix's shepherd services. Service I wrote was crashing. So I tried to find out whats going on there and noticed some spooky action <zzappie>I could understand how it would possibly happen <zzappie>same thing wihth response-code from (web response) module <zzappie>I could't look code coumpiled by gexps (if its the right wording) because in this particular case I had to deal with .go files <zzappie>I posted It here and not in #guix cause I though someone could have a clue ho such thing could happen in guile or maybe already had such experience <zzappie>I eventually solved the problem by removing with-imported-modules form and using shepherd-service record's "modules" field. <zzappie>but what happend remais a mystery to me <zzappie>In short: no, I wanted to understand how (pk match) would possibly output (<#syntax transformer>) rather than throwing syntax error :) <zzappie>RhodiumToad: I don't know the answer. But it was my experience with any macro <zzappie>try running: guile -c "(begin (use-modules (ice-9 match)) (pk match))" *zzappie thought: shouldt here be a guile bot that evaluates expressions? ***jonsger1 is now known as jonsger
<leoprikler>zzappie: (module-ref (resolve-module '(ice-9 match)) 'match), you're welcome <zzappie>leoprikler: ((module-ref (resolve-module '(ice-9 match)) 'match) ...) is not the same as (match ...) right? <zzappie>in case of ((module-ref (resolve-module '(ice-9 match)) 'match) (() 'nill) (_ 'rest)) it will try to evaluate subforms (is this the right word?) and yell at me because of () *zzappie meant ((module-ref (resolve-module '(ice-9 match)) 'match) '() (() 'nil) (_ 'rest)) <leoprikler>yeah, I thought so, because module-ref doesn't actually bind it as syntax <RhodiumToad>module-ref is giving you the value bound to the symbol <zzappie>I for some time thought that syntax if first class in scheme <RhodiumToad>which is not the same thing as actually importing the macro into the current scope <RhodiumToad>consider that macros have to be known at compile time <zzappie>RhodiumToad: yeah: I meant its not guile bug, but guix bug <manumanumanu>zzappie: match _is_ a syntax transformer. When used normally you sholdn't see it, but when you are doing macrobatics you can get that kind of thing. <manumanumanu>I don't know. I only go up to level 4, and only when intoxicated. <manumanumanu>zzappie: did you ever see "peak syntax rules" by tailor Campbell? It is the syntactic parameters used by his foof loop implementation. The loop facility is rather WTF, but the syn params part is insane... <zzappie>manumanumanu: wow.. I think Im not ready for that just yet :) But I'm adding it to my scheme stuff list ***Server sets mode: +nt
<rlb>Say I need a data structure available during expansion/compilation that is consulted by, and adjusted by the compilation process, and I also need some of the info that was collected to be available at runtime. Is there a typical way to handle that? <rlb>I think I know some ways to handle it, but didn't know if there was a common/preferable approach. <leoprikler>rlb: syntax-case, just make sure you write whatever data you need into the runtime code <mwette>nyacc has a routine `pretty-print-c99' that takes C AST in SXML and generates C code. It is fairly mature. And you can use parse-c99 to generate SXML ASTs from C code. <rlb>The issue is that I need to accumulate info over multiple macro calls (calls which consult the accumulating info), and then have some of that info also be available at runtime. One approach perhaps, is to manipulate/consult the "global" data structure from the syntax expanders, and then also have the expansions include code to populate the relevant structure at runtime. <rgherdt>hi all! Could some Guile maintainer please take a look at following bug (with solution) and possibly apply the changes? It would make R7RS's define-library work <avp_>Currently I'm more interested in producing FSMs for Scheme world though, but in the future nyacc may come in handy. <mwette>I hack on FSMs also, and keep it in Scheme, for the win. Have fun! <nckx>But it's such a Schemey thing that it made me laugh so kudos for that. <daviid>rlb: what about (eval-when (expand load eval) ...)? <civodul>nckx: i think i got used to it! "reverse packtrace notation" it's called <rlb>daviid: right, I assume I'll be using eval-when variants as part of the process. *civodul notes that nckx has a bunch of non-literal format strings at hand <nckx>civodul: Don't we all? They're (info (G_ "~x")) calls. <civodul>i'm used to seeing that warning and it's perfectly legitimate in this case <civodul>we'd need a way to annotate the thing so the compiler looks at the string inside <civodul>or we could express it slightly differently <nckx>That's what I was (extremely idly) poking around at when I got distracted by the reverse packtrace notation. 😉 <nckx>I gather there's no existing annotation system? <nckx>Then I see why everyone just gets used to the warnings. <mwette>What is bad about having non-literal format strings? I get that for C, but for Scheme type values are known at run-time. <wingo>mwette: often is a bug, consider (lambda (x) (format "~a" x)) <wingo>also prevents checking that arguments conform to format string (-Wformat) <civodul>in C it can be tragic; in Scheme it's a bad-looking run-time error <mwette>I'd assume when format string is processed for say ~d you can check arg via (integer? arg). <wingo>rgherdt: applied, tx for poke! <sneek>Welcome back wingo, you have 1 message! <sneek>wingo, civodul says: thanks for the super fast bug fixes! <wingo>sneek: late tell stis tx for report, fixed :) <sneek>stis, wingo says: tx for report, fixed :) <wingo>daviid: also fixed the (lambda ( . args) ...) thing, was a bug in the new read-syntax <wingo>sneek: late tell stis tx for report, fixed :) <sneek>stis, wingo says: tx for report, fixed :) <wingo>weird, stis is not actually here afaics? <wingo>sneek: later tell stis tx for report, fixed :) <wingo>ah just a typo on my side then <wingo>ah no not yet, tx for reminder <RhodiumToad>without that it fails to compile if HAVE_CONFIG_H is defined <wingo>RhodiumToad: i just tried the tarball and it just works here if i --enable-mini-gmp <wingo>what could be the difference in our systems? <wingo>you explicitly define HAVE_CONFIG_H in your cflags? *civodul built it with --enable-mini-gmp in Guix too <RhodiumToad>another possible difference is whether it's using the lib/unistd.h rather than the system one <daviid>wingo: hello. did you read the feeback i posted here, wrt the fix for #47084, with a debian paste (that expired now ... i can posted again, answer #47084, or opening a 'new' bug report ... that was the feedback and following quiz ... <wingo>daviid: sorry all i got out of it was the (lambda ( . args) ...) issue <wingo>if there is another problem please let me know <RhodiumToad>the error is #error "Please include config.h first." <civodul>RhodiumToad: the change you pasted above makes sense to me <wingo>RhodiumToad: yeah i don't doubt that such a clause might be needed but i didn't know why it worked here <civodul>like you include Gnulib's <assert.h>, but it thinks <config.h> is needed <RhodiumToad>every other file has that conditional block in it, it's just missing from mini-gmp <civodul>could be that on GNU/Linux we don't use much of Gnulib's header, so it doesn't make any difference <wingo>civodul: great! (re -Wunbound-variable issue) <daviid>wingo: yes there is another problem: the fix fixes the example, the mdule (a) that is in #47084 - however, it doesn't fix dynamic expected functionality of module-use! - that is if the public interface of a module that has been module-used! evolve 'in time', those who module-use! don't see the new bindings, unlike 2.2 - let me paste again, in a few min, i need to reconstruct the paste (which expired) <daviid>wingo: if you catch this before to go to bed, so you dream about a solution :):) - https://paste.debian.net/1195962/ - this feeback depends on g-golf, but i'll build an example/snipset that doesn't and answer in #47084 - good night again