<Onslauth>Hi guys, I have a quick question about an error being printed out. <Onslauth>I get the following: "(scm_to_stringn cannot convert wide string to output locale 88 #f #f)" <Onslauth>And I know it comes from libguile/strings.c, but looking at the code I cannot see where the "88" comes from. <nalaginrut>well, it's seems another locale string was cut off case <civodul>hey wingo, we need to write a news item at sv.gnu.org for the potluck <wingo>hum, seems i just borked guile <wingo>strange how i can test on one machine and it's fine and on another and it's borked :) <wingo>i mean, worked on one machine, pushed, pulled on another, failed :) <wleslie>sneek2: so you're making trouble for wingo? <nalaginrut>each time it encounters EOF then restart the bot, it failed, but there's pid on server hmm... <wingo>ok, so i just removed the hard stack limit in guile, whee <sneek2>nalaginrut, it means: Sounds good <sneek2>welcome back nalaginrut! you have 1 message. <sneek2>nalaginrut, 2014/02/20 17:52:17 nalaginrut said: yeah I'm working <nalaginrut>alright, I think sneek will be delayed till I say first word <nalaginrut>but sneek2 will give you message when you entered <nalaginrut>I think it's better to check either people entered or say first sentence since leaving a message <nalaginrut>then you can get the message when you still online <nalaginrut>BTW, it's very hard to name a variable, as hard as I'm thinking the name of my baby... <taylanub>And they're more important for variables than for humans, because humans aren't born for a specific purpose! <taylanub>.oO( Good thing we don't call our variables Joe, Susan, etc. ) <nalaginrut>I think it's because human don't have hundreds children, or they have to use $0,$1,$2... for them in a huge family, it's easier <wingo>hum, was hoping that recent stack-related hacking would fix strange build-time segfaults, but no :/ *nalaginrut never encountered segfault when compiling <ArneBab_>nalaginrut: in the past humans were often named after the people they were derived from, making Names some kind of private enumerator ☺ <ArneBab_>normally the names were taken from no longer referenced people <ArneBab_>and the surname provided the namespace for the enumerator ☺ *ArneBab_ did not see its significance till you pointed to it ☺ <neiljerram>I'm still lurking around, even if not saying much... Have been enjoying the recent potluck dishes on guile-user. <neiljerram>The core details are a bit beyond me, but the overall simulation is impressive, and also GDB showing Scheme code! <lloda>compiling ice-9/eval.go seems to take much longer if I use CFLAGS=-O2, does this make sense at all? ***mario-go` is now known as mario-goulart
<wingo>lloda: what libgc do you have? ***dsmith-w` is now known as dsmith-work`
<wingo>7.4 without patches has that weird infinite-loop thing <lloda>ah, it's apparently 7.3alpha2 ***Shozan is now known as SHODAN
<lloda>success, it's already at psyntax-pp <ArneBab_>calling (define (foo) "bar") (procedure-documentation foo) gives #f. Could it be changed to give "bar"? <ArneBab_>that would make it easier to start a function with just the description of what it should do <ArneBab_>(I know that it would mean, that the docstring would double as the return value) <didi>Docstrings are very nice. <mark_weaver>that is how it works, but in that case "bar" is not a docstring, it is the body of the procedure. <mark_weaver>you're specifically asking to modify Guile to allow the docstring to also be the return value? <ArneBab_>it seems inconsistent for the docstrings to no longer work, when I strip away the body of a function. <mark_weaver>well, for starters, it means that it's impossible to write a procedure that returns a constant string literal without that literal becoming the docstring. <mark_weaver>procedures have to have a body. they are not allowed to not have a body. <ArneBab_>wait - it would be possible: Just add a docstring <ArneBab_>is there a usecase for functions without docstring? <mark_weaver>I don't see why I'd ever want to have a procedure that just returns its own docstring. <ArneBab_>I first write what the function should do. Then I commit. Then I add the code. <lloda>or (define (foo) "bar" (error "define me")) ... <ArneBab_>are there cases where docstrings are stripped away (like aggressive optimization)? <mark_weaver>not that I know of anyway. maybe an internal procedure that never escapes could have its docstring stripped, dunno. <mark_weaver>to say that it complicates your use case a lot to add three more characters ( #f) is not a very compelling argument. <ArneBab_>then I don’t see any harm which could be caused by making a function have its docstring as return value if it only has the docstring. <ArneBab_>this is just about consistency, because I stumbled over it <mark_weaver>like I said, it means that you cannot write a procedure that returns only a literal string without having that become the docstring. <mark_weaver>(unless, as you said, you give the procedure a docstring, but that's just a waste for an internal procedure) <ArneBab_>(define (a) "nice!" (display "foo")) √works ⇒ (define (a) "nice") ×breaks <mark_weaver>it means wasted space in the compiled file, among other things, and a misleading docstring. <mark_weaver>as I said, procedures must have a body. to expect to remove the body and have it still work is a misunderstanding. <ArneBab_>the last statement in a procedure is the body <mark_weaver>If you want to continue this discussion, let's move it to the mailing list. <mark_weaver>ArneBab_: since you said this is about "consistency", let me just point out that the current behavior is not inconsistent at all. It's just using a different rule than you seem to think it should be using. <mark_weaver>you seem to think that the list of everything after the (a) are the statements, and the docstring is the first statement (if a literal string), and the last statement is the body. that's false. <ArneBab_>It is only inconsistent when treating the docstring as a first-class citizen. <ArneBab_>that was just careless formulation on my side <mark_weaver>first of all, the body is more than just the last form. <ArneBab_>(which I wanted to make clear with body→return statement) <mark_weaver>the docstring is not the first form of the body. the docstring is not part of the body at all. they are disjoint. <ArneBab_>no misunderstanding, just not worded carefully enough by me <mark_weaver>I think if you understood the rule, you would not claim that it's inconsistent. <mark_weaver>so it makes no sense to say that the docstring could be the same as the body. <ArneBab_>do I understand it correctly that the rule for the docstring is “the docstring is the first statement in the function if that statement is a string, except if the body of the function only contains one statement”? <mark_weaver>the docstring is optional, and it always comes before the body. *ArneBab_ is currently writing the email to the list <wingo>ArneBab_: you probably also want (lambda ()) to work, don't you ;) <mark_weaver>first of all, they are not called statements in scheme. they are forms, which in this case are either definitions or expressions. <didi>Is there a way to have a procedure being called whenever an object is going to be GCed? I have a foreign object which I want to free when it is not needed anymore (I'm using GOOPS). I'm looking at weak hash tables and guardians, but I don't think they can do it. <mark_weaver>the docstring optionally comes *before* the body. the body must be non-empty. <mark_weaver>wingo: he wants more than that. he wants (lambda () "foo") to both return "foo" and have docstring "foo". <wingo>mark_weaver: sure, i was just extrapolating :) <ArneBab_>wingo: I think you showed where the confusion comes from. I don’t want (lambda ()) to work. <didi>mark_weaver: Well... I might be misunderstanding them. <didi>mark_weaver: Let me read the documentation again. <ArneBab_>wingo: that the docstring is disjoint from the body looks to me like an implementation detail, not like a definition about the actual text I write. <mark_weaver>it's not an implementation detail. it's the way the syntax is designed. <wingo>ArneBab_: i just think that the thing you want is silly :) <davexunit>speaking of weak hash tables, I have a segfault issue to fix regarding them. I working off of the assumption that I screwed something up but haven't found the culprit yet. <mark_weaver>ArneBab_: you want two things that are conceptually separate to be able to overlap and be represented by the same syntactic element. that's very sloppy, IMO. <ArneBab_>(define (foo) #f "bar") would be a function which returns a string without having aa docstring <didi>mark_weaver: AFAIU I have to explicit call a guardian to collect objects, right? <mark_weaver>didi: yes, and that's important, because it allows you to do the deallocation at specific points in the execution when your data structures are consistent. <wingo>"it seems inconsistent for the docstrings to no longer work, when I strip away the body of a function." -> nonsensical <ArneBab_>from the usage side it comes down to the question “should it be harder to write a function with a docstring or without a docstring?” <ArneBab_>wingo: I never saw the docstring as something which gets removed from the function before it actually gets parsed. <mark_weaver>ArneBab_: okay, indeed it would be possible to prevent the literal string return value from becoming a docstring, using that hack. but now you're making a common case ugly in order to support your rather strange preferred development style, where you can't be bothered to write #f at the end. <ArneBab_>mark_weaver: so the common case is to have no docstrings? <ArneBab_>so it could make guile add docstrings to some functions which aren’t intended to have docstrings, because they were not written for guile? <mark_weaver>but the thing is, I find your use case, which is the motivation for wanting this strange behavior, to be utterly uncompelling. you want to be able to write stub procedures without having to write "#f" at the end, and you want them to return the docstring as the value in the meantime. <mark_weaver>ArneBab_: because they weren't written for guile, or because they are internal procedures. <mark_weaver>or simply because the programmer hasn't yet written a docstring for it. <didi>mark_weaver: I'm sure there are use cases for it, but for mine it would have been better to have a callback being called whenever was time to harvest it. <ArneBab_>should I just add what you wrote into the email? <mark_weaver>didi: the problem is, guile doesn't know when would be a good time to call your callback. <didi>mark_weaver: Whenever GC happens. <mark_weaver>ArneBab_: please don't quote me in your email. to be honest, I'm irritated, and not being as polite as I should. <mark_weaver>didi: GC could happen almost anytime. it can happen anytime memory allocation happens. <mark_weaver>a lot of those times will be a bad time to call your finalizer. <mark_weaver>finalizers are a very messy business. the only reasonable way to call them is from another thread, but then you have to make sure that your data structures are thread-safe, which is expensive and a lot of work if you don't need it. <didi>mark_weaver: In my case, I don't think so. If no one is holding a reference to it, it's time to free it. <davexunit>didi: it's easy to get yourself in trouble here. I've done it. <mark_weaver>didi: well, you could use 'after-gc-hook' if you're sure you know what you're doing. <didi>davexunit: Thanks for the warning. <didi>mark_weaver: Cool. I'll look into it. <mark_weaver>but fwiw, several experts have been surprised by how troublesome finalization can be. <davexunit>perhaps the foreign call to free the object is to a library that isn't thread safe. <didi>I see. Well, I have other strategies to deal with memory leaks. Even not caring. But I'll see. <davexunit>or calling into a library that uses a different context per thread (OpenGL) <davexunit>doing the finalizing during the after-gc-hook is just bad news bears. <mark_weaver>civodul: am I correct in guessing that the 'after-gc-hook' could be called from any thread? <mark_weaver>and that which thread is not under the user's control? <civodul>mark_weaver: good point, i guess it could be called from libgc's marker thread <mark_weaver>I think in master, it should always be called by some thread that's not a user thread. <mark_weaver>right, but which thread will the async be queued for? <mark_weaver>I think that for the reasons that Hans Boehm discussed in his paper on finalization, finalizers must be called from another thread, or else there will be trouble. <mark_weaver>and the after-gc-hook should essentially be treated as a finalizer. <didi>mark_weaver: Thanks for the additional information. <didi>I'm not yet ready to tackle the memory leak problem but I do use a Channel to synchronize calls between threads, so every call I make to the library happens inside its own thread. <wingo>civodul: looked great, submitted :) <wingo>i moved myself out of the top spot, heh heh heh <tupi>guilers, hello, of topic quiz: anyone has is emacs erc config so that it's running through tor? <stis>wingo: I did a small potluck as well, sniff! <stis>it's not important to include it, but if you want to have a longer list please do ;-) <wingo>civodul: do you know if there is a problem with editing stories on savannah? <wingo>stis: apologies for leaving you out, it was unintentional :) <stis>it's really not a good one, but the theoretical implications of the tool is quite deep <stis>also see the mail that I forwarded to the list <stis>wingo: no hard feelings here :-) ***dunsmoreb_ is now known as dunsmoreb