inject:into:

Samuel Tardieu sam at rfc1149.net
Wed Nov 10 11:07:50 UTC 2004


>>>>> "Alexandre" == Alexandre Bergel <bergel at iam.unibe.ch> writes:

Alexandre> Hi!  I am wondering why the binaryBlock passed to an
Alexandre> 'inject:into:' do not bound the current element to the
Alexandre> first argument. In some other words why do we write:

Alexandre> #(a b c) inject: '' into: [:partialAnswer :el| partialAnswer , el]
Alexandre> and not:
Alexandre> #(a b c) inject: '' into: [:el :partialAnswer| partialAnswer , el]

Alexandre> It would more make sense, at least for me.

Not to me. Your data will be handled from first to last, which is left
to right in our current representation. It makes more sense to me to
have an operator whose first argument is placed left (partialAnswer)
and the second is placed right (el).

  Sam
-- 
Samuel Tardieu -- sam at rfc1149.net -- http://www.rfc1149.net/sam




More information about the Squeak-dev mailing list