Larry Wall wrote:
On Tue, Nov 16, 2010 at 12:11:01PM -0800, Darren Duncan wrote:
: Carl Mäsak wrote:
: >Darren (>):
: >>While I haven't seen any prior art on this, I'm thinking that it would be
: >>nice for a sense of completeness or parity to have an 0a syntax specific to
: >>base-4 that complements the 4 that we have now for bases 2,8,16,10.
: >
: >You're joking, right?
: : No, its a serious idea, just not so conventional. -- Darren Duncan

The lack of base 4 numbers in Real Life seems to me to justify the
convention.  Do you have a use case?

Actually, the primary case I was thinking of was with blobs.

S02 currently says:

* Blob literals look similar to integer literals with radix markers, but use curlies instead of angles:
    :2{0010_1110_1000_10}   a blob1, base 2, 1 bit per column
    :4{}                    a blob2, 2 bits per column
    :8{5235 0437 6}         a blob3, 3 bits per column
    :16{A705E}              a blob4, 4 bits per column
  Whitespace and underscores are allowed but ignored.

Now, granted, all of the above examples use :N format, but if 0a formats actually are supported for blobs as I would expect given the above description, like this:

    0b{0010_1110_1000_10}   a blob1, base 2, 1 bit per column
    0o{5235 0437 6}         a blob3, 3 bits per column
    0x{A705E}               a blob4, 4 bits per column

... then for blobs in particular, I had thought it would be appropriate to have a base-4 version.

But if there is no agreement, then so be it, I will retract my proposal.

-- Darren Duncan

Reply via email to