IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Because that didn't have enough parentheses
Here it is in Lisp. Pick your dialect of Lisp, it should work in virtually all of them...
\n  (((((lambda ( builder )\n    (lambda ( s )\n      (lambda ( p )\n        (lambda ( n )\n          ((((builder builder) s) p) n))))) (lambda ( recurse )\n    (lambda ( s )\n      (lambda ( p )\n        (lambda ( n )\n          (if (= 0 n)\n            1\n            ((((lambda ( builder )\n              (lambda ( n )\n                (lambda ( m )\n                  (((builder builder) n) m)))) (lambda ( recurse )\n              (lambda ( n )\n                (lambda ( m )\n                  (if (= 0 n)\n                    0\n                    ((((lambda ( builder )\n                      (lambda ( n )\n                        (lambda ( m )\n                          (((builder builder) n) m)))) (lambda ( recurse )\n                      (lambda ( n )\n                        (lambda ( m )\n                          (if (= 0 n)\n                            m\n                            (s (((recurse recurse) (p n)) m))))))) m)\n\t\t\t     (((recurse recurse) (p n)) m))))))) n)\n\t\t\t      ((((recurse recurse) s) p) (p n)))))))))\n\t\t\t       (lambda ( n )\n    (+ n 1))) (lambda ( n )\n    (- n 1))) 5)\n

This is, of course, a mechanical transformation of the JavaScript code. I may not have picked quite the standard Lisp indentation rules, but I don't think that any indentation will make this look nice...

Cheers,
Ben

Edit: Remove what I had mistakenly thought would be comments, and actually were syntax errors. Incidentally mit-scheme does better than JavaScript, it computes 8! (but barfs on 9!).
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
Expand Edited by ben_tilly March 4, 2005, 01:51:12 PM EST
New Re: Because that didn't have enough parentheses
Builder builder builder builder builder builder builder builder builder builder builder builder!
LAMBDA LAMBDA
A-builder builder builder builder builder builder builder builder builder builder builder builder!
LAMBDA LAMBDA
A-builder builder builder builder builder builder builder builder builder builder builder builder!
LAMBDA LAMBDA
A-builder builder builder builder builder builder builder builder builder builder builder builder!

RECURSE, RECURSE, ohhhhhh let's recurrrrrrrse! No, let's

Builder builder builder builder builder builder builder builder builder builder builder builder!
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
Expand Edited by admin March 3, 2005, 09:52:44 PM EST
New Glad to see that I had the desired effect ;-)
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
New You ALWAYS have the desired effect.
Tilly!

It's a refreshing beverage! A floor wax! A handy-dandy portable microwave!

Tilly!

For when you absolutely positively have to have the desired effect.


Peter
[link|http://www.ubuntulinux.org|Ubuntu Linux]
[link|http://www.kuro5hin.org|There is no K5 Cabal]
[link|http://guildenstern.dyndns.org|Home]
Use P2P for legitimate purposes!
New Till-AAAYYYY!!
===

Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats].
[link|http://DocHope.com|http://DocHope.com]
New Sounds like a Little League (baseball) game...
jb4
shrub\ufffdbish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating the facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT

New This reminds me of the Shapes examples.
The ones that Jim was collecting way back on the OO board we had. I believe our own Scott submitted one done in shell script?

Wade.

Is it enough to love
Is it enough to breathe
Somebody rip my heart out
And leave me here to bleed
 
Is it enough to die
Somebody save my life
I'd rather be Anything but Ordinary
Please

-- "Anything but Ordinary" by Avril Lavigne.

New Nope.
awk, sed, LPC, DOS batch, postscript, and FoxPro, though. :-)
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Ah - I was thinking of DOS batch.

Is it enough to love
Is it enough to breathe
Somebody rip my heart out
And leave me here to bleed
 
Is it enough to die
Somebody save my life
I'd rather be Anything but Ordinary
Please

-- "Anything but Ordinary" by Avril Lavigne.

New You did DOS batch, too? Dang, *I* was gonna do that... :-(
New I pasted that into vim
I've got parenthesis matching on. Vim gave me the finger.
===

Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats].
[link|http://DocHope.com|http://DocHope.com]
New Heh. (BTW works fine in my vim)
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
New Uhh ... that whooshing sound you hear ...
Look up. It's the joke sailing by. Unless your vim does make a habit of rude hand gestures. I don't have that version.
===

Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats].
[link|http://DocHope.com|http://DocHope.com]
New I wasn't sure if it might have actually crashed
After all Ruby did when presented with the Ruby equivalent...

Cheers,
Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
New that's OK
I routinely give vim the finger whenever I'm forced to use it...
jb4
shrub\ufffdbish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating the facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT

     Because I can :-P - (ben_tilly) - (29)
         ... -NT - (admin)
         Make it stop, it hurts! -NT - (Yendor)
         Ick! -NT - (tuberculosis) - (3)
             It could be worse... - (ben_tilly) - (2)
                 It could be raining? -NT - (tuberculosis) - (1)
                     That's always possible in Seattle. :-P -NT - (ben_tilly)
         Omniscient LRPD: His skill is being wasted. -NT - (broomberg) - (4)
             The tricks that he does are ever so clever. -NT - (ben_tilly) - (3)
                 Nihil curo de ista tua stulta superstitione. -NT - (admin) - (2)
                     It's a trick. Get an axe. -NT - (folkert)
                     It's like watching someone try to explain quantum physics... - (ben_tilly)
         You should send this ... - (static)
         Hofstadter! - (Ashton)
         Because that didn't have enough parentheses - (ben_tilly) - (14)
             Re: Because that didn't have enough parentheses - (admin) - (4)
                 Glad to see that I had the desired effect ;-) -NT - (ben_tilly) - (2)
                     You ALWAYS have the desired effect. - (pwhysall) - (1)
                         Till-AAAYYYY!! -NT - (drewk)
                 Sounds like a Little League (baseball) game... -NT - (jb4)
             This reminds me of the Shapes examples. - (static) - (3)
                 Nope. - (admin) - (2)
                     Ah - I was thinking of DOS batch. -NT - (static)
                     You did DOS batch, too? Dang, *I* was gonna do that... :-( -NT - (CRConrad)
             I pasted that into vim - (drewk) - (4)
                 Heh. (BTW works fine in my vim) -NT - (ben_tilly) - (2)
                     Uhh ... that whooshing sound you hear ... - (drewk) - (1)
                         I wasn't sure if it might have actually crashed - (ben_tilly)
                 that's OK - (jb4)
         Job security squared! -NT - (tablizer)

Can anyone say, "injection-molded plastic"? I thought you could.
83 ms