IRC channel logs
2023-02-24.log
back to list of logs
<cow_2001>(pretty-print (macroexpand '(some-stuff-here))) does not pretty print the tree-il. the tree-il is a single object displayed in a #<…> <cow_2001>maybe converting the tree-il into a raw s-exp somehow? <flatwhatson>cow_2001: (use-modules (language tree-il)) (pretty-print (unparse-tree-il (macroexpand '(some-stuff-here)))) <attila_lendvai>can someone please point me to an example where guile is used in a shebang line? i need a complex example that loads dependencies from modules. my problem is that (current-file) returns #f, and i cannot just add-to-load-path at the head of my script. <attila_lendvai>another issue is that even though i have a valid -L entry, i still get a module not found error <attila_lendvai>so, i cannot add a relative path to the guile load path neither from inside the script, nor using -L <attila_lendvai>damn! it's due to something in my environment, because the script i have had for a long while also stopped working due to the same current-file issue... <attila_lendvai>the issue seems to originate from adding two entries to GUILE_LOAD_PATH external to the script. if i don't do that, then (current-filename) works. the entries look ok. <chrislck>has here ever been an obfuscated lisp (or scheme) contest? <chrislck>(let's not include easy tricks like using unicode symbols) <attila_lendvai>i think that would be an endless rabbit hole if you can write code that is run at read time... <attila_lendvai>can this be done better? i.e. by eliminating all references to the deprecated bit-count at expand time? <attila_lendvai>mwette, well, there was an attempt to fix it, but the warning is still there, because the reference is guarded by a runtime if <gtz>All I want to do is to catch an exception and ignore it. How do I do that? It looks like if I use with-exception-handler and raise-exception my exception handler is called but afterwards another exception is called and my program stops <dthompson>gtz: I agree it's a bit confusing. I think you may want to use #:unwind? #t in with-exception-handler <dthompson>the default is to *not* unwind, and if the exception is not continuable, which most aren't, and you do not escape the continuation somehow then you get that second error you mentioned. <lloda>gtz: catch/throw is less flexible but simpler, you can try that <gtz>I think I will just use "guard" <gtz>maybe I just have a trouble calling raise-exception with continuable set to true <gtz>what does this signature mean: raise-exception obj [#:continuable=#f] ? <gtz>why don't they have examples, was it so hard to write 1-2 lines of examples? <gtz>how do I call raise-exception with continuable set to true? <gtz>ok there is a typo!!! instead of "continuable" the signature should have said "continuable?" that is all... <gtz>the only reason i found it is because in the description it says "continuable?" <gtz>otherwise I wouldn't have a clue <gtz>"If continuable? is true, the handler is invoked in tail position relative to the raise-exception call. " That means that the handler can call itself without consuming stack space, correct? <lloda>that depends on how that call happens. All the text means is that there's nothing waiting for the handler to return <dthompson>(with-exception-handler (lambda (e) 'ignore) (lambda () ...) #:unwind? #t) should do the trick <lechner>dthompson / Hi, gnucode in #guix may need some help formatting code blocks in Haunt so that they show up like on your blog <dthompson>lechner: oh thanks for letting me know! I'll follow up with them there. <lechner>maybe that's more of a general #scheme question. i'll ask over there <civodul>is anyone here (presumably a non-Guix person) using Guile 3.0 on top of libgc 8.2.2? <civodul>i wonder if there are any gotchas we should be aware of <lloda>apparently i'm on libgc 8.0.4 <civodul>ok, looks like newer releases weren't as popular as 8.0.4 :-) <gnucode>dthompson: basically some people in #guix strongly encourage me to make my code snippets on my blog (gnucode.me) look more like yours. With some syntax highlighting for code snippets. <dthompson>gnucode: ah, okay. I can point you to how I do that. I post-process my markdown posts to add the highlighting and other stuff. <ekaitz>gnucode: I don't know what dthompson uses for that but prism.js is an interesting option <ekaitz>dthompson: how does that play with screen readers? <dthompson>ekaitz: I don't know but all it does is add css classes so I'd guess it wouldn't be an issue <gnucode>dthompson thanks for the tips. I'm pretty sure you've told me how to do this before... I'll try to actually go and do it this time. :) <dthompson>gnucode: good luck. hope the code is clear! feel free to ask questions <gnucode>dthompson thanks. How's the goblins work coming? <dthompson>gnucode: going well! working on a debugger for it and also doing some guix stuff for the guile wasm project. <old>hey I need to quickly be able to generate C files. I would like to use Guile as a template language like Mako in Python <old>I know that there's autogen that has guile stuff in it. But anything easier? <old>right now I'm just doing dumb stuff with format <mwette>and a parser too, if you want to get used to the element names in the sxml <mwette>I believe janneke uses the c pretty printer in his guix bootstrapper <old>Right. I'm not sure if that's overkill. It does not have to be a 'C' solution. Any template language would do <old>So I can write fix body in the natural language of C for example and do stuff like: {{(call-some-scheme-and-echo-here)}} <old>autogen does exactly that, maybe I could try it again <mwette>Not sure what you want to do. w/ nyacc, you could parse an existing C file, insert sxml in the middle of it, then print it out. Most comments will travel through. <lilyp>I could tell you a project but then I'd have to kill you. <manumanumanu>Oh, I have used it. But outside my use and autotools I have never seen it anywhere. <morganw>I've used it to generate YAML files for GitHub Actions, if that counts. <old>m4 gives me nightmare <old>I will make a simple template transformer in Guile. Very simple to do <old>just wanted to know if it actually exist before <daviid>lechner: wrt guile-lib, any modules, please ask for help without 'quoting' me personnaly <daviid>lechner: although i indeed maintain the package, it is 'has been so far' an admin role - i did not write and do not know well any of the guile-lib modules - wrt htmlprag in particular, we have a few htmlprag experts here, quoting me might have the undesired side effect to 'inhibit' their capacity and wishes to answer ... <daviid>lechner: wrt to your parameter question, 'how can one change a parameter using guile', (as you've been told in #scheme i think) by calling parameterize, see the doc ... now if that will solve your htmlprag quiz, i don't know