Some tools for D

Downs default_357-line at yahoo.de
Thu Aug 23 02:20:49 PDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Here's a patch that introduces a vastly simplified map/reduce/filter
syntax for small functions. Also allows you to use functions instead of
delegates.

Example:
* Previous version:
  * Integers[0..10]~
    tszip(Integers[10..20])~
    map((TupleStruct!(Pair!(int)) ts) {
      return ts.values[0]*ts.values[1];
    })~
    reduce((ref int a, int b) { a+=b; })
* Patched Version:
  * Integers[0..10]~
    tszip(Integers[10..20])~
    maps!("_.values[0]*_.values[1]")~
    reduces!("+=_")

 --downs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGzVFxpEPJRr05fBERAhJTAJ4tUJ1c/3OrEvQ+0kVtea8oCGufYgCfRSiY
wAnW+sjfL3tRkb50urH0luM=
=G/82
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tools.patch
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20070823/800f7edf/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tools.patch.sig
Type: application/octet-stream
Size: 65 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20070823/800f7edf/attachment.obj>


More information about the Digitalmars-d mailing list