[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Brian Buckley

3/7/2006 6:09:00 PM

require 'facet/symbol/to_proc'

[[1,2], [], [1,2,3]].map(&:length) #line 1 Blows up re undefined method
length for Fixnum?

["ab", "", "abc"].map(&:length) #line 2 => [2, 0, 3] but this works fine

Why does the first line fail by trying to call method length on Fixnum?
Shouldn't it be calling length on Array (which is defined) and thus return
[2,0,3] ? Note the next line behaves as I'd expect, but for Strings.

What's happening?
10 Answers

matthew.moss.coder

3/7/2006 6:21:00 PM

0

I get the error "wrong argument type Symbol (expected Proc)
(TypeError)", not undefined method.


matthew.moss.coder

3/7/2006 6:22:00 PM

0

Ack, nevermind. I'm a silly person, ignore me.

On 3/7/06, Matthew Moss <matthew.moss.coder@gmail.com> wrote:
> I get the error "wrong argument type Symbol (expected Proc)
> (TypeError)", not undefined method.
>


dblack

3/7/2006 6:34:00 PM

0

Logan Capaldo

3/7/2006 9:12:00 PM

0


On Mar 7, 2006, at 1:09 PM, Brian Buckley wrote:

> require 'facet/symbol/to_proc'
>
> [[1,2], [], [1,2,3]].map(&:length) #line 1 Blows up re undefined
> method
> length for Fixnum?
>
> ["ab", "", "abc"].map(&:length) #line 2 => [2, 0, 3] but this
> works fine
>
> Why does the first line fail by trying to call method length on
> Fixnum?
> Shouldn't it be calling length on Array (which is defined) and thus
> return
> [2,0,3] ? Note the next line behaves as I'd expect, but for Strings.
>
> What's happening?

I figured it out! I figured it out!

theorizing that to_proc was implemented thusly:

class Symbol
def to_proc
lambda { |obj, *args| obj.send(self, *args) }
end
end

which would be fine, except, ba bum bum! you have an array of arrays!
map or each or someone is passing it via yield which is
sending :length.to_proc.call two args which turns into 1.send
(:length, 2)



The Peeler

9/22/2013 11:17:00 AM

0

On Sun, 22 Sep 2013 13:03:35 +0200, the Dutch pig oinked:

> Brian Lambsky, the Peeler and the Kickboxer can do nothing but passively
> watch the Dutch psychopath self destruct - one hate message at a time. An
> unexpected spinoff of his hate messages is that they bring great luck to the
> Peeler, Brian Lambsky and the Kickboxer.
>
> They feel that Heinrich is sacrificing himself for them, and they are
> absolutely correct!
>
> Oh well, fuck Heinrich!
>
> http://thewhite...

What's life like for a complete idiot like you, Dumb Heini? Eh? <VBG>

--
Dumb Dutch Nazi Heini's idiotic "mind" in action:
"he doe idiotes not type god but g-d the idiot"
MID: <8Yj4s.37$H37.15@newsfe06.iad>

Carolina Reb

9/22/2013 11:22:00 AM

0

"Heinrich" wrote in message
news:523ed02a$0$56954$2e0edba0@news.tweakdsl.nl...

>http://thewhite...
>
>
>
>
>The House of Representatives, the Senate, and other mainstream outlets may
>have White people but none of them express that there is a such thing as a
>White identity.


There is now:

http://whitebiocentrism.com/viewtopic.php?f...




*


The Peeler

9/22/2013 11:26:00 AM

0

On Sun, 22 Sep 2013 07:22:01 -0400, "All Bark & No Bite", aka Humpin
Humpton, aka Caroloony Reb, the subnormal moron and attested schizo from
the States, wrote:

>>
>>
>>The House of Representatives, the Senate, and other mainstream outlets may
>>have White people but none of them express that there is a such thing as a
>>White identity.
>
> There is now:
>
> http://whitebiocentrism.com/viewtopic.php?f...
>
> *

REAL "Whites" SPIT on subnormal white trash like you and the Dutch Nazitard,
Stupid Caroloony! And both of you KNOW it! <BG>

--
NoSpamAtAll about Stupid Caroloony:
"Carolina Reb" = Walt Hampton = shiteating nazoid cockroach +
an old failure who never amounted to anything and never will +
a lonley old bastard BEGGING people to write him + plonking
a-la Streicher"
MID: <km50gu$5sp$1@pcls6.std.com>

kickboxerthedestroyer

9/22/2013 11:33:00 AM

0

> There is now:
>
> http://whitebiocentrism.com/viewtopic.php?f...

Why do you do this to yourself when you know that most White women would rather sleep with an ugly Zionist than with you?

Carolina Reb

9/22/2013 12:05:00 PM

0



"Kickboxer The Destroyer" wrote in message
news:3e1520e2-77dd-45b9-bd2c-46098b96196c@googlegroups.com...

>> There is now:
>>
>> http://whitebiocentrism.com/viewtopic.php?f...
>
>Why

(FU), HQ, NoSpamAtAll, binzi kramer,
someone-who-knows-jack-shit,
Exocet Missile, Marshall Zhukov, The
Plonker, Ron Jakobsohn, The Peeler,
b-o-z-o, Kickboxer The Destroyer,
etc.etc.etc.etc.etc.




*


René Groumal

9/22/2013 4:59:00 PM

0

Le 22/09/13 13:22, Walt Hampton a ?crit :
> "Heinrich" wrote in message
> news:523ed02a$0$56954$2e0edba0@news.tweakdsl.nl...
>
>> http://thewhite...
>>
>>
>>
>>
>> The House of Representatives, the Senate, and other mainstream outlets
>> may have White people but none of them express that there is a such
>> thing as a White identity.
>
>
> There is now:
>
> http://whitebiocentrism.com/viewtopic.php?f...
>

Racial homogeneity and racial consciousness are typically nazi dogmas
present in Mein Kampf .
We know the results.....