Piping operator, new version

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

Piping operator, new version

Alexander Batalshikov
Hello,

I create new version of Vassili Bykov package for piping operator.

Main changes: 
1. Syntax highlights work well for expressions with piping operator.
2. Cascade and piping operators may be used together.
For example:
  (1 to: 10) at: 2 put: 10; 
        collect: [:x | x * x ] :> select: [:x | x \\ 3 = 1].
This is roughly same as:
  temp1 := (1 to: 10).
  temp1 at: 2 put: 10. 
  (temp1 collect: [:x | x * x ]) select: [:x | x \\ 3 = 1].

Attached changeset work well in Squeak 4.1 and Cuis 2.6. 

Please try.

Regards,
    Alexander Batalshikov.



VassiliBykovPipe.2.cs (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Piping operator, new version

Alexander Batalshikov
Sorry, small bug fix :)
(not work in some cases of mix cascade and piping).

And example of using must be:
 (1 to: 10) asArray at: 2 put: 10; 
        collect: [:x | x * x ] :> select: [:x | x \\ 3 = 1].

or: 

 (1 to: 10) asArray :> at: 2 put: 10; 
        collect: [:x | x * x ] :> select: [:x | x \\ 3 = 1].



VassiliBykovPipe.3.cs (3K) Download Attachment