IRC channel logs


back to list of logs

<haugh>Okay, thanks mfiano, lilyp
<mfiano>ACTION thinks the in-between would be fixed arity followed by a rest parameter.
<mfiano>so a minimum arity if you will
<mfiano>but one can always ignore me, because I come from CL and have been studying Scheme for a very short time.
<haugh>I want to chain lots of multi-value expressions together and don't like the idea of creating all this garbage. See, the real cruft is how parts of Scheme respect MV and other parts don't, so you have to switch back and forth.
<haugh>receive is pretty good, but it gets clunky when you have to chain them together. srfi-197 is stylish, but it's a little awkward with the placeholders and it doesn't let you splice in a receive
<haugh>so what I need is a helper proc/syntax that generates a correct-arity call-with-values consumer for... an unknown number of values... hahaha
<mfiano>The alternative is to just pre-allocate an object pool you can push to/pull from, and dynamically grow as the upper requirement increases if you want it to not be so static
<haugh>fascinating and terrifying
<haugh>another stack! what could go wrong
<mfiano>Yeah, CL only has receive built in (it's called multiple-value-bind). But for a multiple-value let-like form, that is implemented by users trivially with a macro. I don't know what the situation is for Scheme.
<mfiano>When I get more acquainted here, one of the first things I want to do is write an `mvlet` macro that behaves like `let` except for multiple values, and a single-value returning call would be equivalent in syntax and semantics to a regulat `let`.
<mfiano>I use that pattern a lot in CL, anyway.
<haugh>that's srfi-71, like lilyp mentioned
<mfiano>Yeah, that's not how I usually do it. I keep the syntax the same instead of introducing the 'values' synbol.
<haugh>oh so sort of a mashup between that and srfi-11?
<mfiano>Well in CL, our LET forms look like this:
<mfiano>(let ((a 1) (b 2)) (+ a b))
<mfiano>and our receive is just like Guile's: (multiple-value-bind (a b) foo (multiple-value-bind (c d) bar ...))
<mfiano>and the `mvlet` I usually implement looks like:
<mfiano>(mvlet ((a b (foo)) (c d (bar))) (+ a b c d))
<mfiano>and similarly for the parallel mvlet* variant
<haugh>oh that's interesting
<haugh>funny, looks sort of "inside out" to me and my Scheme-only Lisp experience
<mfiano>In this case, (mvlet ((a (foo))) ...) is the same as (let ((a (foo)) ...), since the second value isn't used. So, you can mix and match LET binding forms in an MVLET form, since it's the segenerate case of a single value.
<mfiano>I don't have a problem with that SRFI though. It makes it a bit more explicit seeing the added 'values' syntax in places where there are more than 1 binding taking place.
<mfiano>In a way I like that.
<mfiano>Actually, reading the rationale in that SRFI is quite enlightening. I hadn't thought of some of the problems it has to solve that don't have to be solved in CL.
<mfiano>Due to Scheme sharing variable and function namespaces, and thus wrapping parens around a form adds some ambiguity.
<mfiano>are part of a bindings-spec that is.
<lechner>Hi, is anyone aware of an example how to use guile-kolam? Thanks!
<lechner>It's for GraphQL
<mfiano>Merry Christmas and happy holidays, everyone!
<mfiano>I have good news. After about a year of a Scheme newbie eyeballing different Scheme implementations, I finally settled on Guile. It won across a few requirements I was concerned about.
<mfiano>Hats of to wingo and company :)
<mfiano>One of my biggest complements is by far the documentation. While it is not the best I've seen, especially in certain areas, it is 1) complete and easy to find what you're looking for and the text is easy to understand, and 2) It's probably the best example of detailed explanations of internal details, which is useful to anyone wanting to write a Lisp compiler. The amount of detail with regard to the
<mfiano>Scheme stack, how and when variables may be boxed, etc is incredibly well-written, and I commend whoever it is that wrote all that up.
<mfiano>These are things that are often left out of documentation because developers didn't deem it necessary, and said developers usually don't even document it properly for themselves in comments, etc. I really like the quality the Guile team is achieving/aiming for. Thank you!
<stis>Greetings guilers!
<stis>Got a fantastic present from my daughter:
<stis>Highly relevant for guile ;-)
<stis>Anyway we mostly give money to charity this christmas as times are tough
<a12l>I'm planning to do Exercism's Scheme exercises for learning Guile. My main use case for using Guile is Guix and scripting GDB. But when I run make guile inside the exercise directory I get a lot of WARNING: (guile-user): imported module (rnrs) overrides core binding [...].
<a12l>Should I mind these error messages, or should I just pipe them into /dev/null?
<a12l>Or do you have an exercise set that fits my use case even better than Exercism?
<stis>a12l: As you want rnrs I think it
<stis>is safe to say that you can just continue on with the exersizes, other warning messages in your quest may be helpful though
<mfiano>stis: hahaha nice
<mfiano>I liked the ice-9 reference when I first saw it. I knew what he meant.
<whereiseveryone>lechner: guile kolam is used in mumi
<whereiseveryone>mfiano: glad you are enjoying guilia
<mfiano>whereiseveryone: Thanks :)
<lechner>whereiseveryone / thanks! i am trying to access exactly that interface with my new bot for the #guix channel
<whereiseveryone>lechner: cool, where's the src for you new bot? I wanna read!
<a12l>stis: Thanks!
<a12l>What's the difference between import and use-modules?
<civodul>a12l: there's none! 'use-modules' is more idiomatic, 'import' is more R6RSish, but it does the same job
<a12l>civodul: Thanks!
<a12l>I get an error message when I try to use pattern matching:
<a12l>What I'm doing wrong?
<a12l>I just want that if `dna` is `""` (empty string), then the function should return the empty string
<a12l>The reference manual doesn't have the simplest example
<a12l>(for me as a scheme newbie)
<flatwhatson>a12l: you have extra parens, should be: (match dna ("" ""))
<flatwhatson>your original is matching a list of two empty strings, and the error is there's no "then" branch