He's a capital lambda, if I'm not much mistaken, which is why he can't recurse. Doesn't mean he can't loop, though, just that all his loops are bounded.
Yerrrrrsss, but it's pushing it a bit to call that a loop!
Actually I agonised over the punchline for quite a while, and decided to go for the version I used because it was the funniest, even though I felt I should have been a bit more rigorous with Tim's definition.
I have plans for a new character, Yvonne, for a future cartoon. I think she will get on with Tim rather well. She'll definitely be able to bring something that's been missing in his life. If you see what I mean...
Yerrrrrsss, but it's pushing it a bit to call that a loop!
Oh, I don' t know, it has all the attributes of a loop like for item in list or even node = list; while(node != NULL) { f(node); node = node->next; } or anything which "loops" over a data structure. I don't know about you but I hardly ever write any other kind of loop. The only thing this kind of programming can't capture is indefinite loops, but who writes those except in servers? Oh, and GUI apps with event streams. Hmmm…
I don't know if I should admit this, but I spent many days (spread over several years) translating commonplace programs into lambda-2 just to show it could be done. The damaging effects are with me even now.
She'll definitely be able to bring something that's been missing in his life. If you see what I mean...
Funnily enough, on my walk home I was trying to think of how to represent this as a comic strip. In most languages the loop is the active bit, and the data structure is passive. So it's like having a creature (perhaps a fluffy!) running over the data structure and applying the function/loop body to each part of it. But in lambda-2 a data structure is the active thing that applies a function over itself, so I imagined a fluffy who applies the function to himself and then passes it on to his friends. In this case he's holding hands with one other fluffy and the function is a hula-hoop that turns him from from a fluffy into something else when he steps through. Then I remembered that fluffies don't have hands.
Have you read "Tales of the Beanworld" by Larry Marder?
Not quite. (Λβ. x) has type ∀β.α, where β is any symbol you like, of course. It has to be "applied" to a type. Normally in lambda-2 you write this kind of application differently (as a subscript) but I think this is silly, because some nested expressions get smaller and smaller, and you can usually tell whether it's a type or value application easily enough. Coo, I remember more than I thought.
No reason. I'm one of the few people who's ever been a commercial ML programmer, and old habits die hard. You're right that it's nicer to just call this "list" and have it take a type.
I hope compilerbitch doesn't mind us filling up her journal with this nonsense.
(no subject)
Date: 2004-12-15 05:08 am (UTC)(no subject)
Date: 2004-12-15 06:04 am (UTC)(no subject)
Date: 2004-12-15 06:20 am (UTC)For a lambda expression Tim looks suspiciously deltoid. ;^b
(no subject)
Date: 2004-12-15 07:22 am (UTC)(no subject)
Date: 2004-12-15 07:55 am (UTC)Consider
then
yields 10.
Phew! It's a long time since I did any lambda-2. Neurons aching. Eek!
(no subject)
Date: 2004-12-15 08:11 am (UTC)Actually I agonised over the punchline for quite a while, and decided to go for the version I used because it was the funniest, even though I felt I should have been a bit more rigorous with Tim's definition.
I have plans for a new character, Yvonne, for a future cartoon. I think she will get on with Tim rather well. She'll definitely be able to bring something that's been missing in his life. If you see what I mean...
(no subject)
Date: 2004-12-15 08:25 am (UTC)(no subject)
Date: 2004-12-15 08:43 am (UTC)(no subject)
Date: 2004-12-15 09:30 am (UTC)Oh, I don' t know, it has all the attributes of a loop like
for item in list
or evennode = list; while(node != NULL) { f(node); node = node->next; }
or anything which "loops" over a data structure. I don't know about you but I hardly ever write any other kind of loop. The only thing this kind of programming can't capture is indefinite loops, but who writes those except in servers? Oh, and GUI apps with event streams. Hmmm…I don't know if I should admit this, but I spent many days (spread over several years) translating commonplace programs into lambda-2 just to show it could be done. The damaging effects are with me even now.
But I'll bet she's a bit paradoxical ;-)
(no subject)
Date: 2004-12-15 03:47 pm (UTC)Funnily enough, on my walk home I was trying to think of how to represent this as a comic strip. In most languages the loop is the active bit, and the data structure is passive. So it's like having a creature (perhaps a fluffy!) running over the data structure and applying the function/loop body to each part of it. But in lambda-2 a data structure is the active thing that applies a function over itself, so I imagined a fluffy who applies the function to himself and then passes it on to his friends. In this case he's holding hands with one other fluffy and the function is a hula-hoop that turns him from from a fluffy into something else when he steps through. Then I remembered that fluffies don't have hands.
Have you read "Tales of the Beanworld" by Larry Marder?
(no subject)
Date: 2004-12-15 08:20 am (UTC)(no subject)
Date: 2004-12-15 09:37 am (UTC)(no subject)
Date: 2004-12-15 09:45 am (UTC)nil int : int list, where
nil int = Λβ . λb:β . λf:β→int→β . b
int list = ∀β.β→(β→int→β)→β
But it looks correct now.
(no subject)
Date: 2004-12-15 09:47 am (UTC)list ::= Λα.∀β.β→(β→α→β)→β
...?
(no subject)
Date: 2004-12-15 03:41 pm (UTC)No reason. I'm one of the few people who's ever been a commercial ML programmer, and old habits die hard. You're right that it's nicer to just call this "list" and have it take a type.
I hope
compilerbitch doesn't mind us filling up her journal with this nonsense.
(no subject)
Date: 2004-12-16 02:04 am (UTC):-)
I was paid to write Haskell for two whole weeks once...
(no subject)
Date: 2004-12-15 06:53 am (UTC)(no subject)
Date: 2004-12-15 07:24 am (UTC)(no subject)
Date: 2004-12-15 07:31 am (UTC)(no subject)
Date: 2004-12-15 08:19 am (UTC)Asked Nile, the visual logic person.
(no subject)
Date: 2004-12-15 08:22 am (UTC)And then the one where the poor old TM meets Godel and gets all diagonalised...
(no subject)
Date: 2004-12-15 07:46 am (UTC)Extreme coolness.
(no subject)
Date: 2004-12-15 11:38 am (UTC)hee hee :)
(no subject)
Date: 2004-12-15 12:34 pm (UTC)(no subject)
Date: 2004-12-15 02:55 pm (UTC)(no subject)
Date: 2004-12-15 07:24 pm (UTC)(no subject)
Date: 2004-12-16 07:05 am (UTC)(no subject)
Date: 2004-12-16 09:57 am (UTC)Yes, as it happens, I think she will be back now and again. As will Tim. :-)
(no subject)
Date: 2004-12-18 01:28 am (UTC)