[GTALUG] Swift vs Go vs Python vs Ruby

Stewart C. Russell scruss at gmail.com
Tue Jun 16 00:34:41 UTC 2015


Stacks and RPN are still the best thing ever*:

%!
% monkeys.ps
% best run with
%  gs -q -dNODISPLAY monkeys.ps
% if at all ...

/verse {
    dup print
    ( little monkey) print
    dup (One) ne {
	(s) print
    } if
    ( jumping on the bed\n) print
    dup (One) ne {
	(One fell off and bumped his head\n)
    } {
	(They fell off and bumped their head\n)
    } ifelse print
    (Mama called the doctor,\nAnd the doctor said\n) print
    (One) ne {
	(No more monkeys jumping on the bed\n)
    } {
	(Put those monkeys right to bed\n)
    } ifelse print
    (\n) print
} def

[ (Five) (Four) (Three) (Two) (One) ] { verse } forall
quit


cheers,
 Stewart

*: for job security, that is.


More information about the talk mailing list