an "intuitive" error message

Chris Schreiner chris.schreiner at online.no
Mon Jul 4 11:46:25 UTC 2005


I understand this now. But I dont think the error message is *helping* 
me to understand it.

CPS

>Nope, the block accepts one.
>
>[ :foo | ... ]
>
>can only be called with one argument, not two or more. But
>
>keysAndValuesDo: aBlock
>
>calls it with two. The first is the key, the second is the value. It calls
>
>aBlock value: key value: value.
>
>The error is signaled by the block.
>
>Regards
>
>mue
>
>  
>
>>So, it should read;
>>
>>"Error: This block accepts 2 arguments, but was called with 1"
>>
>>;-)
>>
>>
>>Frank Mueller skrev:
>>
>>    
>>
>>>Hmm, I don't see the problem.
>>>
>>>The block [ :each | ... ] accepts only one argument, named "each". But keysAndValuesDo:
>>>delivers two arguments. So the tight way would be
>>>
>>>Dictionary new at: 1 put: 1; keysAndValuesDo: [:key :value | ... ].
>>>
>>>Regards
>>>
>>>mue
>>>
>>>
>>>
>>>      
>>>
>>>>Lets start monday morning with an intuitive error message:
>>>>
>>>>   Dictionary new at: 1 put: 1; keysAndValuesDo: [:each | ].
>>>>
>>>>"Error: This block accepts 1 argument, but was called with 2"
>>>>
>>>>
>>>>        
>>>>
>>>
>>>      
>>>
>>
>>
>>    
>>
>
>
>  
>




More information about the Squeak-dev mailing list