leah blogs

August 2004

16aug2004 · Flipping my LSB

Today, my age is flipping it’s least significant bit (yeah, I’m a little-endian-head).

For reference, “getting older” in several languages I know:

Ruby:

self.age += 1

Perl:

$self->age++;

C:

age++;

C++ (*g*):

++age;

sh:

AGE=`expr $AGE+1`

bash:

$((AGE++))

Common Lisp:

(incf age)

Scheme:

(set! age (+ 1 age))

dc:

lA1+sA

Forth:

1 age +!

Brainfuck:

+

Smalltalk:

age ← age + 1.

BlueMoon:

set :age + age 1

Intercal (assuming the age is in register .1), untested:

.2 <- #1
PLEASE DO (1000) NEXT
.1 <- .3

… I’m running out of languages.

To the non-geeks: It’s my birthday today!

NP: Beethoven—Freude schöner Götterfunken

Copyright © 2004–2022