Annoying octal notation

NevilleDNZ nevillednz at gmail.com
Sat Sep 5 03:09:19 CEST 2009


On Sep 3, 2:57 pm, James Harris <james.harri... at googlemail.com> wrote:
> On 3 Sep, 14:26, Albert van der Horst <alb... at spenarnc.xs4all.nl>
> wrote:
>
> > In article <6031ba08-08c8-416b-91db-ce8ff57ae... at w6g2000yqw.googlegroups.com>,
> > James Harris  <james.harri... at googlemail.com> wrote:
> > <SNIP>
>
> > >So you are saying that Smalltalk has <base in decimal>r<number> where
> > >r is presumably for radix? That's maybe best of all. It preserves the
> > >syntactic requirement of starting a number with a digit and seems to
> > >have greatest flexibility. Not sure how good it looks but it's
> > >certainly not bad.
>
> > >  0xff & 0x0e | 0b1101
> > >  16rff & 16r0e | 2r1101
>
> > >Hmm. Maybe a symbol would be better than a letter.
>
> > Like 0#ff  16#ff ?
>
> Yes, that looks better.
>
> > That is ALGOL68. It is incredible how many of it has become
> > vindicated over time. (Yes, nineteen hundred sixty eight was
> > the year that language was conceived.)
>
> Yes, and its predecessor Algol 60 was a masterful advance in
> programming languages. It set up standards we still use today.
c.f. http://en.wikiquote.org/wiki/C._A._R._Hoare#The_Emperor.27s_Old_Clothes

>
> James

However I don't recall Algol60 having Bin/Oct/Hex numeric
literals.  c.f. http://www.masswerk.at/algol60/report.htm

And I am pretty sure that Algol60 had neither builtin
byte operators (eg xor, shl/shr), nor a builtin ability to
read nor printf oct/hex.  Maybe these were in AlgolW or a
Burroughs/Unisys dialect of Algol60?

(FYI: AlgolW has been reincarnated by Glyn Webster with
his worthy AlgolW to gcc 'C' translator.  To be found at:
http://www.jampan.co.nz/~glyn/)

The lack input/output in Algol60 did mean you could never
shoot yourself in the foot with true Algol60 c.f.:
[http://www.toodarkpark.org/computers/humor/shoot-self-in-foot.html]
>* Algol 58/60+ - shoot yourself in the foot with a Civil
>   War-era musket. The musket is aesthetically fascinating,
>   and the wound baffles the adolescent medic in the
>   emergency room.
>* Algol 60 - You spend hours trying to figure out how
>   to fire the gun because it has no provisions for input
>   or output.

On the other hand compare:
>* Algol 68 - You mildly deprocedure the gun, the bullet
>   gets firmly dereferenced, and your foot is strongly
>   coerced to void.

(I do know Algol 68 has the builtin mode "BITS" with
matching literals, casts, operators and input/output, cf:
http://rosettacode.org/wiki/Bitwise_operations#ALGOL_68 )

And in summary of 41 years of language advancement:
>* Python - You shoot yourself in the foot and then brag
>   for hours about how much more elegantly you did it
>   than if you had been using C or (God forbid) Perl.

N joy



More information about the Python-list mailing list