[Prev][Next][Index][Thread]

# Re: [wish list]: perl stuff

- Date: Fri, 9 Aug 1996 11:59:15 PDT
- From:
- Cc: moo-cows@parc.xerox.com
- Content-Type: TEXT/PLAIN; charset=US-ASCII
- In-Reply-To: <2.2.32.19960809164457.00717fd0@vv.com>

    > Somewhat Perly.  The ability to reference '[a..b]' as if it were an
    > inclusive list of all integers 'a' through 'b'.  Like...
    >
    >         if (foo in [5..8])
    >
    > Rather than...
    >
    >         if ((foo > 4) && (foo < 9))

    Better yet, how about builtin support for arbitrary obj/string/int/float
    ranges? Something like range(start_value, end_value [, step size])
    step_size should be optional and default to one; raise E_TYPE if
    start_value and end_value don't have the same value or are of some
    type unsupported by range.  [Incidentally, someone else has already
    requested support for letter ranges such as
       for letter in ["a".."z"]
    ] Then have the statement [start..end] be synonymous with range(start,
    end) so that all of the following could work identically:

    for letter in ["a".."e"]
    for letter in {"a", "b", "c", "d", "e"}
    for letter in range("a", "e")

    michael

References:

- [wish list]: perl stuff

- From: Quinn <quinn@vv.com>

- Prev: Re: [wish list]: perl stuff
- Next: Re: [wish list]: perl stuff
- Index: MOO-cows
- Thread: MOO-cows

Home | Subject Index | Thread Index