IRC channel logs
2017-06-14.log
back to list of logs
<reepca>Does the #:select part of use-modules only work with exported symbols? <ijp>I would assume so, but it occurs that I've never bothered to check this assumption <reepca>Well, I assumed otherwise, and just now bothered to check it - as far as I can tell it does indeed only work with exported symbols, which was a bit confusing as the reference spoke about a "custom interface" as opposed to a "public interface", but it seems that actually just means a subset of the public interface. <ijp>reepca: it is possible to access "private" bindings, if that is your goal, or was this just idle curiousity <reepca>I was just looking for a more convenient way to do it <OrangeShark>on reddit there was a post about functional programming and object oriented programming. It was mostly on how you handle dependencies in these languages, so for something like a database or a logger. OOP usually has dependency injection while FP would have to pass in the dependencies to each function. Some people mention using closures and others mention how haskell has this sort of thing which you just add to <OrangeShark>the function signature. What would be the guile/lisp way to handle this? <random-nick>OrangeShark: well, wouldn't the solution in guile be to make a record then have the functions take the record as the first argument? <OrangeShark>but then you have to pass that record everywhere you eventually need it. <roelj>I keep on running into this.. Is there a way to (define-public (symbol->string ...) ...) in a map-style way? <roelj>Like (map (lambda (pair) (define-public (string->symbol (car pair)) (cadr pair)) ...)? <random-nick>OrangeShark: well, if you need it a lot of times in a block of code then you can make it a parameter and define a with-<record> macro <quigonjinn>roelj: i think you need to write a macro for that. <roelj>quigonjinn: How would that look like? (define-syntax-rule (define-public-for-each list) (primitive-eval `(define-public ...)))? <roelj>I'd love to see the macro though <roelj>And this means that Guile evaluates all code in *.scm files it finds.. <ArneBab_>hey, Guile is fastest in one test of ecraven: pi (though it looks like a very close win, a tie between guile, chez and petite, could change on the next run): <roelj>quigonjinn: Wow, that is really cool <ArneBab_>cmaloney: makeworks really well for me, regardless of the environment. I wish that every project would at least include a Makefile which tells me the commands I need to build it (even if it just shells out to another build system). <cmaloney>ArneBab_: Agreed. I can at least parse a Makefile <cmaloney>though I have seen certain projects go way too far with Makefiles where it becomes too opinionated <cmaloney>(one of the projects I worked on has a Makefile that the developer created which made installing one way really nice, but downloaded a bunch of files to make a mini-pypi) <cmaloney>(which was great if you were on ubiquitous wifi like he was, and absolutely sucked if you were using, say, Subway Wifi with a bunch of other folks on a PyOhio Sprint) <CustosLimen>is there a simpler way to do this: (car (cdr (cdr (list 1 2 3)))) ? <cmaloney>CustosLimen: What are you looking to do? :) <cmaloney>how portable do you need it to be? Guile-specific OK? <roelj>CustosLimen: (list-ref lst n) <roelj>And for the last (list-ref lst (length lst)) <cmaloney>I'm planning on presenting for my local UNIX user group in July <cmaloney>But I'm also covering Racket so that's why I asked if you wanted something guile-specific or something more portable <cmaloney>because I _think_ Racket has last baked in <CustosLimen>it does not happen often - just sometimes - and its not easy for me to figure out what call path results in realloc from inside parse_expression() <CustosLimen>or I mean - it does not happen in all cases where regex is parsed <CustosLimen>but anyway - simple test case is not really doing it <CustosLimen>rebuilding with ggdb3 on solaris now - hopefully I can get some more details of call path to realloc that is leaking <cmaloney>I think you'll need to subtract 1 to get the last item of the list if you use length <roelj>I have a list '(a b c d e f) and a 'g. I'd like to make pairs like so: (a . g) (b . g) (c . g) ... <roelj>What's a convenient way to do it? <cmaloney>Thinking you might want to use map for that <cmaloney>(he said, looking up how to use map for that) <roelj>(map cons '(a b c) '(g g g)). But I don't want to repeat g.. <cmaloney>You might need to make a function that takes the value from '(a b c) and returns the list (a . g) <bavier>(map (cut cons <> 'g) '(a b c d e f)) <bavier>but a simple lambda would work fine too <roelj>Like so: (map (lambda (v) `(,v . g)) '(a b c d e f)) <cmaloney>Ah, that's the first I'm seeing the backtick syntax. Thanks for that. <ijp>cmaloney: srfi 1 has last & last-pair <cmaloney>ijp: tx. I'm still feeling around what is available to me <cmaloney>like moving into a new kitchen and seeing where the utensils are <cmaloney>(Hey, the C Language has this awesome drawer full of knives and shotguns!) <ijp>you should become very familiar with srfi 1 <cmaloney>Thank you. I'm still in the learning phase so I'm not sure which drawer has what utensils. <cmaloney>I think guile has some of these already baked in if I'm understanding properly <paroneayea>geppy is a participant in the W3C Social Community Group, and working on an ActivityPub implementation <paroneayea>they're going to look into helping with Pubstrate / the ActivityPub test suite <geppy>Thanks! I'm new to Guile, I've mostly just played with Racket. <ArneBab_>cmaloney: I also saw quite a few horrible Makefiles, but I actually went from Makefiles to cmake, scons, and waf, to return to Makefiles in the end — or rather: to full autotools because the files from all the other tools get more cluttered over time and none of them can provide a distcheck. <cmaloney>ArneBab_: I think you're right, and I'm glad you're working on a solution <cmaloney>geppy: Awesome to see more work in the ActivityPub space! :) <cmaloney>geppy: I'm new to Scheme / Guile / Racket as well so you're in good company. <catonano>ArneBab_: how hard would it be to add support for Guile projects to your Conf ? <OrangeShark>catonano: looks like it should be simple, you just make a guile template <cmaloney>ACTION just gave away his age I think. :) <ArneBab_>OrangeShark: thanks! It’s currently pretty incomplete, but with bash projects it already gives a great start. <ArneBab_>catonano: it shouldn’t be too hard, but the required first step is always to have a really good autotools setup. <OrangeShark>ArneBab_: I will definitely download it and give it a try when I have the chance to. <ArneBab_>OrangeShark: one thing I really like is that this creates makefiles with nice help output <ArneBab_>also it auto-creates an AUTHORS file and the ChangeLog <OrangeShark>I have a half written blog post on setting up a guile project with autotools <OrangeShark>ArneBab_: it uses the vcs to generate that? I think I saw something about vcs in your repo <ArneBab_>yes. Currently it supports git and Mercurial (and the git line is quite long and was pretty hard to put together) <ArneBab_>it also provides a template for the NEWS file <ArneBab_>the reason to start with bash is that conf itself is written in bash (to execute a Makefile you need a shell, so requiring a shell to run conf does not add new dependencies) <OrangeShark>makes sense, something like this you would want to try to minimize the dependencies <catonano>OrangeShark: I can't wait to read your blog post about setting up a guile project with the autotools <catonano>I set up one suc project recently and I feel this is an area that needs iimprovement <dsmith-work>cmaloney: Sorry. Was a /wi typo. Was curious that you mentioned PyOhio <cmaloney>so Columbus is ony a few hours drive for us <dsmith-work>cmaloney: I did some work in Auburn Hill a while ago. (wow. has it really been 15 year ago?) <cmaloney>Didn't happen to start the whole Agile revolution did it? :) <cmaloney>Reason I mention agile was (iirc) some of that methodology came about from working with Chrysler. And I had first-hand experieince with Chrysler and a severely-hampered Waterfall process (which is where came to appreciate more agile methodologies) <catonano>now, for example, my tests won't run :-/ <catonano>paroneayea: I don't know. The default one <catonano>or maybe the one indicated in guile-gcrypt's autoconf files <paroneayea>catonano: you'll need build-aux/test-driver.scm for that to work <ijp>Does anyone remember how to add the files to the commit message in magit per usual convention <catonano>paroneayea: there is one. I guess it's the one that was in guile-gcrypt. I'm woring on a cloned repo, ater all <catonano>paroneayea: there was a missing paren :-/ <paroneayea>catonano: I find rainbow-delimiters in emacs helps me track those down if you're an emacs user, btw <catonano>paroneayea: I am. I use to highlight the matcing paren. Probably rainbow-delimiters could help in a more proactive way <paroneayea>ACTION uses smartparens instead of paredit... paredit is too strict for me <catonano>random-nick: I got away rom paredit because if I got wrong a paren couple, it would get angry and not letting me remediate <paroneayea>it's like paredit but it doesn't get mad if you do traditional text editing <catonano>random-nick: sometimes you need to erase a paren that's too much ;-) <catonano>paroneayea: right. I'll have to deepen my knowledge of its key chords <random-nick>yes, it should highlight the extra closing paren in red and let you delete it <catonano>random-nick: maybe I don't rememberr correctly. What I rememberr is that I used to get stuck and had to disable paredit or maybe close Emacs alltogether <catonano>okk the good news is that a test of mine passed. It's my first time ! <ijp>great, closures are being converted now <rekado_>you can input unbalanced parentheses with “C-q (” or “C-q )” when paredit is enabled. <rekado_>the only time I end up with unbalanced parens is when I used hippie-expand and it expanded a line with invalid parens. <rekado_>in that case I use C-q to close parens manually. Or I select and hit C-w on the paren group that is too much.