IRC channel logs

2022-06-29.log

back to list of logs

<ArneBab>Can I get push permission for maintenance fixes (like the ones from Lilypond)? I have copyright assignment on file for Emacs; adding them for Guile should now be no problem (all requirements are already met).
<ArneBab>I would like to take up checking those maintenance fixes and pushing them if all tests pass.
***X-Scale` is now known as X-Scale
***dongcarl3 is now known as dongcarl
<butingtaon>Hey everyone, i hope everyone is safe where you are. Just a question: say I'm writing an sexp to a file using pretty-print, how do I embed comments in it?
<butingtaon>I'm writing a program that creates a configuration file that's just an alist, and I want to embed comments that tell the user what each field is for, and so on
<lloda>butingtaon: comments aren't Scheme objects and you cannot output them with write or pretty-print, you need to output them as text. I'd have a list of ( sexp | comment ) or maybe ( sexp | comment | newline ) and a procedure to serialize that.
<butingtaon>lloda: I was afraid that was the case, but thanks much! I have a better idea of how to go about this now.
<jpoiret>butingtaon: Guix has it's own pretty printer that accounts for comments
<jpoiret>its *
<jpoiret>see https://git.savannah.gnu.org/cgit/guix.git/tree/guix/scripts/style.scm#n262
<butingtaon>that's amazing stuff. thanks! I'll probably have to package that one define as its own script in the future.
<sneek>dsmith-work: wb
<dsmith-work>Morning Greetings, Guilers
<dsmith-work>sneek: botsnack
<sneek>:)
<dsmith-work>!uptime
<sneek>I've been running for 13 days
<sneek>This system has been up 1 week, 6 days, 16 hours, 23 minutes
<tohoyn>I need to search for an item in a hash table satisfying a given predicate. If I use hash-for-each the search is not stopped if an element is found. Do I have to use a guard-raise construction in order to stop the search when the first matching element is found?
<lilyp>tohoyn: I don't think there's an API for that, you'd have to dig into the hash internals, lazily list the pairs, etc.
<lilyp>note that whatever you're trying is probably not a good fit for hash tables though and you might want to think of a better data representation
<tohoyn>lilyp: tx
<lilyp>what exactly are you trying to do btw?
<tohoyn>lilyp: I'm implementing a symbol table as a hash table
<tohoyn>for this: http://www.iki.fi/tohoyn/theme-d/
<lilyp>and what'd your predicate be then?
<lilyp>also, can symbols shadow each other? if so, i'd use one hash table per scope
<tohoyn>for example, checking that keys (symbols) are equal
<tohoyn>lilyp: I'm doing that already
<lilyp>okay, what's the problem? hash-ref should work for equality checks, assuming you need only one?
<tohoyn>I typically need a custom equality check for the keys. I have one symbol table that binds addresses (module+variable name+variable number) to values and variables.
<tohoyn>maybe I could use hashx-ref with a custom access predicate?
<lilyp>I don't think that'd work. Also, why not resolve modules to further hashes?
<tohoyn>do you mean using a separate hash table for each module?
<lilyp>That's how it's done naturally, I believe. At least guile has module-obarray which is a hash.
<lilyp>If you don't like that you could just do "module.variable" → 5 and "variable" → 5, assuming 5 is your variable index here.
<tohoyn>ok. I'll go sleeping.
***X-Scale` is now known as X-Scale
***Furor is now known as Colere