IRC channel logs

2021-01-06.log

back to list of logs

***daviid is now known as Guest14816
***Guest14816 is now known as daviid
<drakonis> https://github.com/lokke-org/lokke
<drakonis>neat.
<drakonis>clojure for guile
***wxie1 is now known as wxie
<Aurora_v_kosmose>Huh, fancy
***wxie1 is now known as wxie
***sneek_ is now known as sneek
<tohoyn>sneek: botsnack
<sneek>:)
<pinoaffe>hi guilers! if I'm in a guile repl, and something causes an exception, is there a way to do a fixup and then continue execution from just before whatever caused said exception?
<roelj>pinoaffe: Like ",q" and then execute something again?
<pinoaffe>roelj: no, more like pretending there was a breakpoint just before the exception, going back to that point, modifying state, and then continuing
<roelj>Ah, like that. I'm not aware of a method to do that. :(
***matijja``` is now known as matijja
<dsmith-work>Wednesday Greetings, Guilers
<roelj>\o
<ManDay>Hi, what was the correct way to prevent the "imported foo overrides core binding bar" warning? Specifically for imports of rnrs where I do not want to import *except* bar but rather have guile forget about its core binding.
<rlb>ManDay: depending on what you want, a #:hide (...) might work, or an explicit renaming #:select (bar . %scm-bar).
<rlb>oops
<rlb>#:select ((bar . %scm-bar) ...)
<rlb>in your use-modules form
<daviid>ManDay: also, in '6.20.3 Creating Guile Modules', define-module ... #:duplicates ...
<ManDay>daviid: what does have define-module to do with that? I'M not the one defining anything here
<ManDay>rlb: Is #:hide something from master? I can't find it in my guile's docs
<ManDay>i don't understand your other answer, either
<ManDay>Can you give an example what I should put into my (import) (preferably...) or (use-modules) form such that I can use rnrs' `map` without a collision warning
<ManDay>?
<justin_smith>ManDay: what you choose to make visible from outside modules (including the default core bindings) can be considered an aspect of your module definition
<daviid>ManDay: it explains what options are available, related to how to handle duplicates, which you may then apply in a repl if you don't define any module, calling default-duplicate-binding-handler
<ManDay>what do you mean "make visible from outside modules"?
<ManDay>i don't want to set up any handlers. I just want to import rnrs and use it's `map` function without guile interfering and warning me that guile would like to give me guile's map instead...
<daviid>then you have to set default handlers, please read the manual
<ManDay>jeez. can't guile make anything just simple
<ManDay>why does it always have to get in the way
<daviid>it is dead simple
<ManDay>simple, in my opinion, would be if it didn't try to shove its own "core bindings" into my program in the first place
<ManDay>the *next* simple thing would be if I could import rnrs and make clear that it takes precedence
<ManDay>setting up "handlers" for that is plain awful
<ManDay>well, thanks for the answer, though
<ManDay>(though I may not like it)
<justin_smith>ManDay: in the module definition, you can specify #:duplicates and a behavior for handling duplicate imports
<daviid>that '... import and make it clear ...' is precisely described in the section of the manual i pointed :)
<ManDay>justin_smith: *what* "module definition"?? I don't have any module definition! I'm not the person who wrote the rnrs module or the guile core bindings module
<justin_smith>ManDay: in your module, you specify what happens when you put things in it
<ManDay>I DO NOT have a module!
<justin_smith>including what happens if an outside module replaces something you already see defined
<daviid>ManDay: it seems you don't really understand what namespace have been inveted for and how to manage those (very common) situation, but everything you need to know to understand and correctly lead with those ccording to your oen nedds is described in that little section of the manual
<justin_smith>correct me if I'm wrong, but I don't think it's possible for guile code to not have a current module- you're module is the one you are modifying when you import something
<justin_smith>*your
<ManDay>justin_smith: Maybe that's how it's interpreted in the background. My code, though, does not contain any explicit module definition. it's a plain script
<justin_smith>I don't understand what "importing" a binding would even mean without a module to put it in
<justin_smith>ManDay: OK, then you are in the default starting module
<ManDay>for which, there is no "define-module" form anywhere for me to modify
<justin_smith>which means you can change how that module handles conflicts, or create a new one and configure it
<daviid>in these situations, it is expkained in the manaul, you must call default-duplicate-binding-handler
<daviid>you may call it without arg, it returns the default settings, or with an argument, it sets it to your needds ...
<ManDay>daviid: Yes, I got that. And personally, I find that a clusterfuck of set up
<ManDay>And yes, I agree that in a more general setting, the collision handling would be sensibly handled like that
<ManDay>but not if I have never asked for Guile's "core" crap in the first place
<daviid>ManDay: it just shows you do not understand or 'get the all picture', which is fine, but all this is explained in the small section of the manual i poiinted - guile handles this absolutely perfectly and simply
<ManDay>matter of perspective, perhaps. but I'm approaching guile as an interpreter of rnrs, first. I don't approach it as "Guile is Guile and if you want it to work like rnrs you have to make an effort"
<ManDay>daviid: I can't find any documentation of default-duplicate-binding-handler other than a sidenote in (guile)Creating Guile Modules
<daviid>all options are described in the #:duplicates option of the define module, i wrote this in my very first sentence to try to help you
<ManDay>Well, I don't get it to work. I tried (set! default-duplicate-binding-handler (list 'last)) but I still get a warning.
<ManDay>And I can not at all see anything in the docs which would explain why you mentioned "calling" it, earlier
<ManDay>oh I may have to set it to a procedure, perhaps... (set! ddbh (lambda () (list 'last))) ...
<ManDay>no success either
<ManDay>well, guile won. I'll just use its "core binding" then
<daviid>ManDay: the call is like this (an example, you need to adjust to your own needs) - (default-duplicate-binding-handler '(merge-generics replace warn-override-core warn last))
<daviid>Mandau you d'ont call set! ... just (default-duplicate-binding-handler '(...))
<ManDay>daviid: thanks. but honestly: how could I have read this out of the documentation?
<daviid>have to go afk a bit bbl ... other will help i hope ...
<ManDay>i hope you already gave me all the help I need
<ManDay>i think ^
<daviid>others will help, just try to find the proper set of options to satisfy your needs ... bbl
<ManDay>well, thanks again
<ManDay>bye
<leoprikler>Interesting, so there's #:hide as well? Since when does that exist?
<civodul>since forever!
<dsmith-work>It's hidden of course..
*davexunit had no idea about #:hide
<dsmith-work>So a quick C-x v g in boot-9.scm shows:
<dsmith-work>67b8b6fb06 module/ice-9/boot-9.scm (Wilfred Hughes 2016-09-05 3280) #:hide BINDINGS
<jlicht>wow, lokke is already really fun to play with!
<leoprikler>I think #:hide should be documented. It would certainly help some cases, where you don't actually want core stuff to be changed.
<dsmith-work>Only 3.5 years ago...
<dsmith-work>But it was probably in before that
<dsmith-work>c614a00b8c ice-9/boot-9.scm (Mikael Djurfeldt 2003-03-11 3301)
<dsmith-work>17 years
<civodul>jlicht: d'you have a package? :-)
<jlicht>civodul: not yet, but all the easy nitpicks have already been picked up by somebody else on the issue tracker ;-)
<civodul>heh :-)