IRC channel logs
2015-10-08.log
back to list of logs
<nalaginrut>oops, I realized that I used 'unless' in a complete wrong way <nalaginrut>fortunately, there's only one line code is wrong in Artanis <davexunit>hmm, is there any way in SRFI-37 to know when the '--' token was encountered? <davexunit>don't think there is, and that really throws off my plan. <mark_weaver>davexunit: why do you need to know? as long as SRFI-37 treats all arguments after "--" as normal arguments (not options), isn't that good enough? <davexunit>mark_weaver: I am experimenting with a better command line syntax for 'guix environment', in which the user doesn't have to quote the command they want to run. <mark_weaver>skimming the source, it seems that they handle "--" specially in several places <mark_weaver>davexunit: yeah, I saw your messages, and it sounds good to me. <davexunit>guix environment --ad-hoc guile -- guile -c '(display "foo\\n")' <davexunit>so, instead of using SRFI-37, I can split the arguments list before-hand <davexunit>the reason being that 'guix environment' already treats operands as package names <mark_weaver>ah, although I guess maybe those "--" strings I saw in the code had to do with long option arguments <davexunit>so without knowing the position of the operand relative to the '--' token, I can't distinguish between package operands and command operands. <mark_weaver>davexunit: well, if SRFI-37 ignores options after the "--", then maybe you could do the split after SRFI-37 has extracted the options? <mark_weaver>although I suppose it doesn't matter much either way <davexunit>mark_weaver: it doesn't ignore them, but rather treats each token thereafter as an operand <mark_weaver>well, that's what I meant by "ignore". it doesn't treat them as flags. I'd been using the word "options" as "flags". <mark_weaver>I see code in srfi-37 that seems to handle "--". near the end. <davexunit>but there's still the lost context. the args-fold procedure will just call the operand handler for all of them. <davexunit>but for 'guix environment', the operands before and after '--' must be treated differently <davexunit>but AFAICT there's no way to know in args-fold <mark_weaver>I wonder if it's unconventional to treat the operands following "--" specially, other than to inhibit their interpretation as flags. <davexunit>the alternative approach is to change the 'guix environment' syntax further <davexunit>but there's some amount of unconventional stuff going on either way <davexunit>for instance, 'sudo' and 'ssh' both have some way of detecting the first operand that signifies a program name <davexunit>'sudo guile --help' shows guile's help, not sudo's. <mark_weaver>if you want to split the arguments at the "--" before passing to SRFI-37, I'm okay with that :) <ArneBab_>why does (floor 5.0) show 5.0 in the REPL, but (floor 5) show 5? <taylanub>I think I'll upload a clone of the guile repo to my GitHub account to be able to easily share the state of my work. I feel bad associating guile and GitHub... <remi`bd>framasoft.org is an organization promoting free software in france <remi`bd>their git repository service is nice and doesn’t come with the problems inherent to github <taylanub>remi`bd: I'm afraid GitLab is non-free software <davexunit>taylanub: git.framasoft.org is surely running the community edition <mark_weaver>ArneBab: (floor 5.0) is 5.0 because if the argument is inexact, the correctness of the result 5.0 is not known. <mark_weaver>(floor 5) is 5 because the result is known to be an exact 5. <mark_weaver>ArneBab: see the section on "Exactness" of the R5RS for more info <amz3>davexunit: do you have solution the problem are raised on the mailling list regarding the building of the output ast using parser combinators? <davexunit>amz3: I haven't gotten an email, but it's in the archives online, so I'll read that. <amz3>I will write a parser using your lib <amz3>to exemplify the problem <amz3>I don't explain in terms of code what the problem is <amz3>I don't recall the exact behavior of parser-combinator <davexunit>amz3: it's cool that you have a working markdown parser! <davexunit>amz3: fyi, my parser combinator library is based off of the same document that you linked to, with the same limitations. <amz3>I'd like to move to your version as soon as <amz3>I find a solution that is good <amz3>first I need to check that the problem exist <davexunit>my approach would be to translate markdown to sxml directly <davexunit>because markdown is by definition a format for producing HTML <davexunit>civodul: speaking of all this document authoring stuff, Skribilo ought to be a useful tool to use in conjunction with Haunt since it can parse the Skribe format and do fontification for source code snippets. <davexunit>I perused the manual but wasn't sure how I would go about reading a Skribe document and converting it to SXML. <ArneBab>mark_weaver: why do they compare as #t? <ArneBab>the result is not known to be exactly 5 — it confused me that on the one hand they are equal, but they aren’t shown equal. <lloda>those equals are not the same <taylanub>ArneBab: = tests numeric equality, which is lax on exactness. like 5.0 == 5 in C AFAIK. but they are not the same Scheme object, so they're not eqv?. <civodul>davexunit: the Skribe format is just Scheme with square brackets to introduce literal text <civodul>the 'chapter' procedure returns an AST node, and so on <taylanub>ACTION wonders why (rnrs hashtables) doesn't throw an exception when an immutable hashtable is mutated, and instead simply ignores the attempted mutation <davexunit>civodul: I guess I just don't know how to take a Skribe file, read it, and get a data structure that I can work with to produce SXML. <davexunit>I'd like to use the Skribe format to write my blog posts from now on with Haunt. <davexunit>and I'd also like to take advantage of Skribilo's fontification. <davexunit>which makes me wonder if just using Skribilo would be better than this whole Haunt thing <rekado>davexunit: I'm using Skribe with Haunt for my blog. <davexunit>rekado: haha how are you a more advanced Haunt user than I am? thanks! <davexunit>okay, I'm going to snarf that and credit you and civodul appropriately :) <rekado>I had an itch to scratch. My blog was completely disfunctional after my move to GuixSD, as we don't have Hakyll (and packaging it is hard). <davexunit>then I can commence with migration away from Pelican. <rekado>see also haunt.scm, which defines a couple of additional things. <rekado>also note that I'm using "eval" there where I probably should be doing some macro stuff instead. <rekado>I'm just a really patient plumber. <davexunit>rekado: ah yes, you can use a macro there instead. <rekado>I must admit that I'm not as comfortable with macros as I should be. But I'm also not ashamed enough to use "eval" in Scheme... (it's a different story in other languages). <amz3>davexunit: what is expecting match-lambda as arguments? I can't find it in guile procedure index <amz3>I'm inverstigating parse-match, seems like the thing i was looking for :-) <amz3>IIUC parse-bind is basically «maybe 'g o f'» <taylanub>(I won't propose that as a patch for the time being; it's primarily to have a sample implementation for the SRFI) <davexunit>amz3: match-lambda is undocumented, needs to be fixed. <amz3>obvioulsy, but I was not sure with the macro et al. <amz3>(define-syntax match-lambda <amz3> ((_ (pattern . body) ...) (lambda (expr) (match expr (pattern . body) ...))))) <taylanub>we can extend the reader, but can we extend quasiquote? I just implemented #hash((a . x) (b . y) ...) as part of SRFI-126 but adding the quasiquote integration seems harder... <remi`bd>isn’t ` a some kind of reader-macro for the special operator “quasiquote”? <taylanub>yeah, I mean the macro 'quasiquote'. it's defined in psyntax.scm, where dragons lie. <davexunit>rekado: btw I'm very jealous of your really slick theme <amz3>davexunit: parse-match is very nice, one last check and i rewrite my parser using it <davexunit>amz3: oh cool! let me know if you run into issues. <taylanub>when I have a reader extension for #foo, I need to register an extension for the char 'f'. how can I make this work with other extensions with 'f' as the first letter? <davexunit>rekado: I saw this in your haunt.scm: (@@ (haunt builder blog) render-post) <davexunit>guess it would be a good idea to make that public <remi`bd>taylanub: couldn’t you, in your reader macro, see if it’s a #foo and if not call the old reader macro? <taylanub>remi`bd: hmm, pretty tricky. I'd need to save the old 'f' macro, then when I detect something that isn't 'foo' I'd need to "unread" the letters I read from the input port, so the old macro can read them <paroneayea>a rainbow table wouldn't be effective against the size and non-dictionary'ness of inputs here <taylanub>paroneayea: it was a generic question... <taylanub>AFAIUI salting hash table hashes is a generally good idea, against hash collision DoS attacks <taylanub>I just asked for my sample SRFI-126 implementation by the way, not that I need it for something <davexunit>interesting document about threading macros in Racket <davexunit>I wrote a threading macro that handles a basic case where the "hole" is assumed to be at the end of the argument list <davexunit>speaking of generally useful libraries, I've been meaning to write a zipper implementation to throw at guile-user <davexunit>I just throw things at guile-user and hope that other people improve them for me ;) <civodul>davexunit: your Git server is full of goodies! <davexunit>I'd love to see more work done on parser combinators <davexunit>it cannot handle left recursive grammars right now, because I didn't know how to implement it without completely destroying what makes the implementation elegant. <davexunit>but for right recursive grammars it works just fine. <paroneayea>ArneBab: I was pushing for this hard before I left CC, but work happened long after I went <ArneBab>paroneayea: I have been part of some of that work :) <ArneBab>and also great to hear that you were part of it, too!