IRC channel logs

2016-09-25.log

back to list of logs

***nefercheprure is now known as TMA
<sapientech>hi all, have a few questions about variables, and define. Is there anyway to create a procedure that creates an internal definition named the same thing as the name of one of the parameters?
<sapientech>and when working with (make-variable init), can i give the variable a name?
<sapientech>for example, i can do (let ((x (make-variable 10)) ...) which makes a varaible named x whose value is a variable that doesn't have a name and has value 10
<sapientech>but is there anyway to give x's value, a name?
<sapientech>the reason i am asking this, is that it looks possible for define-macro, since we are just working with quoted data: https://notabug.org/SapienTech/guile-graph/src/master/graph/alg/dfs.scm
<sapientech>but im having trouble implementing a similar thing with define-syntax
<sapientech>* anyway to create a procedure that defines a variable named the same thing as the symbol supplied as a parameter
<sapientech>for example ((lambda (some-symbol) (define <value-of some-symbol> 10) <value-of some-symbol>)) 'my-inner-proc)
<sapientech>^ ammendment to my first post, since it was unclear, and not what i was asking specifically
<lfam>I have a "newbie" question. I'm trying to use the procedure (export-web-site) from guix-artwork.git. It's purpose is to create static HTML files from Scheme code, and it's how we maintain the Guix web site. I want to start using it but I don't know how to make it available in my Guile REPL. <http://git.savannah.gnu.org/cgit/guix/guix-artwork.git/tree/website/www.scm#n360>
<sapientech>lfam: using geiser or command line repl?
<lfam>sapientech: Just the plain command line Guile REPL
<lfam>The README says that "=www.scm= and =www= provides ‘(www)’ guile module which offers services for building the website locally"
<lfam> http://git.savannah.gnu.org/cgit/guix/guix-artwork.git/tree/website/README
<lfam>I added the directory to my load path and tried (use-modules (www)), but Guile says "ERROR: no code for module (www)"
<sapientech>lfam: which directory did you add?
<lfam>I actually added both '/home/leo/guix-artwork/website' and '/home/leo/guix-artwork/website/www'. I can see them when I do (display %load-path)
<sapientech>lfam: try adding a / after both
<sapientech>then it should work
<sapientech>you only need the first one also, since that defines the root dir for this module, so something like /www/x.scm will be (www x)
<lfam>It didn't work. This is full output of (display %load-path): (/home/leo/guix-artwork/website/ /home/leo/guix-artwork/website/www/ /gnu/store/95x5fxvcggyaa8ymjjgv5q0dnzkrign9-guile-2.0.11/share/guile/2.0 /gnu/store/95x5fxvcggyaa8ymjjgv5q0dnzkrign9-guile-2.0.11/share/guile/site/2.0 /gnu/store/95x5fxvcggyaa8ymjjgv5q0dnzkrign9-guile-2.0.11/share/guile/site /gnu/store/95x5fxvcggyaa8ymjjgv5q0dnzkrign9-guile-2.0.11/share/guile)
<lfam>Sorry for all the noisy hashes :)
<lfam>Hm, adding only the first one, my REPL still can't find, for example, (www utils)
<sapientech>lfam: ah yeah, not having / still works for me :)
<sapientech>try removing the second one, maybe having that corrupts the first one
<sapientech>i will test that too
<lfam>I tried that, no dice
<sapientech>hmm yeah that isn't doing anything for me too
<sapientech>why don't we try to make a small example and see if it works
<sapientech>at /home/leo/
<lfam>Okay :)
<sapientech>lets make a dir called test
<sapientech>then in test make a file test.scm
<sapientech>in it do (define-module (test test)
<sapientech>and then do some define-public proc, just to see if we can access it
<sapientech>and then export /home/leo
<sapientech>(to the load path)
<lfam>That works
<sapientech>just did that on my comp and it worked, let me know your status :)
<sapientech>okay sweet
<sapientech>and then making a test.scm in /home/leo, then importing (test) should work also yeah?
<lfam>Yeah, when I do (use-modules (test test)), the procedure I define is executed
<lfam>So, the module path for 'guix-artwork/website/www.scm', would that be (website www)? And the files in 'guix-artwork/website/www/', would those be, for example, (website www utils)?
<lfam>Oh, that doesn't match what we just did with (test test) :)
<sapientech>lfam: looking at www.scm, it defines module www, so no :)
<sapientech>lfam: so what i was saying before, is that if you make test.scm in /home/leo as well, you can import (test)
<lfam>I got my REPL to import the www module :)
<sapientech>okay coolio :)
<sapientech>what do you think changed?
<lfam>And I used (export-web-site) :) :) :)
<lfam>I'm not sure what changed!
<sapientech>lol maybe guile decided to listen to you, you must get your first trainer badge before it follows your commands :)
<lfam>Heh
<lfam>I need to convert one of the shell scripts I rely on to Guile. I think I've reached the limit of what I can do in Guix with my extremely limited Guile knowledge
<lfam>sapientech: Thank you very much for walking me through this :)
<sapientech>yeah man of course
<lfam>I wish I could help you with the question you were asking earlier
<lfam>But you can guess that I'm not there yet ;)
<sapientech>lord mark weaver to the rescue maybe
<rekado>guile 2.1.4 fails to build on hydra for armhf and mips.
<amz3>any ideas on how to fix setlocale on ubuntu+guix?
<amz3>ERROR: In procedure setlocale: Invalid argument
<ijp>how did you call it
<amz3>(setlocale LC_ALL "")
<amz3>ijp: ^
<amz3>setting GUIX_LOCPATH=~/.guix-profile/lib/locale solved the issue
<manumanumanu>the ,time in the repl shows gc time. is there any way to get access to that in a program? gc-stats isn't what I'm looking for
<manumanumanu>ah. found it
<manumanumanu>oh... no I didn't
<manumanumanu>the (gc-run-time) doesn't change
<manumanumanu>so, wheresa ,time reports 0.000xxxx seconds spent in gc, (gc-run-time) doesn't change
<amz3>indexing wikipedia from dumps is more difficult than expected
<amz3>btw I added guix package to install the latest version of wiredtiger to be used with the repo
<amz3>have a look at the culturia README for instructions...
<amz3>the funny thing is that the process of indexing wikipedia always fails at the same document... maybe the document is broken, but it doesn't raise an error... bizar bizar...
<amz3>ah! it's frozen again!
<amz3>C-c does just exit the process no clue at all
<amz3>let's iterate over the 1M or more documents without doing anything except printing the page title
<amz3>dichotomy ftw!
<amz3>seems like I was mis-using file tree walk aka 'ftw' it must return #true to continue... let's try that
<amz3>almost...
<amz3>meh... again it freeze
<amz3>and my code doesn't use ftw...
<amz3>I am tired...
<amz3>listing all the files in the wikipedia dump takes forever.
<amz3>I made progress, I now made myself convinced that the problem is with the last parsed file, which MUST have been my first intuition...
<amz3>and it looks like it breaks html2text somehow
<amz3>what do you recommend to use to implemement a sxml->text procedure?
<amz3>there is another way, a workaround could be to wait for timeout until html2text cli fails to parse and raise an error but AFAIK open-process doesn't support a timeout
<amz3>here is a html->text procedure inspired from sxml->xml https://paste.gnome.org/przas3dhw
<amz3>only 1.4G indexed in 30 minutes... this gonna be quite a long process.
***w1gz_ is now known as w1gz
<manumanumanu>uae
<manumanumanu>oops. sorry