IRC channel logs
2015-04-12.log
back to list of logs
<mark_weaver>but basically use 'response-headers' to get the header alist, then 'assv-ref' to look up the location header, and then 'uri-path' to get the path from the uri object. <mark_weaver>sorry, not 'uri-decode'. use 'split-and-decode-uri-path' <bernalex>but this fails: (uri-path (assv-ref "path" (response-headers (http-post "http://localhost:7000/create?url=test" #:headers '((Content-Type . "application/x-www-form-urlencoded")))))) ; wrong type argument in position 1 (expecting struct): #f <mark_weaver>more like (assv-ref (response-headers ...) 'location) to get the uri object <mark_weaver>and then 'uri-path' to get the path portion of the uri object <mark_weaver>I'll try to look here every once in a while, but I have to be mostly afk for a while... *davexunit has a working, barebones static site generator <davexunit>of course, all of the actually useful stuff is yet to be written: markdown reader, robust blog generation, js/css/image asset support, atom feeds, etc. <paroneayea>davexunit: there seems to be tools for expanding filenames in scsh <paroneayea>maybe I should reformat this and submit it as a patch to guile? <paroneayea>plus, maybe it's something I could actually accomplish :p <davexunit>my static site generator can create atom feeds now. :) <davexunit>if I can add static asset support and a basic blog theme, things will be pretty decent. <mark_weaver>we'd have to some of that license text to our documentation and such... certainly doable, but given how simple the job is, I'm not sure it's worth it for just this one procedure. <mark_weaver>what jobs does it do? there's not much to expanding a filename. <paroneayea>it might be worth it. I could see myself using most of these. <mark_weaver>I'd be curious to see the implementation. is it built upon things we already have in guile, or would we have to bring in a bunch of other libraries? e.g. when it looks up home directories for ~ expansion, how does it do it? <mark_weaver>also, I'm not sure I agree with 'file-name-absolute?' returning #t when the filename starts with ~ <mark_weaver>they are only special if you intend to apply tilde expansion to the filename <paroneayea>I'd be happy to have a more guile-specific one but when considering ./foo/ vs ../foo vs ~/foo/ vs ~foo/foo <mark_weaver>hmm, looking at the copyright notice, I think it's not free software. <mark_weaver>the COPYING file doesn't matter. what matters is the copying permission notice on the file itself. <paroneayea>the scsh official source (which I have open, not the guile port) <mark_weaver>honestly, I don't think it's worth it. it's just not that hard to write these procedures <paroneayea>;;; Copyright (c) 1992 by Olin Shivers (shivers@lcs.mit.edu). <mark_weaver>interesting, so who added that bizarre copying permission notice to the guile port? <mark_weaver>I recently wrote code to resolve the .. and . components of a path *davexunit will probably snarf it for a project, as well <mark_weaver>it takes a list of path components (strings), not a single string <mark_weaver>to convert a string into a list of path components, just use (string-split <path> #\\/) <mark_weaver>for a filename starting with /, the first element of the list will be "", which is what 'remove-dot-segments' expects. <mark_weaver>actually, there is one rather odd aspect of that procedure, but it's what RFC 3986 section 5.2.2 mandated: <mark_weaver>for relative paths, the leading '..' components are simply removed <mark_weaver>it might also turn a single "." into the empty string <mark_weaver>it precisely follows the algorithm specified in the RFC, but may need a few tweaks to be appropriate for this purpose <mark_weaver>hmm, I guess leading .. components need to be removed before running the loop and then added back at the end <ijp>are those the same as clojure vectors? the shifting/masking looks familiar <wingo>it's an optimization of intmaps for push/pop workload and packed vectors <wingo>the same threadsafety model as clojure too <davexunit>wingo: is this one more like clojure's vector, as opposed to the intmap? <davexunit>wingo: also, do you anticipate this going into guile core anytime soon? <paroneayea>it would be great to have more immutable types builtin to guile core. <paroneayea>so out of curiosity I looked at how long expand-file-name is in emacs' code. Granted, it's C <wingo>davexunit: dunno, need to compare more to vlists and know tradeoffs, but it could go in yeah <wingo>seems to cost 129 ns per add!, on transients <wingo>400 ns per push! on persistents <wingo>on stable-2.0, 280ns / 530ns <wingo>vlist insertion appears to be faster (112ns) <wingo>well, it's the case vlists are optimized for, so it makes sense <wingo>i am showing that vlist-ref is faster too, on a vector of 1e6 elements <wingo>160ns for a ref seems like a lot <wingo>better to (fector-fold-right (lambda (n val tail) (cons val tail)) fector '()) <wingo>probably faster too because it do smarter things *wingo goes out to play in the garden <paroneayea>would be to call emacs with -nw -q and some arguments to export html from orgmode to a very minimalist html file, pull out the body and title and things you need, then insert that into the theme you have <paroneayea>in the glorious future when bipt merges guile-emacs you could maybe call the orgmode exporter from guile directly ;) <davexunit>oh, actually, I had some issues last time I had considereed the org-mode html export option <davexunit>in my case, a full document doesn't cut it. I suppose I could re-parse the HTML and only keep the body <davexunit>I haven't yet tested sxml's ability to parse HTML <davexunit>I currently have a pure SXML file format, where the post is just scheme code that evaluates to an alist with metadata and sxml content <davexunit>where the metadata is in "key: value" format at the top, with a "---" line to mark the start of the content <paroneayea>davexunit: much could be used of the top org-export-define-backend 'html <paroneayea>and make a 'minimal-html that just overrides the "template" key in the alist <paroneayea>look at org-html-template for the current function, but you could make a version that replaces that with something simpler <davexunit>well, time to go for a long drive to visit my parents. <daviid>mark_weaver: hi! why do you drop, the last component of the base-path in merge-paths, in guix? i would understand drop if "", but it seems you drop no matter what: just curious <daviid>guilers, in the manual, i read, string-join, infix: ... "An empty string will produce an empty list." <daviid>should it not be "... An empty list will produce an empty string."? <daviid>ah or, i was assuming linux path... <mark_weaver>actually, in the example i gave, the base-path would be something like /philosophy/foo.html <mark_weaver>also, I should mention that I simply followed the algorithm specified in the RFC. <mark_weaver>well, I emulated it, anyway. I did it a bit differently but with the same results (assuming I made no mistake)