develooper Front page | perl.perl6.language | Postings from November 2010

base-4 literals

Thread Next
From:
Darren Duncan
Date:
November 16, 2010 11:46
Subject:
base-4 literals
Message ID:
4CE2DF87.6040004@darrenduncan.net
A simple proposal ...

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.

With that addition, the line-up would look like this:

   0b - binary (2)
   0t - tetra (4)
   0o - octal (8)
   0d - decimal (10)
   0x - hexidecimal (16)

Another alterative for 0t is 0q (quad) but I like the look of 0t more because 
that character's glyph doesn't have a descender like the other 4.

With numeric literals, it means we have an 0a form for every power of 2 between 
1 and 4, rather than skipping one.

Even more important, with blob literals, we have an 0a form for every power 
likely to be used period, since for all practical purposes they can only take 
literals in powers of 2 anyway.

So, any thoughts on this?

-- Darren Duncan

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About