IRC channel logs

2016-09-17.log

back to list of logs

<rekado>I finished writing my first web application in Guile: https://github.com/BIMSBbioinfo/rcas-web/
<rekado>it’s not much but I’m proud of it nonetheless :)
<alezost>rekado: cool (although I have no idea what RCAS is :-)); why did you use '(@@ (guile) append)' and not just 'append'?
<alezost>in (rcas utils jobs) module
<alezost>rekado: I would avoid repeating (if value "yes" "no") in 'prettify-options' in (rcas utils report), by using a special procedure, like: (define (->bool-string value) (if value "yes" "no"))
<alezost>I should better stop giving advices :-)
<amz3`>héllo
<rekado>sneek: later tell alezost I use “(@@ (guile) append)” because guile-redis provides “append” as well. I failed to hide the definition of “append” from guile-redis. (Maybe related to the macro magic that re-exports guile-redis modules.)
<sneek>Will do.
<rekado>sneek: later tell alezost I was close to moving “(if value "yes" "no")” to its own function but then decided against it for no good reason.
<sneek>Okay.
<rekado>sneek: later tell alezost RCAS is the “RNA centric annotation system”. You give it RNA targets and RCAS generates a report of interesting features overlapping with the targets. The bulk is written in R, which has excellent packages for genomic analysis. The web interface just allows users to configure and submit jobs, and collect the reports when they are ready.
<sneek>Got it.
<rekado>sneek: botsnack
<sneek>:)
<amz3`>sneek: culturia?
<sneek>I could be wrong, but culturia is search engine for GNU system
<amz3`>sneek: culturia?
<sneek>I could be wrong, but culturia is search a engine for GNU system
<amz3`>how can sneek forget a definition?
<amz3`>I made a typo the definition of culturia and now it has several definition in its database
<rekado>sneek: culturia?
<rekado>amz3`: the command is “forget culturia”
<amz3`>thx
<amz3`>sneek: culturia?
<amz3`>sneek: culturia is a search engine for GNU system
<sneek>Okay.
<amz3`>sneek: culturia?
<sneek>I could be wrong, but culturia is a search engine for GNU system
<amz3`>:)
<amz3`>sneek: botsnack
<sneek>:)
<random-nick>does sneek keep a count of botsnacks given?
<amz3`>it keeps track of botsnack per day, per person you can have the output at http://it-is-joke.earth
***micro`_ is now known as micro`
<stis>hey guilers!
<jmd>Can someone tell me where match-lambda is documented?
<jmd>(yes I did check the Guile manual index)
<jmd>(no I did not read every word, just in case it was in some other section)
<stis>careful I don't remember but ther is a bug in match.scm fixed in upstream. Not sure it is fixed in guile now. Also I don't remember if it was match-lambda or any other construct that had the issue
<jmd>stis: Upstream ?? I didn't know that guile had such a thing.
<stis>it's based on chibi scheme implementation
***tokage is now known as DrTokage
***DrTokage is now known as tokage
<amz3`>jmd: AFAIK there is no documentation about match-lambda specifically
<amz3`>jmd: basically, it's a lambda that does match its single value argument into a set of rules
<amz3`>instead of writing (define (do a) (match a (rule1) (rule2))) you write (define do (match-lambda (rule1 rule2)))
<amz3`> (define do (match-lambda ((rule1) (rule2))))
<amz3`>to be correct
<amz3`>erf I don't recall the syntax
<alezost>stis: match-lambda always worked, you are talking about match-let that was fixed
<sneek>alezost, you have 3 messages.
<sneek>alezost, rekado says: I use “(@@ (guile) append)” because guile-redis provides “append” as well. I failed to hide the definition of “append” from guile-redis. (Maybe related to the macro magic that re-exports guile-redis modules.)
<sneek>alezost, rekado says: I was close to moving “(if value "yes" "no")” to its own function but then decided against it for no good reason.
<sneek>alezost, rekado says: RCAS is the “RNA centric annotation system”. You give it RNA targets and RCAS generates a report of interesting features overlapping with the targets. The bulk is written in R, which has excellent packages for genomic analysis. The web interface just allows users to configure and submit jobs, and collect the reports when they are ready.
<alezost>rekado: yeah, I guessed it's something bioinfo related and you made the web interface for it; but thanks for this descriptive explanation!
<alezost>jmd: match-lambda is not documented (at least in the Guile manual), but guix code is full of examples how match-lambda is used (I think you met it in the guix code)
<jmd>alezost: That's right. I met it in guix. Unfortunately I have so far been unable to infer the semantics from the examples.
<amz3`>jmd: :(
<alezost>jmd: look at <http://paste.debian.net/826231> 2 "map" clauses are the same there
<jmd>I guess I should really understand match better ...
<amz3`>good example above
<alezost>jmd: match-lambda is a simple wrapper, the code is here: <http://git.savannah.gnu.org/cgit/guile.git/tree/module/ice-9/match.upstream.scm#n792>
<amz3`>jmd: you are not finished it does so many things
<jmd>amz3`: That's why it is hard to understand.
<amz3`>in some situations you can replace `cond' with `match'
<jmd>So how can I match ("string" . "another string") ?
<alezost>jmd: http://paste.debian.net/826268
<jmd>alezost: What does the bare ? mean in that example?
<alezost>jmd: it means that a predicate will be used afterwards, see (info "(guile) Pattern Matching")
<jmd>alezost: ok, Thanks.
<alezost>if you don't need to perform string? check, you can just use: (match '("string" . "another string") ((str1 . str2) "matched!"))
<jmd>Well I was trying something similar: ((_ . str) ...) but it refuses to match.
<alezost>jmd: (match '("string" . "another string") ((_ . str) str)) works
<jmd>alezost: Not for me it doesn't. I get: source expression failed to match any pattern in form (_ . str)
<jmd>Does anyone else get anything different when they enter: guile -c "(match '( \\"string\\" . \\"another string\\") (( _ . str) str))"
<jmd>??
<OrangeShark>jmd: you need to import the ice-9 match module
<OrangeShark>guile -c "(use-modules (ice-9 match)) (display (match '(\\"string\\" . \\"another string\\") ((_ . str) str)))"
<jmd>Hmm. What is the scope of use-modules ?
<OrangeShark>jmd, it would be the current module?
<jmd>So why does guile -c "(write (begin (use-modules (ice-9 match)) (match \\`( \\"string\\" . \\"another string\\") (( _ . str) str))))" also give this error?
<alezost>jmd: you can't use 'begin' inside 'write'; try this: guile -c "(begin (use-modules (ice-9 match)) (match '(\\"string\\" . \\"another string\\") (( _ . str) (write str))))"
<OrangeShark>alezost: (write (begin "foo" "bar")) works
<OrangeShark>it probably use-modules can only be used on the top level?
<alezost>oh, indeed, sorry then
<alezost>probably
<amz3`>yep
<jmd>top level ?
<amz3`>use-modules only works top level
<jmd>I don't know what that means.
<profan>7win 30
<profan>wops
<amz3`>otherwise you have to use @@
<OrangeShark>top level is like the global scope
<OrangeShark>jmd: the "outermost level of a program" where bindings are created in the global environment
<amz3`>+1
<jmd>this is getting ultra complicated..
<amz3`>it's not that complicated, it's just that unlike python, forms can not appear anywhere
<amz3`>in python you can import anywhere, but in guile to import from anywhere you must use @@
<amz3`>but that will import a single form at a time whereas use-modules import all the pointed modules (by default)
<amz3`>equivalent of 'from module import *'
<jmd>I don't know python
<amz3`>which language do you know?
<jmd>C
<amz3`>ah yes, but C #include is preprocessor statment... I can't relate to it
<amz3`>in C function can only be defined toplevel too
<jmd>Anyway you are sayiung that if I put #:use-module (ice-9 match) at the top of the file it shoudl work?
<amz3`>you can't defined a function inside another function AFAIK
<OrangeShark>amz3`: I think you can in gcc, but it a gcc only feature
<amz3`>jmd: yes
<amz3`>OrangeShark: oh
<jmd>amz3`: Unfortunately it doesn't :(
<OrangeShark>jmd, well if it is part of a (define-module ...) form
<jmd>Yep. That doesn't do the trick.
<OrangeShark>(define-module (my module) #:use-module (ice-9 match))
<jmd>OrangeShark: That is what I have tried. Yes.
<OrangeShark>it doesn't work?
<jmd>No.
<jmd>Still gives that "source expression failed to match..." error
<OrangeShark>can you post a paste of it?
<jmd>Hmm.
<jmd> http://paste.lisp.org/+6ZT4
<jmd>I wish past.lisp.org would work without javascript.
<OrangeShark>hmm
<OrangeShark>I think there was something specific you had to do to import a guile module to be used in a package
<amz3`>I think that too
<jmd>Well as you can see in that paste, I tried #:modules (ice-9 match)
<jmd>Currently commented out, but that didn't do the job either.
<OrangeShark>ya, but I think the scheme code used to build a package is ran in a different module
<OrangeShark>oh, it is #:modules
<OrangeShark>the problem is it should be a list of modules
<OrangeShark>you just have a single module
<OrangeShark>so add another pair of parentheses and it should work
<jmd>OrangeShark: Right. Thanks.
<amz3`>the winner is... http://hypermove.net/?query=guile
<amz3`>need to plug the search box DSL
<OrangeShark>amz3`: you are specifically crawling those blogs?
<amz3`>actually it's possible to do (guile OR scheme) (NOT racket) but not in the web interface
<amz3`>OrangeShark: yes... *
<amz3`>ACTION goes to bed
<paroneayea>o/
<paroneayea>on my way to tpac
<paroneayea>or ratheer, several hours in an airport to hack :)
<quigonjinn>paroneayea: happy hacking!
<paroneayea>thanks quigonjinn :)
<jmd>OrangeShark: I still don't understand this "top level" concept. Is it explained in any document anywhere?
***tokage is now known as install
***install is now known as tokage
<OrangeShark>jmd: did you read what amz3` said about in C?
<jmd>Yes. I did.
<OrangeShark>jmd I am not sure if there is anything in the manual explaining that, let me check. It sort of like a general programming language term
<jmd>Nothing that you or amz3 said seems to explain why some of those examples I posted worked, whilst others did not.
<amz3`>it's because the procedure you are editing, is executed by the daemon not by the guix command
<jmd>Anyway. Thanks for showing me the magic to get it working.
<amz3`>at least that's what I understand
<OrangeShark>well certain constructs can only be used in the top-level or global environment, like in C you normally can't declare a function inside another function.
<amz3`>OrangeShark: try that http://hypermove.net/?query=algorithms+-wingolog :)
<OrangeShark>heh, my website :p
<amz3`>yeah and now you can submit multiple keywords
<amz3`>and it only support not operator
<amz3`>like 'algorithms -wingolog'
<amz3`>if you only look for algorithm you get other results
<OrangeShark>yes, that is cool amz3`. You will be adding 'or' and 'and', right?
<amz3`>and already works
<amz3`>OR is implemented in the backend, but it requires more complex parsing that's why I did not do it right away
<amz3`>it ain't perfect but... it works !!! I can already use it for something useful like storing my favorite website, interesting links etc..
<amz3`>I can sleep well now ;)
<amz3`>also there is a small hiccup, the query that is used to display the page is not displayed in the search box
<amz3`>that will be for another time
<OrangeShark>good night amz3`!
<amz3`>thx
<paroneayea>nice job rekado :)