IRC channel logs

2014-09-03.log

back to list of logs

<ijp>the emacsers amongst you may be interested in https://gist.github.com/ijp/1eb5a1024401b21f8676
<ijp>first half of a macro-by-example for elisp
<ijp>other half will appear later today
<artyom-poptsov>sneek: tell civodul Yes, my FTP server was down due to a NAT problem. Should be fixed now. BTW, thanks for pointing that out.
<sneek>civodul, artyom-poptsov says: Yes, my FTP server was down due to a NAT problem. Should be fixed now. BTW, thanks for pointing that out.
<nalaginrut>morning guilers~
<artyom-poptsov>nalaginrut: Good morning
<nalaginrut>davexunit: what's the issue you mentioned? could you elaborate it?
<nalaginrut>artyom-poptsov: heya
<artyom-poptsov>Huh, it seems that I misused sneek's interface
<ijp>bot abuse is serious business
<artyom-poptsov>ijp: Agreed. Bots need some respect too.
<artyom-poptsov>sneek: later tell civodul Yes, my FTP server was down due to a NAT problem. Should be fixed now. BTW, thanks for pointing that out.
<sneek>Will do.
<nalaginrut>sneek is triggered by talking rather than knocking, so I should leave a message to davexunit, although he's online...so that he can see the message once he say a word...
<nalaginrut>sneek: later tell davexunit could you elaborate the issue you mentioned about Artanis?
<sneek>Got it.
<artyom-poptsov>nalaginrut: I see. Thanks.
<nalaginrut>my bot eliug is triggered by knocking
<nalaginrut>well, he's not here since we have sneek ;-)
<artyom-poptsov>Not only sneek, gnunet_bot too (although gnunet_bot seems to be not a very talkative person)
<mark_weaver>gnunet_bot only logs
<artyom-poptsov>nalaginrut: Oh yes, eliug is a bot of Szdiy hackerspace.
<nalaginrut>yes~
<nalaginrut>well, I got this when wondering on internet... http://hpmor.com/ when Harry is computer scientist...
<taylanub>when `error' puts me in the debugger, can I access its arguments?
<janneke>who's arguments?
<taylanub>(error "foo" arg1 arg2)
<janneke>(command-line) or ,locals
<janneke>ah
<taylanub>,locals doesn't have them..
<janneke>,frame ?
<taylanub>that displays them again, indicating that they're probably saved somewhere...
<taylanub>(unless it just saved the display string)
*taylanub looks into the REPL code
<janneke>ah that's what you mean
<janneke>sure you can do what display does
<janneke>look into the stack frames
<taylanub>seems needlessly complicated :(
<taylanub>well not "needlessly" -- it would need some convenience wrappers I guess
<civodul>Hello Guilers!
<ArneBab>moin civodul
<ArneBab>mark_weaver: I was in a small spanish village for 3 weeks. I remembered your comment that you would implement wisp differently: using the reader. This is the result: http://draketo.de/proj/wisp/wisp-scheme.html — almost halved number of lines of code, cleanly separated into whitespace parsing and indentation processing and generally much easier to reason about. Likely also actually correct ☺ In short: Thank you!
<mark_weaver>ArneBab: cool! fwiw, I would recommend looking for a bare '.' yourself rather than having Guile's core 'read' read it. the problem with the latter approach is that it means you can't distinguish between a bare '.' and the quoted symbol |.|
<mark_weaver>you already have to handle whitespace yourself, so I recommend looking for a bare '.' yourself as well.
<mark_weaver>if it turns out that the '.' is the beginning of something else, you can 'unread-char' it and then proceed to guile's core reader.
<mark_weaver>(frankly, I consider it a bug that (call-with-input-string "." read) returns |.|)
<mark_weaver>IMO, that should be a read error
<ArneBab>oh, ok
<ArneBab>(call-with-input-string "#{.}#" read) does not return #{.}# by the way, but rather escape chars for #{ and } inside #{}#.
<ArneBab>I’ll look into it - thanks!
<taylanub>probably #{}# should be deprecated in favor of ||, no?
<ArneBab>(I also want to change it such that (. 1) no longer errors out from wisp.
<ArneBab>because that’s actually valid syntax
<mark_weaver>ArneBab: hmm. on my system, (call-with-input-string "#{.}#" read) => #{.}# (or |.| as it prints if the r7rs-symbols print option is enabled, which I now do in my .guile)
<ArneBab>oh, ok…
<ArneBab>then I’ll *have to* fix it before the next guile release.
<ArneBab>(or so)
<mark_weaver>ArneBab: what does it do exactly on your system?
<ArneBab>hm… it now does the same… I wonder how I got the other result?
<mark_weaver>taylanub: there are backward compatibility issues, but fwiw in my .guile I enable the r7rs-symbols read and print options, so I generally agree.
<ArneBab>I got #{\\escapechar\\escapechar.\\escapechar\\escapechar}#
<mark_weaver>the problem is that there is existing guile code that assumes that | is a valid symbol character.
<ArneBab>ok, so that’s clearly a wisp-bug. Thanks!
<mark_weaver>ah, makes sense.
<ArneBab>I’ll still have to use some temporary placeholder to rewrite the lists later, but it should then also be more compatible with other implementations.
<ArneBab>the match-solution which DerGuteMoritz and nalaginrut suggested yesterday is awesome, by the way.
<ArneBab>9 lines to solve a problem which took me hours to partially figure out on paper
<mark_weaver>hmm, but doesn't that match solution presume that you are using 'read' and then seeing if it returned |.| ?
<mark_weaver>btw, I should mention that (. 1) is not standard scheme syntax. it is a guile extension, and I'm not sure whether it was intentional or just an accident of how the reader is implemented.
<mark_weaver>(not that I have any strong aversion to allowing it)
<mark_weaver>anyway, it's long past time for me to sleep. ttyl!
<ArneBab>mario-goulart: yes, but I can change the match solution to check for other things, too. I could use any special symbol as placeholder.
<ArneBab>mario-goulart: sorry, that was intended for mark_weaver (auto-complete got me)
<nalaginrut>oh! how can I forget |.| in r7rs!
<nalaginrut>we should avoid #{}# as possible!
<sbidin`>Can I re-export all identifiers from a module?
<civodul>yes, you can
<civodul>there's no declarative way to do that, though
<civodul>so you have to iterate over all the variables, using 'module-for-each' & co.
<taylanub>the library system extensions proposal for R7RS-large seems pretty good; it has that feature
<civodul>so did R6, no? :-)
<sbidin`>civodul: Thanks!
<ijp>emacs users may be interested in https://gist.github.com/2c3e7a8238cb7be48872
<ijp>macro-by-example for elisp (needs cleanup)
<civodul>ijp: oooh, nice job!
<taylanub>civodul: nope, it actually didn't. have to painfully list all the reexports under the one exports clause. even R7RS-small is a little better in that regard where one can at least `include-library-declarations' to yank in a list of identifiers from a standalone file (then the original library and the reexporting library can both just include that file)
<davexunit>taylanub: you can't use the re-export procedure?
<taylanub>davexunit: R6RS has one?
<taylanub>oh, my line missed civodul
<taylanub>civodul: nope, it actually didn't. have to painfully list all the reexports under the one exports clause. even R7RS-small is a little better in that regard where one can at least `include-library-declarations' to yank in a list of identifiers from a standalone file (then the original library and the reexporting library can both just include that file)
<civodul>taylanub: oh ok, i thought R6 had something along those lines but no
<civodul>glad R7 actually improves things ;-)
<davexunit>taylanub: oh you don't want to use guile-specific things, got it.
<taylanub>I keep sayin', R7 is not as bad as you make it out to be :P
<civodul>apparently you're right :-)
<davexunit>is it possible to use guile's http-get procedure with an https url?
<nalaginrut>davexunit: no, you have to use guile-curl
<nalaginrut>I did so, it's cool
<davexunit>oh, cool. glad there's a library already available. thanks.
<nalaginrut>guile-gnutls could do it too, but curl is easier
<nalaginrut>davexunit: btw, can you elaborate the issue you mentioned about Artanis?
<davexunit>nalaginrut: I used to do a bunch of rails stuff. rails did this content negotiation thing where, bsed upon the file extension given for a route (e.g. '/foo.json') it would know what format to use when rendering a response.
<nalaginrut>well, if you want to play json, please read here: https://github.com/NalaGinrut/artanis/blob/wip-sql-mapping/examples/test.scm#L89
<nalaginrut>it's in wip-sql-mapping branch
<nalaginrut>there're many changes in wip-sql-mapping branch, it's better than master
<davexunit>nalaginrut: I've been playing around with destructuring URIs into lists that can be pattern matched
<davexunit>so you can have a route like ((GET "package" name) (render-json (find-package name)))
<nalaginrut>I don't understand the problem
<davexunit>let's say that for this route I want to be able to respond with JSON or HTML depending on what the user asks for.
<davexunit>if they request /package/foo.html, they get html
<davexunit>if they request /package/foo.json, they get json
<davexunit>I could then have a macro like: (render response-format (json ...) (html ...))
<nalaginrut>oh, I think you need a better handle for bindings in route-rule
<nalaginrut>for now, you have to use /package/foo/:format
<nalaginrut>but I guess you need /package/foo.:format
<davexunit>yeah, alternatively, /json would work.
<davexunit>rather than using that :foo syntax, I opted to build a list from the url components and pattern match
<mario-goulart>davexunit: wrt URI matching, I've made a similar thing for awful (a web thing for CHICKEN). It's https://github.com/mario-goulart/awful-path-matchers , in case it can be useful. Unfortunately it doesn't have documentation yet, but I hope the tests can serve as usage examples: https://github.com/mario-goulart/awful-path-matchers/blob/master/tests/server.scm
<davexunit>mario-goulart: thanks!
<mario-goulart>yw
<nalaginrut>I think you want to hide the details while fetching json files, right?
<nalaginrut>so you don't want to try "/package/foo/json"
<davexunit>yeah, I like /package/foo.json better
<davexunit>I have a solution figured out, I was just curious if artanis already did it. :)
<nalaginrut>ok, l thought (get "/package/foo.:format" ...) can work, let me try
<nalaginrut>then you can use (params rc "format") to get the file format
<davexunit>cool
<nalaginrut>hmm...seems no, I'll fix it
<davexunit>I guess really you'd want "/package/:name.:format", though
<taylanub>sneek: later tell mark_weaver I remember you mentioning a psyntax rewrite; are there plans on what it will and won't support? I think immutable/sealed modules and the ability to "static import" them could be a huge help for performance-critical code. Shiro Kawai mentioned Gauche will be doing the same, which is otherwise like Guile in "all toplevels mutable"; I think it's the right solution.
<sneek>Got it.
<davexunit>where do the guile bindings for gnutls get installed?
<davexunit>I have gnutls installed on my system, and the guile bindings allegedly come with it.
<davexunit>but I can't find them.
<davexunit>oh, debian has separated that into a separate package.
<yngccc>hello... how do I export (define-record-type ...) in guile without export each setter getter manually?
<ijp>there is no such form
<yngccc>;(
<ijp>it's not quite a trivial define-syntax-rule because of the nesting, but it is a very simple macro
<ijp>hmm, maybe it is
<ijp>(define-syntax-rule (define-public-record-type type (constructor fields ...) predicate (fieldname field-procs ...) ...) (begin (define-record-type type (constructor fields ...) predicate (fieldname field-procs ...)) (export type constructor predicate) (export field procs ...) ...))
<ijp>not tested, but I think it should cover it
<ijp>s/field procs/fieldprocs/
<ijp>field-procs* dammit
<nalaginrut>davexunit: it's ok now
<nalaginrut>but there's a tiny problem
<yngccc>ijp: ty, I will try it out, macro still new to me.
<nalaginrut>because *.html is handled in the server-init, so html doesn't work for the case
<ijp>yngccc: well, if you indent it properly, it should hopefully be self explanatory
<nalaginrut>I'll write a helper function to let users choose what kind of file is handled by static file emitter in default
<davexunit>nalaginrut: cool :)
<nalaginrut>davexunit: you have to use "/package/:name\\\\.:format"
<davexunit>ah, regex style
<ijp>backslash passing style
<nalaginrut>route rules in Artanis is regex
<nalaginrut>so you need to handle it carefully
<nalaginrut>wow, little big change, but better
<nalaginrut>users may specify the excluded type of file
<nalaginrut>(init-server #:exclude '(html png))
<nalaginrut>so there won't be any conflict with the default
<nalaginrut>davexunit: done, you can play it
***jjmarin_ is now known as jjmarin
<davexunit>does anyone have recommendations for the best way to get guile bindings for gnutls to work?
<davexunit>I installed the guile-gnutls package on a trisquel 6 machine. when I included the (gnutls) module from a guile 2.0.11 REPL it segfaulted.
***karswell` is now known as karswell