Re: [PATCH] Improve handling of Unicode byte-order marks (BOMs)

2013-04-05 Thread Mark H Weaver
Hi Andy, Andy Wingo writes: > On Wed 03 Apr 2013 22:33, Mark H Weaver writes: > >> + /* If we just read a BOM in an encoding that recognizes them, >> + then silently consume it and read another code point. */ >> + if (SCM_UNLIKELY (*codepoint == SCM_UNICODE_BOM >>

Re: [PATCH] Improve handling of Unicode byte-order marks (BOMs)

2013-04-05 Thread Mike Gran
>>> +      /* If the specified encoding is UTF-16 or UTF-32, then make >>> +        that more precise by deciding what endianness to use.  */ >>> +      if (strcasecmp (pt->encoding, "UTF-16") == 0) >>> +        precise_encoding = decide_utf16_encoding (port, mode); >>> +      else if (strcas

Re: [PATCH] Improve handling of Unicode byte-order marks (BOMs)

2013-04-05 Thread Ludovic Courtès
Mike Gran skribis: +      /* If the specified encoding is UTF-16 or UTF-32, then make +        that more precise by deciding what endianness to use.  */ +      if (strcasecmp (pt->encoding, "UTF-16") == 0) +        precise_encoding = decide_utf16_encoding (port, mode); >>

Re: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.7-291-g4a1cdc9

2013-04-05 Thread Chris K. Jester-Young
Hi Mark, On Fri, Apr 05, 2013 at 02:48:29AM -0400, Mark H Weaver wrote: > Thanks for working on this, but in the future, please post your proposed > patches for review before pushing to stable-2.0 or master. You're right, that was a lapse of judgement on my part. Sorry. > > -(define %stream-null

Re: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.7-291-g4a1cdc9

2013-04-05 Thread Chris K. Jester-Young
On Fri, Apr 05, 2013 at 08:36:51AM -0400, Chris K. Jester-Young wrote: > > The clarity of this code could greatly benefit from some helper > > procedures. One possibility would be a procedure that takes a promise > > and two continuation arguments: one to call if the promise has already > > been c

Re: array-copy! is slow & array-map.c

2013-04-05 Thread Ludovic Courtès
Daniel Llorens skribis: > +(with-test-prefix "array-copy!" > + > + (with-test-prefix "rank 2" > +(pass-if (let ((a #2((1 2) (3 4))) > + (b (make-array 0 2 2)) Can you make that: (with-test-prefix "array-copy!" (pass-if "rank 2" (let ((a ... (Same for the

Re: array-copy! is slow & array-map.c

2013-04-05 Thread Daniel Llorens
On Apr 5, 2013, at 19:20, Ludovic Courtès wrote: > Daniel Llorens skribis: > >> +(with-test-prefix "array-copy!" >> + >> + (with-test-prefix "rank 2" >> +(pass-if (let ((a #2((1 2) (3 4))) >> + (b (make-array 0 2 2)) > > Can you make that: > > (with-test-prefix "array-

Re: [PATCH] Improve handling of Unicode byte-order marks (BOMs)

2013-04-05 Thread Mark H Weaver
l...@gnu.org (Ludovic Courtès) writes: > Mike Gran skribis: > >> It would be a trivial function to write, of course, but there is a >> c-strcasecmp func in gnulib. > > Yes, better use that one. > > (Just add ‘c-strcase’ in m4/gnulib-cache.m4, run ‘gnulib-tool --update’ > with Gnulib v0.0-7865-ga8

Re: array-copy! is slow & array-map.c

2013-04-05 Thread Ludovic Courtès
Daniel Llorens skribis: > Like this? Yes, thanks. Ludo'.

Re: array-copy! is slow & array-map.c

2013-04-05 Thread Ludovic Courtès
Daniel Llorens skribis: > From 76432b25fda11957142e94653aafbc798ef4d880 Mon Sep 17 00:00:00 2001 > From: Daniel Llorens > Date: Wed, 3 Apr 2013 22:40:40 +0200 > Subject: [PATCH 2/3] Remove double indirection in array-fill! > > * libguile/array-map.c: new function rafill, like scm_array_fill_int,

Re: [PATCH] Move let/ec to top-level

2013-04-05 Thread Ludovic Courtès
Nala Ginrut skribis: > Add call/ec and let/ec to (ice-9 control) with docs in the manual. I ended up making many changes (some suggested by Mark on IRC), and the result is commit 55e26a4. Please note the differences. It would be beneficial if your future submissions could be closer to our expe

Re: [PATCH] Move let/ec to top-level

2013-04-05 Thread Ian Price
Nala Ginrut writes: > +@deffn {Scheme Procedure} call/ec proc > +'ec' stands for escape-continuation, or so-called 'one-shot' continuation. > +@var{call/ec} is equivalent to call-with-escape-continuation. > +A continuation obtained from call/ec is actually a kind of prompt. > @var{call/ec} > +i

Re: [PATCH] Move let/ec to top-level

2013-04-05 Thread Ian Price
Okay, apparently Ludovic already mailed the list about this, but I didn't see it due to a stale gnus. Ah well. Such is life. -- Ian Price -- shift-reset.com "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled"

Re: [PATCH] Move let/ec to top-level

2013-04-05 Thread Ian Price
Attached is a patch to remove the duplicated definitions. -- Ian Price -- shift-reset.com "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled" >From ffbe4cf3c151d5d5affd5baecf7b4cf65b22ce50 Mon Sep 17 00:00:00 2001 From: Ia

Re: [PATCH] Move let/ec to top-level

2013-04-05 Thread Nala Ginrut
在 2013-4-6 AM8:53,"Ian Price" 写道: > > Nala Ginrut writes: > > > +@deffn {Scheme Procedure} call/ec proc > > +'ec' stands for escape-continuation, or so-called 'one-shot' continuation. > > +@var{call/ec} is equivalent to call-with-escape-continuation. > > +A continuation obtained from call/ec is ac

Re: [PATCH] Add backlog option to http-open

2013-04-05 Thread Nala Ginrut
On Fri, 2013-04-05 at 08:22 +0800, Daniel Hartwig wrote: > On 4 April 2013 12:39, Nala Ginrut wrote: > > I don't think it's necessary to add the docs since it's explicit. > > It may help for some guys like me. ;-) > > Every part of the API must be documented. How else do guys like you > know thi

[PATCH] Implement efficient 'scm_unget_bytes' and use it

2013-04-05 Thread Mark H Weaver
Hello all, I discovered that 'scm_unget_byte' is kind of dumb. It puts the bytes at the beginning of the pushback buffer instead of the end. This means that every time you unget a byte, it has to shift up the existing contents of the buffer, so ungetting N bytes takes O(N^2) time. This patch im