IRC channel logs
2023-11-10.log
back to list of logs
<dsmith>apteryx, readelf -wl <some-file.go> <rebiw>Is the following scheme syntax not valid in scheme?? <rebiw>(define-record-type <some-type> (fields (mutable a b c d))) <haugh>rewbew it's (drt <some> (make-some a b c d) (a get-a set-a!) (b get-b set-b!) etc...) <haugh>rebiw, that's the SRFI-9 record type available via (use-modules (srfi srfi-9)) <rebiw>yes I'm familiar with that syntax, I read the other syntax in a book and it seems way more convenient. <haugh>Gotcha. I whiffed the predicate too, so maybe you have a point <rebiw>I need to create a setter for each field using the guile syntax. <rebiw>ah, define-record-type, maybe I will look into it. <rebiw>Yes, that is the syntax that I was trying to use, thanks!! <rebiw>Ke0vvt,what issue are you having with your site? <rebiw>you have a temporary file with an extra ~ <rebiw>maybe the reader is having trouble with this file. <KE0VVT>rebiw: That doesn't make a difference. <rebiw>When using Haunt I use #:file-filter ignore-some-files-filter, to ignore some files, css, etc. <rebiw>You have to create the filter. <KE0VVT>rebiw: #:file-filter ignore-some-files-filter "*~" ;; Like this? <rebiw>(define (ignore-some-files-filter post-filename) <rebiw> (not (string-match "\\.(scss|js|hbs|html)$" post-filename))) <rebiw>You define the filter, then you specify it in the site function. <apteryx>dsmith: I think I could make it work; but I'm not sure yet if it covers all potential cases <apteryx>dsmith: ah, readelf -wl output is great <apteryx>if you do: ./meta/guile -L test-suite -L . test-suite/tests/compiler.test do you see 3 FAIL, with exit status 0? <apteryx>what's the deal here? are these real failures or not? <apteryx>I made my parameter a fluid so that I could define it before the (primitive-load-path "ice-9/psyntax-pp") in boot-9.scm <apteryx>sent patches against the original bug report <apteryx>now I can get back to hacking adding SRFIs :-) <isaneran>is there a way to declare a module in other contexts than the top level like for example in racket and chez? <wingo>isaneran: sadly no. would be nice! <isaneran>wingo: yeah it would! I wonder if I can macro it in to make nanopass framework work on guile <isaneran>I think maybe by using save module excursion plus some module reflection should enable some kind of module macro <isaneran>hmm guile seems to scream at me if I call module-export with a list of module variables, or a list of symbols or a list of pairs of symbols <isaneran>(module-export! m (list (cons 'foo 'foo))) <RhodiumToad>I'm pretty sure it wants the names of the variables, not the values <isaneran>In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): #f <RhodiumToad>you checked that the result of resolve-module was not #f ? <isaneran>ice-9/boot-9.scm:1685:16: In procedure raise-exception: <isaneran>and (module-variable m 'foo) is #<variable 7f3e4894ec30 value: #<procedure 231fd98 at <unknown port>:67:46 (lol)>> <isaneran>idk if it matters but, the context is a guile repl via geiser <isaneran>can I create a module with reflection another way? <isaneran>oh it's resolve-module, not module-resolve <isaneran>either way, I used the one that exists :p <isaneran>do you think it is an incorrect way to create a module? <RhodiumToad>the problem is that the created module has no public interface yet <isaneran>yeah I do get #f if I call (module-public-interface m) <RhodiumToad>you want to create a basically empty module to populate using module-* funcs? <isaneran>so that I can implement a macro that works like (module ... ) in chez and other r6rs impls <isaneran>or at least a good enough subset to port nanopass to guile <isaneran>either way thank you, I think I can work with that <RhodiumToad>make-fresh-user-module is mentioned in the docs for define-language, but not anywhere else afaik <RhodiumToad>(which is the function that (define-module) expands to) <isaneran>but I guess source code is the best documentation <isaneran>that procedure seems to call beautify-user-module! <isaneran>I wonder if that sets the public interface <RhodiumToad>fun fact: the public interface is just another module object <isaneran>since the type that gets printed in the repl is interface <isaneran>hmm I guess define-module* doesn't necessarily make my life any easier since it doesn't allow me to inject code to initialize it <isaneran>I probably need to handle the (define subforms to expand to module-define! somehow <isaneran>are macros expanded from the inside out or from the outside in? <RhodiumToad>i.e. (foo (bar x)) where foo and bar are both macros will not expand bar unless it appears in the expansion of foo <isaneran>you mean if foo searches for the bar pattern? <RhodiumToad>or for example it could quote that part, in which case the literal '(bar x) would appear in the expansion <isaneran>hmm ok my strategy might not really work <isaneran>since the (module ..) code in nano pass contains macros that expand to define forms <RhodiumToad>that might not be easy to handle in hygienic fashion <isaneran>although that is the only macro helper it uses <isaneran>I could maybe just reimplement that one to expand to the right thing <isaneran>or maybe I can hack and call macroexpand or something haha <isaneran>maybe it is enough to just expand to a (define-values (a b c) (lambda that returns the definitions with (values a b c))) <isaneran>feel like search engines barely give any useful information anymore almost <old>isaneran: try GPT you would be suprise how well it knows Guile <isaneran>though it also just makes shit up a lot of the time <old>that's also true :-) <old>Typically when an API change all the time, ChatGPT often generate code that worked with last version but not the current <old>fortunatelly, the Guile developers are no API breaker <isaneran>;;; unknown location: unexpected syntax in form () <isaneran>I don't think I know guile well enough to polyfill the guile compat stuff for nanopass framework <apteryx>what's the difference between guile-lib's shtml and sxml formats? <apteryx>which one should I prefer for a conversion job (html->texinfo) <apteryx>I'm guessing sxml, but I'd like to know how they differ exactly <apteryx>hm, reading the source it seems shtml is a new improved addition over sxml... I guess I'll try using it first. <isaneran>hmm I barely see any references to shtml in the manual <isaneran>ahh so shtml is the (texinfo html) module <isaneran>;;This module implements transformation from @code{stexi} to HTML. Note <isaneran>;;that the output of @code{stexi->shtml} is actually SXML with the HTML <isaneran>;;vocabulary. This means that the output can be further processed, and <isaneran>;;that it must eventually be serialized by <isaneran>so if you already have html, I am guessing by reading it in as an sxml it is already shtml by convention <apteryx>hm, I don' think so, there is 'html->shtml' as well as 'html->sxml' procedures <isaneran>I don't see either of them in the default distrobution <sneek>I've been faithfully serving for 2 days <sneek>This system has been up 31 weeks, 6 days, 24 minutes <KE0VVT>In Haunt, how do I make blog post URIs in the form of /1970/01/01/title? <apteryx>sneek: later tell isaneran see info '(guile-librey) htmlprag)', which mentions both html->shtml and html->sxml