IRC channel logs
2017-10-04.log
back to list of logs
<Apteryx>Hello! When using (ice-9 match), what is the canonical way to match a list of strings, and then mapping over it? <Apteryx>I thought I could have something like: ((str1 str2 ...) (map my-proc (list uri1 uri2 ...)) but this doesn't seem valid. <Apteryx>The use case is taking action on an argument that can be either 1) a single string or 2) a list of strings. <daviid>Apteryx: why not immediately call map: (map myproc yourstrlist) <Apteryx>because I don't always have a list; sometimes a lonely string comes, sometimes a list of strings. <daviid>Apteryx: (map myproc (match vals ((a) (list a)) ((a . rest) vals))) <daviid>or the other way around if yu prefer <daviid>(match vals ((a) (myproc a)) ((a . rest) (map myproc vals))) <Apteryx>wouldn't (a) match '("some-string") rather than "some-string"? <daviid> (match vals ((a . rest) (map myproc vals)) (_ (myproc vals))) <Apteryx>I could use "..." after all, just not in the "then" clause <Apteryx>thanks for eminding me I could reuse the top-bound value in (match top-value ...) <Apteryx>When using (and condition1 condition2 condition3), can I use (delay ...) on condition3? It should only be eval'd if condition 1 and 2 are true (otherwise throws an exception). <daviid>Apteryx and is a macro, it won't try to evaluate cond3 if any of the preceeding are #f <Apteryx>interesting; that means my logic is broken, eh! <Apteryx>sneek: later tell daviid, your match rules were required for my logic to work after all. <Apteryx>how can I convert '() to #f? Is there no (bool '())? <Apteryx>Strange... When I ran my script from Geiser, it's happy. When I run it from the terminal, it doesn't know about `string-match', even though I'm using the (ice-9 match) module. <Apteryx>efraim: I got the gcc patch right I think! When you have the time, it is to go in core-updates. <ArneBab>sneek: later tell mwette: ah yes (no terminator but newline). I need to add that for a general tutorial. <dustyweb>I am in a room with Mark Miller of capabilities / erights! <dustyweb>apparently he recently switched to working on WASM because of WASM-GC <dustyweb>apparently WASM's GC stuff is core enough to have Mark Miller on it, and the reason he switched is capabilities based... having WASM have opaque unforgeable pointers means that capabilities are possible in WASM <dustyweb>civodul: Rebooting Web of Trust has been super cool <cmaloney>I wish I understood any of those acronyms <dustyweb>so apparently WASM having GC means no manual memory management, which means that access is by scope <dustyweb>which means! (and read Jonathan Rees' security kernel paper) <cmaloney>I want to get someone from Mozilla to talk about WASM and Rust <dustyweb>would be cool... may be two separate speakers for that one :) <cmaloney>Or someone who is a rather enthusiastic proponent of web tech <cmaloney>since it's changed significantly even since 2016 <davexunit>so goops doesn't support method combination (a la CLOS), I guess? <manumanumanu>ok... I have been reading https://fare.livejournal.com/189741.html about the nest macro. He claims that the "right fold" syntax-rules one is quadratic, but in my tests it is slower than the final version by a constant factor (and not by much. about 10%). Am I insane, or is it really quadratic? <manumanumanu>it is the straight forward implementation by gwatt on IRC #scheme (search for gwatt on the page) <manumanumanu>is it the matching that is quadratic? I only tested it up to six nests deep <amz3`>AFAIK quadratic complexity or whatever doensn't always mean it is slower, it's only a clue... <amz3`>say, 2² is 4 wheres 4*2 is 8... <manumanumanu>amz3`: but then why whine that the algorithm was quadratic? He probably spent more time writing the syntax-case macros than any expansion of the syntax-rules macro will ever take. <roelj>What's the fastest way Guile can write bytes to a file? Currently, I'm using (display ...), but with that I seem to only get to 5 megabytes per second. <daviid>heya! anyone is using IPFS, i'm curious <sneek>daviid, Apteryx says: your match rules were required for my logic to work after all.