IRC channel logs


back to list of logs

***sw2wolf is now known as Recursive{away}
***Recursive{away} is now known as Recursive
<cordawyn>I'm studying "foof-loop" library (in particular, "nested-foof-loop" part of it, and I'm trying to unfold "collect-list-reverse" macro.
<cordawyn>Could anyone point me where "TAIL" is coming from in that syntax definition?
<cordawyn>Here's a gist:
<cordawyn>btw, speaking of marcos, is there a tracer or a debugger or some other kind of tool that could help me to see how the macros are processed, step-by-step?
<wingo>lloda: use get-internal-run-time / get-internal-real-time for benchmarking
<wingo>it usually has more precision and it doesn cons
<wingo>i guess we should provide a time macro
<ijp>cordawyn: it doesn't come from anywhere, it's a fresh identifier
<cordawyn>thanks, wingo
<ijp>like tmp in (define-syntax-rule (swap! a b) (let ((tmp a)) (set! a b) (set! b tmp)))
<cordawyn>ijp: like in "let" syntax, you mean?
<ijp>let doesn't enter into it
<ijp>the variable is not in the lexical-scope of the macro, nor is it an argument, so it is treated as fresh at every macro usage
<cordawyn>oh, I see
<ijp>if it weren't, that tmp could be unintentionally captured
<cordawyn>so, in that particular case, it doesn't seem to be used anyhow, does it?
<cordawyn>I mean, TAIL
<cordawyn>unless... it gets into the scope of the expression that you match against the pattern?
<ijp>it will be necessary because of the structure of iterate
<cordawyn>but "iterate" has no references to tail as far as I can see
<ijp>the name doesn't matter, it's the structure it will match on
<cordawyn>neither iterate* or anything else does :)
<cordawyn>so it'll be just a TAIL symbol for state then?
<cordawyn>thanks, ijp
<lloda>wingo: thx about guile-internal-etc, I take note.
<wingo>lloda: you still have to divide by internal-time-units-per-second of course
<wingo>the r7rs name is better ("jiffies") :)
<lloda>I've got it.
***ijp is now known as the
***the is now known as Guest47157
***Guest47157 is now known as ijp
*DerGuteMoritz gets the jiffies
<DerGuteMoritz>too much coffee!
<aleix>is there anyway that uri-encode uses uppercase hexadecimal characters?
<aleix>%2F instead of %2f
<aleix>i'm working on guile-oauth and yesterday couldn't get a valid signature until i realized oauth requires uppercase
<fbs>doesnt look like it
<fbs>i think its easiest to just modify the string yourself
<fbs>if your strings are utf8 you might be able to just copy the code needed
<aleix>but i only want that part (the percent encoded) to be upper case not the whole string
<aleix>i think i'll submit a small patch for this
<fbs>yea should be easy
<fbs>but for now you can do
<fbs> using that for now should work, as long as you use utf8
<mark_weaver>aleix: we should try to get at the bottom of this and find the right fix. is guile violating some spec by generating lowercase instead of uppercase? or is oauth violating the spec by requiring uppercase?
<mark_weaver>aleix: do you know the answer off hand? would you be willing to look it up?
<fbs>The uppercase hexadecimal digits 'A' through 'F' are equivalent to
<fbs> the lowercase digits 'a' through 'f', respectively. If two URIs
<fbs> differ only in the case of hexadecimal digits used in percent-encoded
<fbs> octets, they are equivalent.
<mark_weaver>well, it also says: "For consistency, URI producers and
<mark_weaver> normalizers should use uppercase hexadecimal digits for all percent-
<mark_weaver> encodings."
<mark_weaver>so I guess that means that we should change guile to produce uppercase.
<mark_weaver>but oauth should also be fixed as well.
<mark_weaver>(the bug is really in oauth)
<fbs>Hexadecimal characters in encodings MUST be upper case. Text names and values MUST be encoded as UTF-8 octets before percent-encoding them per [RFC3629].
<fbs>the patch for guile should be quite easy tho
<fbs>(display (number->string byte 16) port)
<aleix>sorry, got disconnected
<mark_weaver>yeah, I'm looking at the code now.
<aleix>mark_weaver: i'll take a look, but certainly OAuth requires uppercase
<aleix>The two hexadecimal characters used to represent encoded
<aleix> characters MUST be uppercase.
<mark_weaver>my question is: is there a reasonable justification for that additional requirement on top of what RFC3629 requires.
<mark_weaver>but we'll change guile to generate uppercase anyway.
<wingo>sounds like a plan
<aleix>i sent a patch so people can choose
<mark_weaver>my guess is that oauth needs the URI in a canonical form, given that they also require that "Characters in the unreserved character set MUST NOT be encoded."
<aleix>that's right
<mark_weaver>aleix: you sent a patch to guile-devel that changes uri-encode to generate uppercase percent encodings?
<mark_weaver>ah yes, I see it now.
<aleix>very silly, but yes
<mark_weaver>hmm, I don't know if we should add a keyword option. I think probably we should just generate uppercase always.
<mark_weaver>wingo: what do you think?
<wingo>uppercase always sounds fine to me
<aleix>mark_weaver: are you doing the change then? (i don't think i need to send a patch for this)
<wingo>do you have commit access, aleix?
<wingo>if not please ask for it at savannah
<wingo>not required for this case but it seems like a good idea
<mark_weaver>aleix: if you want to make the commit, please do. I like to see more names in the commit logs :)
<microcode>uppercase is the sensible way to go for URI escapes
<mark_weaver>please post it for review first though.
<microcode>unless people start using non-tabular text figure numerals in URLs ;)
<mark_weaver>RFC3629 states: "For consistency, URI producers and normalizers should use uppercase hexadecimal digits for all percent-encodings."
<mark_weaver>that's good enough for me :)
*microcode suppresses the urge
<mark_weaver>sorry, RFC3986
<aleix>ok, i'll do it in an hour or so, have to take my son to the daycare now!
<mark_weaver>sounds good, thanks!
<microcode>wingo: thanks for all your work and blog posts on Guile, you actually got me interested in the internals rather than just as a user.
<wingo>you are very welcome! :)
<microcode>everyone else too, you're awesome for existing
<microcode>the amount of emotional, psychological, and potentially financial benefit I extract from the existence and properties of guile is immense
<mark_weaver>thanks for the kind words microcode. I agree that it's a really great, fun community to be a part of :)
<microcode>I hope to be of some service to it in the near future
<wingo>excellent :)
<microcode>what's something that needs doing that would be of assistance with me getting to know the system a bit better?
<wingo>is there something that interests you particularly?
<microcode>I like compilers
<microcode>but really I'm not too biased
<wingo>it's tricky to recommend things, and our compiler is in an in-between state -- moving to a new vm and missing some pieces
<microcode>as I'm somewhat aware
<wingo>it's possible to assist there but might be difficult to get started
<microcode>lots of work on that code as well, so merging would be messy..
<wingo>one silly but useful thing would be to add docstrings to existing code -- basically a bunch of code reading
<wingo>i think most of us think that there should be more docstrings
<wingo>dunno, perhaps that sounds boring ;)
<microcode>no, not really
<wingo>and anyway you'd want to start slow so that people agree on style
<microcode>that would be perfect for me
<fbs> writing documentation is hard :/
<microcode>as I know next to nothing about your style etc.
<wingo>civodul is the only one that has it all in his head i think ;-)
<wingo>so if you want, take a look at boot-9.scm
<wingo>it's an interesting read anyway
<fbs>btw why is it all called *9?
<wingo>and add a few docstrings and send it to the list
<wingo>and we can go back and forth
<wingo>fbs: because of ice-9
<microcode>where is this boot-9 nonsense at?
<fbs>find . -name 'boot-9'
<wingo>microcode: module/ice-9/boot-9.scm
<microcode>yeah, I was parsing ls
<microcode>probably should've just used emacs
<fbs>wingo: ah, just found
<wingo>if you use emacs, geiser and rgrep are your friends
<wingo>M-x rgrep
<fbs>Some part of the Scheme programming language implementation GNU Guile is named ice-9 with regard to the crystallization effect of Vonnegut's invention
<microcode>nice mnemonic
<microcode>enormous (let) block with huge string literal
<microcode>the mark of all good code ;)
<wingo>which one? :)
<microcode>the one in boot-9
<wingo>line number?
<microcode>from L74 to
<wingo>the string literals are actually docstrings
<wingo>and wouldn't be recognized as such if they were elsewhere
<microcode>I'd figured
<davexunit>I enjoyed the vonnegut reference
<microcode>boot-9 from outer space
<microcode>ooh, this geiser business is delightful
<aleix>mark_weaver: just sent a new patch for the uri-encode
<microcode>I've not seen the form "lambda*" before, any specific meaning to it?
<ijp>it's like lambda, but allows you to specify optionals and keyword arguments
<microcode>it's a shame there's no λ equivalent for λ*
<microcode>(by default)
<ijp>the lambda equivalent is parsing rest args by hand
<microcode>I imagine lambda* is optimized at the eval level as well
<ijp>yes, the vm knows about optionals and keywords