Post #197,108
3/3/05 9:40:13 PM
3/4/05 1:51:12 PM
|
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)
Edited by ben_tilly
March 4, 2005, 01:51:12 PM EST
|
Post #197,110
3/3/05 9:48:00 PM
3/3/05 9:52:44 PM
|
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..."
Edited by admin
March 3, 2005, 09:52:44 PM EST
|
Post #197,143
3/4/05 2:22:30 AM
|
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)
|
Post #197,146
3/4/05 2:54:24 AM
|
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!
|
Post #197,186
3/4/05 10:11:00 AM
|
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]
|
Post #197,211
3/4/05 1:34:17 PM
|
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
|
Post #197,111
3/3/05 9:57:49 PM
|
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. |
|
Post #197,113
3/3/05 10:15:30 PM
|
Nope.
awk, sed, LPC, DOS batch, postscript, and FoxPro, though. :-)
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #197,119
3/3/05 11:31:01 PM
|
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. |
|
Post #197,155
3/4/05 5:08:13 AM
|
You did DOS batch, too? Dang, *I* was gonna do that... :-(
|
Post #197,213
3/4/05 1:57:39 PM
|
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]
|
Post #197,227
3/4/05 3:22:30 PM
|
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)
|
Post #197,229
3/4/05 3:29:35 PM
|
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]
|
Post #197,231
3/4/05 3:33:29 PM
|
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)
|
Post #197,258
3/4/05 7:15:55 PM
|
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
|