Should blocks passed into Metacello methods like #for:do: return spec?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Should blocks passed into Metacello methods like #for:do: return spec?

jaayer
Concerning Metacello's block-accepting methods, should the blocks passed in always return spec? I ask because some sends in the image pass in blocks where the last message sent is yourself to "spec", making that the return value of the block, while other blocks just fall off at the end without explicitly returning spec. Is there a reason why one should be preferred over the other?


Reply | Threaded
Open this post in threaded view
|

Re: Should blocks passed into Metacello methods like #for:do: return spec?

Dale Henrichs
Ah:) I put the 'yourself' in the specs when I build them to make it easy
to add new lines ... with a 'yourself.' as the last line in a block or a
set of messages, I can reorder or insert new lines at the end without
having to always edit the line...

The methods in Metacello configurations are more of a DSL than Smalltalk
code (although it is executable smalltalk) and the blocks are used to
group specs that apply to a particular version/package/project/group/etc.

The return value of the blocks is not used...

Dale

On 11/16/2010 01:11 AM, jaayer wrote:
> Concerning Metacello's block-accepting methods, should the blocks passed in always return spec? I ask because some sends in the image pass in blocks where the last message sent is yourself to "spec", making that the return value of the block, while other blocks just fall off at the end without explicitly returning spec. Is there a reason why one should be preferred over the other?
>
>