[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] Sequence 0.1.0 Released

Caleb Clausen

10/7/2006 5:38:00 AM

Sequence version 0.1.0 has been released!

http://rubyforge.org/project...
http://sequence.ruby...

Sequence is a wrapper api for accessing data in Strings, Arrays,
Files, IOs, and Enumerations. Each sequence encapsulates some
data and a current position within it. There are methods for
moving the position, reading and writing data(with or without
moving the position) forward or backward from the current
position (or anywhere at all), scanning for patterns (like
StringScanner, but it works in Files too, among others), and
saving a position that will remain valid even after data is
deleted or inserted elsewhere within the sequence.

There are also some utility classes for making sequences reversed
or circular, turning one-way sequences into two-way, buffering,
and making sequences that are subsets or aggregations of existing
sequences.

Sequence is based on Eric Mahurin's Cursor library. I'd like to
thank Eric for Cursor, without which Sequence would not have
existed; my design is very much a derivative of his.

known problems:
Some unit tests fail
Buffered does not work at all
Shifting's modify methods don't work reliably
Some write operations failing for List
No unit tests at all for array-like sequences
(tho Reg's unit test does test OfArray at least somewhat...)

3 Answers

Hal E. Fulton

10/7/2006 6:04:00 AM

0

Caleb Clausen wrote:
> Sequence version 0.1.0 has been released!
>
> http://rubyforge.org/project...
> http://sequence.ruby...
>
> Sequence is a wrapper api for accessing data in Strings, Arrays,
> Files, IOs, and Enumerations. Each sequence encapsulates some
> data and a current position within it. There are methods for
> moving the position, reading and writing data(with or without
> moving the position) forward or backward from the current
> position (or anywhere at all), scanning for patterns (like
> StringScanner, but it works in Files too, among others), and
> saving a position that will remain valid even after data is
> deleted or inserted elsewhere within the sequence.

[snip]

Sounds interesting... is it better than Eric M's Cursor
class? Different in some significant way?


Hal

Bil Kleb

10/7/2006 1:36:00 PM

0

Caleb Clausen wrote:
>
> known problems:
> Some unit tests fail
> ..
> Some write operations failing for List
> No unit tests at all for array-like sequences

This is why I especially like this community -- you have
to apologize if your /0.1/ release isn't fully tested.

Regards,
--
Bil Kleb
http://fun3d.lar...

Caleb Clausen

10/7/2006 4:48:00 PM

0

On 10/6/06, Hal Fulton <hal9000@hypermetrics.com> wrote:
> Sounds interesting... is it better than Eric M's Cursor
> class? Different in some significant way?

Well, Sequence is faster than Cursor for most things. I haven't
benchmarked, but (eg) #read should be at least 10-100x faster. (Except
when reading from a file, which Cursor optimizes fairly well, if I
remember.)

I think that the support for #scan and friends (from StringScanner) is
better in Sequence. Eric will disagree with me on this.

Cursor doesn't have an equivalent to my Sequence::Subseq.
Cursor::Linked more or less corresponds to my Sequence::List (except
that I never properly understood Cursor::Linked -- how to use it, how
it works).

Those are the biggest differences. The sequence api has otherwise
about the same capabilities as its ancestor. I've moved everything
around to suit my way of thinking, tho, so it isn't compatible (except
for doing very simple things).