IRC channel logs

2023-01-15.log

back to list of logs

<a12l>Is there a noticeable difference between `cons` and `rcons`? Feels more logical to build lists "from the start to the end" (left-to-right), rather than "from the end to the start" (right-to-left).
<a12l>Know that have biases, but what's most common in the Scheme ecosystem?
<rekado>“cons” is much more common than “rcons”
<Aurora_v_kosmose>cons is more common. Default Lisp linked lists are basically stacks by default.
<a12l>Thanks for the quick answers
<mirai>civodul: mwette thanks
<old>Anyone could tell me what `(utsname:sysname (uname))' returns on a macOS?
<old>Something like "Darwin" I suppose
<mwette>it is "Darwin"
<old>Okay thank you
<old>Assuming one passes a `procedure->pointer', applied on a lambda procedure, to a foreign interface which accepts a C function as a callback mechanism. How would you prevent the GC from touching the procedure? Can't use scm_gc_protect_object.
<daviid>old: what i do is define tne the lambda as a noemal procedure define (as in (define (my-ffi-lambda-xx ...) ...)), then i call (define %my-ffi-lambda-xx (procedure->pointer ...)) - then it is 'protected' from being gc'ed
<old>That would do if you have top level definition. What if that is not the case?
<old>Say, you generate anonymous function on the fly
<daviid>old: then you'd need a guardian
<old>My idea would be to keep a list of the procedures
<old>Well guardian would always return the procedures once they are ready for GC. Which is not solving the problem
<daviid>well, you ned to cache the procedure ofc ...
<daviid>iwo, you ned to keep a reference as long as the anonymous lambda 'created on the fly' is callable ...
<old>okay makes sens
<a12l>civodul: It seems that `guix style` remove block comments? Why is that?
<daviid>a12l: you should ask in #guix, and not to 'anyone in particular' ...
<daviid>to get a fast answer ...
<daviid>that is :)
<a12l>daviid: Thanks! But my goal wasn't to get a fast answer, but to write to civodul directly :) We discussed `guix style` here a couple of days ago when I asked about guile style formatters, and they wrote that they wanted to hear about potential issues I'd with it.
<sneek>wb lilyp
<lilyp>thanks sneek, take a botsnack
<a12l>What's the naming convention when you've nested named let-expressions? loop and loop2?
<flatwhatson>a12l: i would refactor it as one loop, or a separate function
<a12l>flatwhatson: Forgot that we've private and public procedures in Guile. I'll post my solutions for feedback later :)
<flatwhatson>a12l: here's an example which would use nested loops in most langs: https://paste.debian.net/1267270/
<flatwhatson>but only one level of named let recursion is needed to do the same thing in scheme
<a12l>flatwhatson: This is what I come up with: https://paste.debian.net/1267272/
<a12l>Realize that I could remove line 8-9
<flatwhatson>common style is to have the bindings on the same line as let, not starting on the next line
<a12l>Seems that if I tried to merge pascals-triangle and pascals-triangle-level it would become a big procedure.
<a12l>flatwhatson: Good to know! It's `guix style ` that does that.
<flatwhatson>i guess it's not a good choice for general scheme formatting yet
<flatwhatson>your implementation looks fine, i'd try to avoid duplicating the (cons ... steps as you mentioned
<flatwhatson>TCO means that "extra" iteration to hit the natural termination is free :)
<flatwhatson>also if you wanted to use something higher-level, see unfold from srfi-1
<a12l>flatwhatson: Thanks! I'll take a look
<sneek>tohoyn: Greetings :)
<tohoyn>sneek: botsnack
<sneek>:)
<old>I'm in the begining of writing bindings of libev for guile-parallel to replace timerfd. Would it be worth it to make a guile-ev instead so that others can use them?
<count3rmeasure>good morning gentle guile folk
<a12l>flatwhatson: I'm trying to rewrite my function using `unfold`, but I'm having problem interpreting what the `seed` is (reading the ref. manual)
<a12l>Not sure what you meant with "TCO means that "extra" iteration to hit the natural termination is free", but it feels that it's important when rewriting the function?
<a12l> https://paste.debian.net/1267296/
<a12l>One of the functions using if.
<lilyp>a12l: the seed argument is an extra argument that you can modify with each call
<lilyp>for instance, (unfold (cute > 0 <>) identity 1- 3)
<Thaodan>Hey is it possible to build guild without generating documentation/texinfo?
<Thaodan>*s/guild/guile
<akirakyle>daviid: Any progress on the g-golf bug of not being able to call functions with an array argument?
<mwette>Thaodan: you could try brute force: mv doc doc-; mkdir doc; echo ".DEFAULT" > doc/Makefile; echo "<tab>true" >> doc/Makefile
<Thaodan>mwette: What about guile-procedures.texi that is used for guile-procedures.txt?
<mwette>Sorry, I don't know. I was thinking about it. If you don't have the tools, maybe kludge replacement stubs.
<Thaodan>I have the tools but guile is a circular dependency, building docs each time isn't useful.
<Thaodan>texinfo is packaged
<mwette>Hmm. I don't know.
<lilyp>A circular dependency? Meaning you build guile to build guile?
<mirai>in https://www.gnu.org/software/guile/manual/html_node/PEG-Tutorial.html , the `pathELEMENT <-- (!NL !C !'/' .)*' peg string corresponds to which of the patterns described in https://www.gnu.org/software/guile/manual/html_node/PEG-Syntax-Reference.html ?
<mirai>I only see square brackets in the syntax reference
<lilyp>mirai: it's the short syntax for (and (* (and (not-followed-by NL) peg-any)) NL)
<lilyp>ah, wait, wrong line
<lilyp>* for any
<lilyp>and the !NL !C !'/' means not followed by any of NL, C or '/'
<lilyp>with . again being peg-any
<lilyp>so you're matching any non-newline, non-slash, non-colon character (and by * string)
<Thaodan>lilyp: yes gcc needs guile, guile needs gcc, texinfo needs gcc. Building docs needs texinfo which adds texinfo to that chain.
<mirai>lilyp: yea but in the PEG syntax manual, I suppose the first quoted string is the "string PEG syntax"
<mirai>but I don't see any of them with parentheses
<Aurora_v_kosmose>GCC bootstrap gets interesting. You can have a look at Guix for how it's handled.
<mirai>is it supposed to be character class?
<mirai>(it's using square brackets there)
<mirai>does this look alright for a first go at PEG? https://paste.centos.org/view/5ea7fe49
<Thaodan>Aurora_v_kosmose: it's not bootstrapping but circular dependencies when rebuilding packages in opensuse obs
<Aurora_v_kosmose>Thaodan: Right. But to be able to satisfy that dependency when building from scratch you need some way to break into the circle.
<Aurora_v_kosmose>At least if you care for reproducible builds.
<mwette>Thaodan: Why does gcc need guile? Can you build gcc w/o guile first time, then again with?
<Thaodan>mwette: If gcc has BuildRequires: guile, it's used during build of course I can remove if it's not necessary but we usually build from version control sources rather than tarballs.
<Thaodan>Aurora_v_kosmose: That sounds like a good idea but a little further than what I'm trying to do.
<Thaodan>I just want to reduce the dependency chain with one less package not fix it (at least not today).
<mwette>In the gcc install notes it says guile is needed to generate fixinc.x and to run "make check" for fixinc. Can those be skipped first time for gcc?
<Thaodan>If you don't build from tarball fixinc.x needs to ben generated. Again this isn't about first time builds but rebuilds.
<daviid>sneek: later tell akirakyle i will fix the missing array type asa i will have fixed the vfunc callback arg type problem, for which i need another day or two - and fixing the missing array interface type is relatively easy, so within the next few days, hopefully ... thanks for your patience ...
<sneek>Will do.
<akirakyle>.
<sneek>Welcome back akirakyle, you have 1 message!
<sneek>akirakyle, daviid says: i will fix the missing array type asa i will have fixed the vfunc callback arg type problem, for which i need another day or two - and fixing the missing array interface type is relatively easy, so within the next few days, hopefully ... thanks for your patience ...
<akirakyle>thanks sneek, have a botsnack
<akirakyle>daviid: Great, thanks for the update! No rush or anything, just was curious where things are at