[Pharo-project] bindWith: implementation missing

Sabine Knöfel sabine.knoefel at gmail.com
Wed Jul 11 03:08:45 EDT 2012


Thank you, Benoit.
Sabine

On Tue, Jul 10, 2012 at 5:05 PM, Benoit St-Jean <bstjean at yahoo.com> wrote:
> Something like this ?
>
> bindWith: arg1
>     ^ self bindWithArguments: (OrderedCollection with: arg1)
>
>
> bindWith: arg1 with: arg2
>     | coll |
>     coll := OrderedCollection with: arg1 with: arg2.
>     ^ self bindWithArguments: coll
>
>
> bindWith: arg1 with: arg2 with: arg3
>     | coll |
>     coll := OrderedCollection
>         with: arg1
>         with: arg2
>         with: arg3.
>     ^ self bindWithArguments: coll
>
>
>
> bindWith: arg1 with: arg2 with: arg3 with: arg4
>     | coll |
>     coll := OrderedCollection
>         with: arg1
>         with: arg2
>         with: arg3
>         with: arg4.
>     ^ self bindWithArguments: coll
>
> bindWithArguments: aCollection
>
>     | newString end |
>     newString := self copy.
>     end := aCollection size.
>     end to: 1
>         by: -1
>         do: [:i | newString := newString copyReplaceAll: '%' , i printString
> with: (aCollection at: i)].
>     ^newString
>
>
> -----------------
> Benoit St-Jean
> Yahoo! Messenger: bstjean
> A standpoint is an intellectual horizon of radius zero.
> (Albert Einstein)
>
> ________________________________
> From: Sabine Knöfel <sabine.knoefel at gmail.com>
> To: pharo-project at lists.gforge.inria.fr
> Sent: Tuesday, July 10, 2012 10:49:51 AM
> Subject: [Pharo-project] bindWith: implementation missing
>
> Hi All,
>
> I miss String>>bindWith:
>>>bindWith: with:
> etc.
>
> in Pharo. Is there a reason for that missing?
> Has anyone an implementation for me?
> I dont want to reinvent the wheel ;-)
>
> Greetings
> Sabine
>
>
>




More information about the Pharo-dev mailing list