IRC channel logs

2015-03-16.log

back to list of logs

<nalaginrut>morning guilers~
<musolinoa>Does anyone know if it is it possible to do multiword completion via guile's readline interface?
<wingo>musolinoa: what is multiword completion?
<musolinoa>wingo: I don't want the completion to restart once I've typed a space.
<musolinoa>wingo: My particular example is a prompt for a person's name. The completion list is a list of strings, each string contains a person's first and last name, separated by a space.
<wingo>i think readline itself probably doesn't know if your completion is a word or not
<wingo>so you can put in completions that have spaces i guess
<wingo>but i haven't tested :)
<musolinoa>You can, but once you've completed up to the first name and the space, the completion list resets.
<wingo>hmm
<musolinoa>For example, if I have two people in my list called "Andrew Johnson" and "Andrew Smith", once I've typed "Andrew " at the prompt the completion list resets. Instead, I want it to only show those entries with a first name of "Andrew".
*wingo looks
<wingo>musolinoa: i don't think that guile's readline support can do that unfortunately
<wingo>i think you would need to set the C rl_basic_word_break_characters symbol to \\n or something
<wingo>but only within the scope of the readline call to your port
<wingo>because completers are called on words and not on the whole line
<wingo>maybe if we bound rl_copy_text or something so you could get access to the current line
<wingo>musolinoa: ah! you can get at rl_line_buffer using the ffi :-)
<wingo>terrible
<musolinoa>wingo: What is the ffi?
<musolinoa>Oh, "Foreign Function Interface".
<wingo>what guile version are you using musolinoa ?
<musolinoa>Heh, that is a pretty disgusting way to go about it. Oh well, I'm doing this in Scheme so I can learn Scheme.
<wingo>yes it is disgusting indeed :)
<musolinoa>2.0.11
<wingo>sometimes i would want a scheme-only readline interface...
<wingo>can't be all that hard for our purposes
<musolinoa>Is there somewhere we can request improved readline support in guile?
<wingo>sure, send a mail to bug-guile with specifics or to guile-user with discussion topics
<wingo>musolinoa: http://paste.lisp.org/display/146315
<wingo>getting the int value is pretty nasty
<wingo>sorry about that
<wingo>but anyway, it does seem to work (tested locally)
<wingo>so you can produce completions depending on the (current-line-buffer) instead of the word passed in to the completer function
<wingo>hmm, i wonder if we shouldn't just move our entire readline implementation to the ffi...
<lloda``>how can I write a float/double as hex?
<musolinoa>wingo: Thanks for your help. I'll try the FFI approach for now. Might follow up on one of those mailing lists later.
<musolinoa>lloda``: Check out byte vectors and the associated float/double conversion functions.
<lloda``>ugh, I hoped there was something specific
<musolinoa>lloda``: What's not specific about that approach?
<musolinoa>lloda``: This seems to work: http://paste.lisp.org/display/146316
<wleslie>wingo: where can I get an IA64 system?
<wingo>wleslie: dunno :) currently doing a gdb thing and i have to think about them
<civodul>Hi Guilers!
<wleslie>hi ludo!
<wleslie>I was hoping that as Tukwila matured I'd be able to have an itanium workstation in a tower form factor, for less than the price of a small car. But both Intel and HP seemed to prefer death.
<wingo>greets civodul
<lloda``>musolinoa: sure, that works, I appreciate the effort.
<nalaginrut>oh, it's terrible... http://www.ex-parrot.com/pdw/Mail-RFC822-Address.html
<wleslie>false positives are not your problem
<dsmith-work>Morning Greetings, Guilers
<serhart>slowly getting there
<serhart>whoops, wrong room :(
<wingo>:)
***dje is now known as xdje
***michel_mno is now known as michel_mno_afk
<sirgazil>Hi all :)
<sirgazil>I'm learning to program in Guile Scheme and currently reading practicing unit testing with SRFI-64.
<sirgazil>*and practicing
<sirgazil>How do I make the default test runner in Guile to run my whole test suite? I put all tests in a tests directory (see https://bitbucket.org/sirgazil/guilelab/src)
<davexunit>sirgazil: not sure. in guix, we run the individual test files
<davexunit>and 'make check' runs them all
<sirgazil>mmm, I'm doing that, but with $ guile tests/file.scm
<sirgazil>It works for that specific file, but I'd like to run the whole thing.
<sirgazil>And I don't know anything about make :)
<sirgazil>but thanks, davexunit, I'll check guix for how to use make check.
<sirgazil>Another question in the context of SRFI-64. I see in projects using Guile that test names and group names are hyphenated, but I'm writing those names as if I were writing prose, For example:
<sirgazil> http://ur1.ca/jx7ju
<davexunit>sirgazil: it's a matter of preference, I guess.
<sirgazil>Could that be a problem? Although I don't get any errors, and test logs look more human-readable.
<sirgazil>Ah ok
<davexunit>I think saying "test" in each one is redundant
<sirgazil>hmm, I think you're right.
<davexunit>you could adopt a more "spec" style of writing tests
<sirgazil>And speaking of preferences, is there any programming style guide for Guile Scheme? I can't seem to find one.
<davexunit>sirgazil: this is probably the most "canonical" style guide that you will find: http://mumble.net/~campbell/scheme/style.txt
<davexunit>this is for scheme in general
<sirgazil>I'll read that one.
<sirgazil>thanks.
<davexunit>perhaps the guile manual could have some opinions about good conventions for Guile in particular.
<davexunit>like "Avoid car/cdr, use match (see Pattern Matching) instead"
<davexunit>^ contrived example
<sirgazil>davexunit, with a more "spec" style for writing tests you mean thinking about specifications? Any readings you can recommend? I'm new to unit testing (and good programming :)).
<sirgazil>Or I could just check you repositories :)
<davexunit>sirgazil: http://betterspecs.org/
<sirgazil>great!
<davexunit>I'm used to the rspec testing library for ruby
<davexunit>note that I don't particularly subscribe to this style
<davexunit>my scheme tests follow the way guix names things
<davexunit>but, if you like the prose style, then I think you'll like some of the guidelines given in that link
<sirgazil>I see.
<sirgazil>davexunit, I'll try (again) sly today. Yesterday I was getting an error about freeimage not found, although it is installed. I'll let you know how it goes.
<davexunit>hmmm, lemme know.
<davexunit>freeimage doesn't have a pkg-config file, so I have a crude test to check for it
<davexunit>if it fails, we can try to improve the test
<davexunit>and you can simply remove the check from configure.ac so you can move on with life. :)
<daviid`>davexunit: could be that sirgazil did not install freeimage devel files/packages maybe? or they are installed somwhere /etc/ld.so.conf is unaware? the solution you use in your configure.ac file is fine I think
<davexunit>daviid`: that's possible.
<sirgazil>daviid`, davexunit: I installed the dev package with debian's apt-get and also installed freeimage with Guix.
<daviid`>wrt changing my 'common' [bad] project name, i'm thinking more and more to use 'grip': Some have suggested the name comes from the 1930s–40s slang term for a tool bag or "grip" that these technicians use to carry their tools to work [https://en.wikipedia.org/wiki/Grip_(job)]
<daviid`>sirgazil: guix i don't know, but debian sometimes you need to install the -dbg files, maybe it is the case for freeimage, don't know though
<davexunit>daviid`: that part isn't necessary.
<davexunit>what sirgazil has done is enough
<daviid`>ok
<davexunit>I'd like to know why the configure test fails
<daviid`>yes, i'd like too [learning the autotools...]
<daviid`>wrt grip, i could even try to find a nice acrnyme ? english native speakers help welcome :) grip: guile ...
<daviid`>grip or grips, that is the question! haha
<dsmith-work>So a grip is like a toolbox?
<daviid`>dsmith-work: at least as the origin of the [slang] name suggests, in the 30's, yes. it seems along the years, it became grips, as the denomination of the technicians working on the lighning part of movie making
<daviid`>i like that 'grip' name and its original signification is perfect: '... a tool bag ...'
<dsmith-work>a Grip of Really Important Packages ?
<dsmith-work>s/Important/Instrumental/
<daviid`>dsmith-work: nice! a bit too much 'ego' maybe? but i new you were an expert in naming things, after the make story... :) tx for helping
<daviid`>or maybe not, how does it sound wrt to 'ego' for you and native speakers ?
<dsmith-work>daviid`: Made up stuff like this is supposed to be obviously made-up.
<dsmith-work>daviid`: My opinion
<daviid`>a Grip of Really Important Packages: i think it's ok, perfect even, i was [wrong but] concerned about 'really important', but grip 'are really important to the app that uses them', it's nothing to do with claming 'I am important' right ?
<daviid`>dsmith-work: agreed, i like your def, many thanks!
<dsmith-work>Right
<dsmith-work>daviid`: And it's recursive too. Gotta keep that tradition
<daviid`>absolutely! many thanks!
<dsmith-work>And as far as bravado, the WM I use now is name "Awesome".
<daviid`>:)
<solrize>anyone know how much ram you need to run guile embedded, with fairly small scripts?
***michel_mno_afk is now known as michel_mno
<sirgazil>davexunit: this is the error I get when running sly's make: http://www.pasteall.org/57300/text
<davexunit>sirgazil: where is libfreeimage on your system?
<sirgazil>davexunit: /usr/lib
<davexunit>can you try (dynamic-link "libfreeimage") from a guile terminal?
<davexunit>something is fishy here
<davexunit>the library doesn't appear to be on your load path
<sirgazil>In the guile installed with Guix, I get the same file not found error. But in the guile installed with apt-get I get $1 = #<dynamic-object "libfreeimage">
<davexunit>sirgazil: that guile must have a different idea of what the library load path is, somehow.
<davexunit>not sure why, though.
<davexunit>so, as a brute force approach, and /usr/lib to $LTDL_LIBRARY_PATH
<dsmith-work>sirgazil: Both guile installs are on the same system?
<sirgazil>dsmith-work: yes, in different locations.
<davexunit>gotta go
<civodul>sirgazil: and libfreeimage is one from Debian?
<civodul>guile-from-guix cannot load libfreeimage-from-debian because they are use different a libguile.so, libc.so, etc.
<sirgazil>civodul: yes, but I installed freeimage with Guix too.
<civodul>but then you probably need something like: export LTDL_LIBRARY_PATH=$HOME/.guix-profile/lib
<sirgazil>I don't think Guix told me to do that, as it does with other packages :)
<sirgazil>But I'll check.
<civodul>yeah it doesn't handle that variable, because it's a bit special