<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>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 :-) <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.) <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. <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>I could be wrong, but culturia is search engine for GNU system <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>amz3`: the command is “forget culturia” <amz3`>sneek: culturia is a search engine for GNU system <sneek>I could be wrong, but culturia is a search engine for GNU system ***micro`_ is now known as micro`
<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`>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. <jmd>I guess I should really understand match better ... <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") ? <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))" <OrangeShark>guile -c "(use-modules (ice-9 match)) (display (match '(\\"string\\" . \\"another string\\") ((_ . str) str)))" <jmd>Hmm. What is the scope of use-modules ? <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>it probably use-modules can only be used on the top level? <amz3`>use-modules only works top level <jmd>I don't know what that means. <amz3`>otherwise you have to use @@ <OrangeShark>jmd: the "outermost level of a program" where bindings are created in the global environment <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 *' <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 <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. <jmd>Still gives that "source expression failed to match..." error <jmd>I wish past.lisp.org would work without javascript. <OrangeShark>I think there was something specific you had to do to import a guile module to be used in a package <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>so add another pair of parentheses and it should work <jmd>OrangeShark: Right. Thanks. <amz3`>need to plug the search box DSL <amz3`>actually it's possible to do (guile OR scheme) (NOT racket) but not in the web interface <paroneayea>or ratheer, several hours in an airport to hack :) <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 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`>yeah and now you can submit multiple keywords <amz3`>and it only support not operator <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`>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`>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