|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Orchid XP v7 wrote:
> Yeah, true. And that's the kind of trick Haskell's compiler is likely to
> pull off too...
I thought it was pretty cool that the latest Erlang compilers will see
code like
map(F, [H|T]) -> [F(H)|map(F,T)];
map(F, []) -> [].
and turn it into the same code you'd get with an auxiliary accumulator
and a call to "reverse" at the end.
--
Darren New / San Diego, CA, USA (PST)
"That's pretty. Where's that?"
"It's the Age of Channelwood."
"We should go there on vacation some time."
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Darren New wrote:
> I thought it was pretty cool that the latest Erlang compilers will see
> code like
>
> map(F, [H|T]) -> [F(H)|map(F,T)];
> map(F, []) -> [].
>
> and turn it into the same code you'd get with an auxiliary accumulator
> and a call to "reverse" at the end.
Doesn't reverse require N operations? Wouldn't that mean that map now
takes 2N operations instead of just N?
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Orchid XP v7 wrote:
> Darren New wrote:
>
>> Hey, Mark Chu-Carrol. I went to grad school with him, back when he was
>> Mark Carrol. Actually, I knew his wife Chu also. :-) Funky where you
>> run across people.
>
> Not when you live by yourself in your bedroom...
>
Trying to visualize you running across people in your bedroom...
Weird.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
andrel wrote:
> Trying to visualize you running across people in your bedroom...
>
> Weird.
Not as weird as the picture *I* had in my head when I mis-parsed your
sentence as "running *across* people in your bedroom"... o_O
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Orchid XP v7 wrote:
> andrel wrote:
>
>> Trying to visualize you running across people in your bedroom...
>>
>> Weird.
>
> Not as weird as the picture *I* had in my head when I mis-parsed your
> sentence as "running *across* people in your bedroom"... o_O
>
Where was the mis-parsing in that?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
>>> Trying to visualize you running across people in your bedroom...
>>>
>>> Weird.
>>
>> Not as weird as the picture *I* had in my head when I mis-parsed your
>> sentence as "running *across* people in your bedroom"... o_O
>>
> Where was the mis-parsing in that?
To "run across" somebody is a figure of speach. I took it literally. [As
in, I had visions of people laying on the ground and having me run
across them, sort of like crowd surfing...]
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Orchid XP v7 wrote:
>>>> Trying to visualize you running across people in your bedroom...
>>>>
>>>> Weird.
>>>
>>> Not as weird as the picture *I* had in my head when I mis-parsed your
>>> sentence as "running *across* people in your bedroom"... o_O
>>>
>> Where was the mis-parsing in that?
>
> To "run across" somebody is a figure of speech. I took it literally. [As
> in, I had visions of people laying on the ground and having me run
> across them, sort of like crowd surfing...]
>
Me too. Note that English is not my mother tongue (indeed my mother has
that horrible 1950's Dutch accent when trying to speak English.) so it
is probably more easy for me to take figures of speech literally. It may
also come from reading too much Pratchett.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
andrel wrote:
>
> Me too. Note that English is not my mother tongue (indeed my mother has
> that horrible 1950's Dutch accent when trying to speak English.) <snip>
What's wrong with a Dutch accent? I used to have a Dutch gf and even now
I find English spoken with a pronounced nederlandse accent _really_ sexy.
John
--
I will be brief but not nearly so brief as Salvador Dali, who gave the
world's shortest speech. He said, "I will be so brief I am already
finished," then he sat down.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Orchid XP v7 wrote:
> Darren New wrote:
>
>> I thought it was pretty cool that the latest Erlang compilers will see
>> code like
>>
>> map(F, [H|T]) -> [F(H)|map(F,T)];
>> map(F, []) -> [].
>>
>> and turn it into the same code you'd get with an auxiliary accumulator
>> and a call to "reverse" at the end.
>
> Doesn't reverse require N operations? Wouldn't that mean that map now
> takes 2N operations instead of just N?
Probably. But note that map as I wrote it isn't tail recursive, unless
the compiler can do what I said. Hence, on a list of 10,000 elements,
the code there will take 10,000 stack frames. The compiler is now smart
enough to see what you're doing and generate tail-recursive code from it.
--
Darren New / San Diego, CA, USA (PST)
"That's pretty. Where's that?"
"It's the Age of Channelwood."
"We should go there on vacation some time."
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Doctor John wrote:
> andrel wrote:
>> Me too. Note that English is not my mother tongue (indeed my mother has
>> that horrible 1950's Dutch accent when trying to speak English.) <snip>
> What's wrong with a Dutch accent? I used to have a Dutch gf and even now
> I find English spoken with a pronounced nederlandse accent _really_ sexy.
>
I wasn't talking about a general modern Dutch accent but the older one
that e.g. pronounces one as 'when'. In a slightly milder form it was
also spoken by our former PM ruud lubbers IIRC. To their defense, it was
developed during the period when English lessons consisted of making
translations. No English was spoken during lessons.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |