IRC channel logs

2017-01-30.log

back to list of logs

***micro`_ is now known as micro
<jmd>Is this still true: "Guile has no understanding of multi-byte characters, and string functions won’t recognise character boundaries in multi-byte strings." ??
<ft>(string->list "föo") → (#\\f #\\ö #\\o)
<ft>That's in a UTF-8 locale.
<jmd>ft: So the answer to my question then is "no" ?
<ft>jmd: Yes. That o-umlaut is a multibyte character in utf-8 encoded strings.
<ft>"c3 b6" to be exact.
<jmd>Ok. So that sentence needs to be removed from the manual then.
<ft>Oh, yes. I think that whole paragraph can be ruled out.
<janneke>how can I re-use symbol import renaming like this, over several modules?
<janneke>#:use-module ((oop goops) #:renamer (lambda (x) (if (eq? x '<port>) 'goops:<port> x)))
<janneke>i failed to use a pre-defined goops-rename function in stead of the lambda
<lloda`>janneke: I can't answer that, but you could also use #:select ((<port> . goops:<port>))
<nee`>htop
<janneke>lloda`: thanks...I could not find a wildcard/rest option for #:select
<janneke>...don't really want to enumerate all other symbols
<lloda`>you want to prefix every symbol in the module or only some? there's symbol-prefix-proc which works for me, otherwise the r6rs (import) form has a (prefix) subform
<lloda`>also may this be your issue? https://www.gnu.org/software/guile/manual/html_node/Eval-When.html
<lloda`>re: not being able to use your function in #:use-module
<jmd>What magic do I have to perform to get a utf8 encoded string to display properly?
<jmd>(display "Grüß") for example?
<daviid>jmd: look for setlocale and set-port-encoding! in the manual
<lloda`>that works out of the box here. What do you get from (setlocale LC_ALL)?
<lloda`>ah late ;p
<daviid>lloda`: you're using 2.2, in 2.0 it needs to be set to work
<jmd>daviid: Ahh set-port-encoding! is what I need. Thanks.
<jmd>lloda`: Indeed one would have expected setlocale to have taken care of this, but that appears not to be the case.
<jmd>- at least not in Guile 2.0.13
<daviid>cmhobbs: refering to some passed log, any reason why you're not using the latest stable? 2.0.13 has major iprovments against 2.0.11
<daviid>jmd: 2.0 does _not_ use utf8 has its default encoding, you have to tell guile ... 2.2 does ...
<cmhobbs>daviid: because i haven't updated?
<cmhobbs>ACTION shrugs
<cmhobbs>debian stable ships with 2.0.11
<cmhobbs>the last time i installed guile with guix, it was 2.0.11
<cmhobbs>the emacs that i compiled myself (and needs updating, too) can't find the guile binaries that guix provides
<cmhobbs>i just needed to hammer some code out and used what i had on hand
<lloda`>daviid: good to know, I moved to 2.1 ages ago
<lloda`>daviid: I wanted to ask, since you found out about repl-print in (system repl common), did you also find what one needs to fix to truncate output in error messages?
<daviid>lloda`: does it not work for error output? i mean using truncate-print ...
<daviid>cmhobbs: i would talk to #guix about that, why not the emacs package from guix?
<cmhobbs>cmhobbs: guix's package is probably up to date at the moment, i installed this months ago
<cmhobbs>and i built emacs from source before i had installed guix (again, many months ago)
<daviid>cmhobbs: ok, just being curious, but you probably should try to use the latest stable, and using guix but 2.0.11 is kind of ironic :)?!? guix has guile-next by the way ... guix has everything you need to hack using guile... obviously :)
<jmd>guix has 2.0.13
<daviid>lloda`: truncated-print [not truncate-print]
<daviid>jmd: guix has guile-next as well, which today is 2.1.6
<daviid>lloda`: have to run, bbl, here in the repl this above mentoned fix also works for errors, but maybe you're talking about changing (current-output-port), then i didn't try that...
<janneke>lloda`: i'm going to try eval-when, thanks
<janneke>my use case is that i only want to prefix /one/ symbol
<janneke>and don't want to duplicate [the implementation of] that renamer-lambda in every module
<lloda`>sneek: later tell daviid I use this in my .guile http://paste.lisp.org/+78MJ and it doesn't work on errors. E.g. > (make-array 0 2000) will go through the hook but (throw 'hello (make-array 0 2000)) will print the full array.
<sneek>Will do.
<lloda`>janneke: you could define a module just for the rename and re-export the prefixed names to everyone else
<lloda`>dunno
<janneke>lloda`: yes...
<roelj>How can I make sure code uses the ice-9 'format' instead of the standard 'format' function?
<roelj>Does this automatically happen when I add #:use-module (ice-9 format)?
<random-nick>yes
<random-nick>when you use a module that exports a binding with the same name as something in you environment, it'll overwrite it
<roelj>random-nick: Ok, thanks
<davexunit>civodul: I can't tell, is kastrup angry with you on guile-user?
<civodul>davexunit: seems like it :-)
<civodul>but apparently i wrote something stupid
<civodul>lemme check
<roelj>My format line is larger than 80 characters, can I split it up some way?
<lloda`>(string-append "first part" "second part")
<lloda`>you'll get a warning though :-(
<roelj>lloda`: Well, it wants a string that isn't dynamically put together I believe
<roelj>lloda`: "just" a warning indeed :)
<lloda`>yeah
<roelj>Is there another way without the warning?
<roelj>Actually, I don't get the warning anymore..
<davexunit>the partial evaluator ought to be able to figure that one out
<civodul>it can't, because Scheme strings are mutable, unfortunately
<civodul>IOW, (string-append "a" "b") cannot be reduced to "ab"
<davexunit>yeah but nothing else refers to those things in this case
<davexunit>so it ought to be reduced
<davexunit>maybe only the compiler can do that
<civodul>but it's passed as an argument to a function that could do anything with it
<davexunit>I suppose
<davexunit>I don't see how that's different than passing a string
<davexunit>you're still passing a string to a function that could do anything
<davexunit>pre-evaluating the string-append seems fine. I guess I'm just not getting something.
<civodul>the function could want a fresh string that it can mutate
<civodul>or it could check the pointer identity of the string
<civodul>things that are rare in practice, but possible
<davexunit>if only we had immutable strings...
<civodul>yeah
<civodul>life would be so nice!
<roelj>that'be great indeed!
***dje_ is now known as xdje
<daviid>what is the name of the math operation which consists of taking values in a cetain range and -> another range, like from [0.0 255.0] -> [0.0 1.0] ? is it normalizing/normalization ?
<sneek>daviid, you have 1 message.
<sneek>daviid, lloda` says: I use this in my .guile http://paste.lisp.org/+78MJ and it doesn't work on errors. E.g. > (make-array 0 2000) will go through the hook but (throw 'hello (make-array 0 2000)) will print the full array.
***dje_ is now known as xdje
***random-nickname is now known as random-nick
<paroneayea>heya davexunit