IRC channel logs


back to list of logs

<cbaines>I have a #<directory (...) > value showing up unexpectedly in a module, does anyone know why this is? I was expecting the symbol that coresponds to this odd value to be from a different module.
<taylan>cbaines: can you show the code that leads to this?
<taylan>a "directory" is more or less a module object if I remember correctly
<cbaines>The module I'm loading has the same name as that value
<cbaines>I can't reproduce the behaviour in the REPL though
<taylan>cbaines: right, so it seems that instead of loading a module you somehow bound it to a variable
<taylan>cbaines: can you show the code that leads to this?
<cbaines>It's quite large, so I'm not sure it will be that much help
<cbaines>The value is signon in this module here
<cbaines>I'm guessing that somehow, #:use-module (gds services govuk signon) is leading to signon having that directory value
<cbaines>rather than the package value I want from #:use-module (gds packages govuk)
<cbaines>Using the (@ (gds packages govuk) signon) syntax seems to work :)
<amz3`>hmm... porting the search index was just a matter of copying the files :)
<amz3`>now I figured I need a queue-like datastructure to support something like celery
<taylan>cbaines: I don't see the (gds services govuk signon) module exporting a variable named 'signon'. and the reason 'signon' is bound to a module object in (gds services govuk) is that the 'signon' module is a sub-module of it. it's a quirk(?) about guile's module system
<taylan>(I'm not sure if it's something useful, or something harmful, and whether it's an implementation detail, or intentional)
<taylan>quigonjinn: it's possible to use the reflective module API to export all top-level defined procedures in a module, but it would be strongly advised against. the normal way is to have "#:export (foo bar ...)" in your (define-module ...) form, or to use (export foo bar ...), or to use (define-public ...)
<quigonjinn>taylan: i am trying to refactor some codebase, which is written for another scheme implementation, so i am hacking my way through it
<cmhobbs>hello folks! can someone point me in a direction for a couple of operations with guile?
<paroneayea>cmhobbs: I can try...
<cmhobbs>i've got columnar data from a program
<cmhobbs>i can throw it into stdout
<cmhobbs>or into a file
<cmhobbs>i'd like to take that data and throw it into some kind of useful data structure. if it were ruby, i'd probably make it an array of arrays
<cmhobbs>i'm not really sure what the convention for 1. consuming that data, and 2. what kind of useful data structure to use would be in guile
<cmhobbs>i want to look for certain numbers in a particular column and then return a neighboring column if that number is found
<cmhobbs>i never did learn to work with strings in guile
<paroneayea>cmhobbs: depends on how you're slicing and dicing it
<paroneayea>you might be just fine with a list of lists.
<paroneayea>there are also vectors, but growing/shrinking them is up to you. If you're looking for data sorted by key name, there's hashtables and vhashes
<cmhobbs>nah, i just care about three of the columsn
<paroneayea>cmhobbs: vlists also are like lists, but with some overhead, but hey have O(1) access
<cmhobbs>the leftmost three
<paroneayea>cmhobbs: could you show an example of the data?
<paroneayea>cmhobbs: pastebin it?
<cmhobbs>i'm looking for a number in column 2 (counting from zero). if that number is found, i want to return columns 0, 1, and 2 for that line
<cmhobbs>so that's highly truncated
<cmhobbs>there's usually about 17k lines
<cmhobbs>so we've got unix time, day, date, time, azimuth, elevation, then a bunch of irrelevant columns
<cmhobbs>if elevation is a certain number, i'd like to return that line
<cmhobbs>in fact, i could probably just chop off the columns after elevation and not worry about them
<cmhobbs>before ever having a guile program consume this
<paroneayea>cmhobbs: ok, gimme a sec
<cmhobbs>i'm just not sure what the best data structures to use are
<paroneayea>just a dumb example of returning the thing if > 10 in elevation
<paroneayea>honestly I think lists of strings are fine for you
<paroneayea>cmhobbs: see (ice-9 rdelim) to read line by line from a file
<paroneayea>and I showed you how to split things up there
<paroneayea>I think you need srfi-1
<cmhobbs>cool, thanks!
<cmhobbs>is there an info page for (ice-9 rdelim)? i don't mind reading online but it's nice to have my docs right here in emacs with me