File: README

package info (click to toggle)
libiterator-util-perl 0.02%2Bds1-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 136 kB
  • sloc: perl: 234; makefile: 2
file content (69 lines) | stat: -rw-r--r-- 2,050 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Iterator::Util version 0.02
===========================

This module contains many useful utility functions for use with the
Iterator class (q.v.).  The inspiration for many of these functions
has been Mark Jason Dominus's lectures and recent book (_Higher Order
Perl_, Morgan Kauffman, 2005).

An "iterator" is an object, represented as a code block that generates
the "next value" of a sequence, and generally implemented as a
closure.  Iterator.pm provides a class that simplifies creation and
use of these iterator objects, and provides many general-purpose
iterator functions.

EXAMPLES

    $it = irange (1, 3);

    $i = $it->value;     #  returns 1
    $i = $it->value;     #  returns 2
    $i = $it->value;     #  returns 3
    $i = $it->value;     #  throws an Iterator::X::Exhausted exception.

    $another_it = imap {$_ * $_}  irange (7, 10);

    while ($another_it->isnt_exhausted)
    {
        print $another_it->value, "\n";
    }
    # The above prints 49, 64, 81, 100 and throws no exceptions.
    # Another call to $another_it->value would throw an exception.

DEVELOPMENT STATE

This is a brand-new module.  It has a decent test suite, but has
not been extensively field-tested.  Therefore, it should be considered
"beta" software, and used with care.

If you find any bugs, or if any behavior of Iterator surprises you,
I would be grateful if you could send me an email message about it.
Thanks.


INSTALLATION

To install this module, do the standard Perl module four-step:

   perl Makefile.PL    or    perl Makefile.pl LIB='my/install/path'
   make
   make test
   make install

DEPENDENCIES

This module requires these other modules and libraries:

  Iterator

COPYRIGHT AND LICENSE

Eric J. Roode, roode@cpan.org

To avoid my spam filter, please include "Perl", "module", or this
module's name in the message's subject line, and/or GPG-sign your
message.

Copyright (c) 2005 by Eric J. Roode. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.