develooper Front page | perl.perl5.porters | Postings from July 2014

[perl #122222] base-n literals?

From:
Jarkko Hietaniemi
Date:
July 3, 2014 20:16
Subject:
[perl #122222] base-n literals?
Message ID:
rt-4.0.18-15218-1404418571-1954.122222-75-0@perl.org
# New Ticket Created by  Jarkko Hietaniemi 
# Please include the string:  [perl #122222]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=122222 >


(This is a much longer shot than the hexadecimal floats I reported earlier.  Not necessarily the most urgent but for .. completeness?)

But while we are on the subject of more bases... quite many languages support literals and input/output bases 2-36 (36 = 10 + 26 ASCIIbets, in lower or upper).  No, there are no obvious ways to continue the digits.  Base64?  Well, which Base64?

Looking over at http://rosettacode.org/wiki/Literals/Integer

BASErDIGITS

  BASE in decimal, literal 'r', and then the digits, e.g. 7r15 for 12

  Clojure, Common Lisp, Emacs Lisp (#BASErDIGITS)

BASEbDIGITS

  In J, but J is really... different.

:BASE<DIGITS>

  Perl 6, e.g. :3<100110> (really...? that's... weird)

BASE#DIGITS

  PostScript







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