Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Adding 2 + 2

by I0 (Priest)
on Dec 30, 2000 at 18:33 UTC ( #48981=note: print w/ replies, xml ) Need Help??


in reply to Adding 2 + 2

sub S{ return [shift]; } sub P{ return (shift)->[0]; } sub add{ my($x,$y) = @_; return $x unless $y; return add(S($x),P($y)); } sub arabic{ my $x = shift; return 0 unless $x; return 1+arabic(P($x)); } $y=$x = S S; print arabic($x),"+",arabic($y),"=",arabic(add($x,$y)),"\n";


Comment on Re: Adding 2 + 2
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://48981]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (12)
As of 2014-09-02 21:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (29 votes), past polls