Re: wip-rtl status
On Mon 04 Jun 2012 23:12, l...@gnu.org (Ludovic Courtès) writes: Andy Wingo wi...@pobox.com skribis: However something like '(1 . (2 . ())) has two pairs: the tail which has two immediates, and the head that has an immediate in the car but a pointer in the cdr. In that case you need to patch up the cdr to point to the tail, after you load the .go (or .so?) file. Actually, it could typically be patched by the loader, just like what happens with the variables emitted by ‘SCM_IMMUTABLE_STRING’ and such, no? (Hmm, perhaps that’s what you meant?) Yes, that is what I meant. Either you emit relocations into the ELF file, and rely on the dynamic loader to interpret them, or you compile a procedure to do the relocations and call it as an init function. Wip-rtl does the latter, because that way we can also do one-time initializations like string-symbol, string-number, etc. Andy -- http://wingolog.org/
Re: Separate textual/binary ports vs. mixed ports
Hey, I think if you only use them seperate there's a clearer distinction. If you have it mixed you can do some, say hacking, where you see it works but you can't see anywhere what you're exactly doing, most of it is hidden in the guile implementation, which interprets %default-port-conversion-strategy and gives you the coding. In one case you maybe rely on %default-port-conversion-strategy normally being UTF-8 and then someone sets it to something else, which could give some hard to track errors. I think explicity just makes code much clearer and I think seperating textual and binary ports leads to more explicity, that's my point of view.. WDYT? - Daniel
Re: Separate textual/binary ports vs. mixed ports
I agree that separate binary and textual ports are cleaner, but what about using a port to deal with a mixed binary/textual protocol, like HTTP? I think the cleanest way to deal with that would be to have a port where you first read characters and then read binary data. That doesn't directly address the string-port issue, though. Noah On Tue, Jun 5, 2012 at 5:31 AM, Daniel Krueger keen...@googlemail.com wrote: Hey, I think if you only use them seperate there's a clearer distinction. If you have it mixed you can do some, say hacking, where you see it works but you can't see anywhere what you're exactly doing, most of it is hidden in the guile implementation, which interprets %default-port-conversion-strategy and gives you the coding. In one case you maybe rely on %default-port-conversion-strategy normally being UTF-8 and then someone sets it to something else, which could give some hard to track errors. I think explicity just makes code much clearer and I think seperating textual and binary ports leads to more explicity, that's my point of view.. WDYT? - Daniel
Re: Separate textual/binary ports vs. mixed ports
Hi, Daniel Krueger keen...@googlemail.com skribis: If you have it mixed you can do some, say hacking, where you see it works but you can't see anywhere what you're exactly doing, most of it is hidden in the guile implementation, which interprets %default-port-conversion-strategy and gives you the coding. In one case you maybe rely on %default-port-conversion-strategy normally being UTF-8 and then someone sets it to something else, which could give some hard to track errors. (You mean %default-port-encoding, right?) I think this is an argument against %default-port-encoding, because the “clarity” problem described here applies just the same for purely textual ports. I think explicity just makes code much clearer and I think seperating textual and binary ports leads to more explicity, that's my point of view.. Yeah, I understand the idea, but I’m not sure how it translates to concrete use cases. ;-) Thanks for your feedback! Ludo’.
Re: Separate textual/binary ports vs. mixed ports
Hi! Noah Lavine noah.b.lav...@gmail.com skribis: I agree that separate binary and textual ports are cleaner, but what about using a port to deal with a mixed binary/textual protocol, like HTTP? I think the cleanest way to deal with that would be to have a port where you first read characters and then read binary data. Yes, but I think ‘transcoded-port’ in R6 helps solve that (you open a binary port, then use ‘transcoded-port’ to open a textual port above it.) Thanks, Ludo’.