IRC channel logs

2013-07-12.log

back to list of logs

<c107>Anyone here?
<Giomancer>Negative
*fangism lurks
<dsmith>Hey hey
<nalaginrut>morning guilers~
<nalaginrut>morning guilers~
<taylanub>Twice in a row .. morning! :P
***sneek_ is now known as sneek
<wingo_>mooo
***wingo_ is now known as wingo
<taylanub>Hrm, I wonder if it would be useful if the body of `let' was defined in terms of `begin' such that you can do (let (...) (define blah bluh) (define bleh bloh)) and the definitions are spliced into the current expression while still being scoped in the let.
<taylanub>I had mentioned this possibility as a passing thought on the Scheme ML, at the moment I'm actually facing a use-case for it ..
<taylanub>If you think about it, there's no reason that use-cases *wouldn't* show up for this; we already do things like (define my-proc (let (...) (lambda () ...))), so when you want to do this for multiple values .. oh I guess `define-values' is an alternative, although it's a misuse of it in this case IMO.
<wingo>the body of let is specified in that way.
<wingo>ah, i see what you mean
<wingo>yeah dunno, define-values is for that
<taylanub>Oh yeah, I meant the splicing begin; I forget that they're two different things with the same name. (Three in R7RS. :P The third limited to module declarations though.)
<taylanub>I can't seem to find `define-values' in Guile 2.0.9.x ...
<wingo>it doesn't exist :)
<taylanub>And it seems impossible to define with syntax-rules. O_o Or I'm not thinking hard enough.
<taylanub>I can't envision a way other than to touch the module system, in fact with some more thinking it could probably be proven impossible. Let's see if I can find out how to define it as a primitive written in C.
<add^_>taylanub: doesn't just (define whatever (values 1 2 3 4)) work?
<add^_>I haven't looked it up so it might not, but still
<taylanub>add^_: What would you expect that form to do ?
<wingo>it's not impossible to defined
<wingo>*define
<wingo>see r7rs
<add^_>I would *expect* it to return 1 2 3 4 if I evaluated whatever
<add^_>But I don't know
<taylanub>add^_: There is no actual *object* representing multiple values.
<taylanub>No such data type.
<add^_>Hm
<add^_>Hm, so I tried it, just returns 1
<add^_>Oh well
<add^_>You got me :-)
<taylanub>Yeah, Guile drops unused values from multiple-value returns. In other implementations it could be an error.
<add^_>oh
<taylanub>wingo: Wow, now that's a creative implementation. :P
<wingo>i didn't think it was possible before seeing it :)
<add^_>Huh. Cool
<add^_>Where can I find it? Which paper, what title?
<taylanub>add^_: On the scheme-reports ML archives you'll find the "final draft" announcement.
<add^_>Ah
<add^_>Ok
<add^_>taylanub: I'm looking at it now, but this wasn't what I was thinking of when I thought about (define whatever (values 1 2)), this is something that I think have existed in CL for... long.
<add^_>In their terms I meant: (define <variable> <expressions>) rather than (define-values <formals> <expressions>)
<add^_>Oh well
<taylanub>sneek: Later tell civodul it could be that the coverage gathering doesn't realize that a procedure is called when it is called as a tail-call.
<sneek>Got it.
<taylanub>sneek: botsnack
<sneek>:)
<wingo>heya civodul :)
<civodul>hey wingo
<sneek>Welcome back civodul, you have 1 message.
<sneek>civodul, taylanub says: it could be that the coverage gathering doesn't realize that a procedure is called when it is called as a tail-call.
<taylanub>Maybe `frame-procedure' misleads after a tail-call ?
<civodul>no
<taylanub>It could be that it's just the source-line information that gets messed up due to tail calls. The idea of tail-calls messing stuff up came after taking a look at: http://taylan.uni.cx:8080/lcov/scheme-bytestructures/home/tub/src/guile/modules/bytestructures/test.scm.gcov.html
<civodul>could you try a reduced test case?
<taylanub>Let's see ..
<taylanub> http://taylan.uni.cx:8080/lcov/scheme-bytestructures/home/tub/src/guile/modules/bytestructures/coverage-test.scm.gcov.html
<civodul>aaah, ok
<civodul>hmm, could you report it to bug-guile, for later processing? :-)
<taylanub>OK.
<jao>"A blighter of infinite guile and up to every shady scheme on the list" -- Bertie, describing someone on a Jeeves story... he could look around for him here!
<add^_>Hah
<tupi>heya, did i miss the tradi 'happy friday guilers'?
<janneke>tupi: 't be saturday in five hours?
<janneke>happy friday tupi!
<tupi>tx!
<janneke>[the ! here means, may modify the receiver's mood]
<shanecelis>hello
***sneek_ is now known as sneek
<taylanub>Hrm, someone tell me some C struct in the default environment whose pointer I can get and play with its values. :P
<taylanub>My bytestructures stuff now has pointers too. I guess that finishes all the base C data types. :D
<civodul>:-)
*civodul thinks
<civodul>there are the time structures shown in the manual
<civodul>see "Dynamic FFI"
<taylanub>Looking ..
<taylanub> http://sprunge.us/LQXX Phew, finally. Minimal example of use .. kinda dirty, probably unintuitive to the sight.
<civodul>ah ah, nice!
<taylanub>Several things need explanation there: 1. I wrap the struct in a pointer so the pointer-fiddling is left to the bytestructures code; otherwise I could've fished out the pointer to the bytevector of the struct. 2. Ignore the 0 after bs:pointer for now. 3. The ((0 0)) describes the initial contents for our "(pointer (struct u64 u64))" layout, I needed to provide this because otherwise the pointer would've been null.
<taylanub>4. (bytestructure-ref bs) requests the top-most content object of the bytestructure (since no indices are passed after bs); the pointer type does magic and returns the pointer itself in that case; when indices are passed as additional arguments it automatically dereferences the pointer and continues parsing the indices.