The 419 version is a complete redesign of Labrador. It is based on personal experience and interest and on some feedback of the community.
As a matter of fact, there was not much interest in it :(. My own center of interest has shifted as well. After being focused on making ruby programs as short as possible I have become much more interested in alternate design techniques like Prototypes, Traits and Lazy Evaluation.
I decided to change the name to Lab419 in the hope that, once Ruby2.0 comes out I will have Lab42. Furthermore I really wanted to restructure the project. Thus one can just download what one wants to play with, without the other crap.
You will therefore find archives like
lab419::functional, lab419::tools &
lab419::object-oriented
Junctions
A pure Ruby implementation of Junctions as planned for Perl6. [1]
Junctions are composite expressions that reply to methods as would their elements. E.g.
any(1, 2, 3) > 2 --> true [ 1, 3, 5 ].all.odd? --> true none( 1 ).zero? --> true all() == nil --> true any() == nil --> falseA popular use case is
if any( "--help", "-?", "-h" ) == param then
usage
Junctions can be constructed by either
- using the module methods any, all, none and one of Lab419::Junctions
- by using junction methods of enumerables (1..3).all > 0
- by including Lab419::Junctions
- using the J() operator for RHS junctions[2]
Junctions are part of Lab419::functional-0.1.2+
Perl 6 Junctions
If you want to use Junctions in Perl 5
The Word of The Larry
Perl6 FAQ about Junctions
[2]
It seems not a good idea to touch the whole set of core classes to redefine all methods to check for RHS junctions to
ordinary object operators.
Verify
Verify is a very minimalistic test framework that scales well with small to medium sized unit tests. It is extremly robust due to an implementation using mostly closures. It can therefore be used for testing Ruby projects that touch the Ruby core and standard library.
It has a very lean API too, (examples can be found on my BLOG), as inspired by Ara T. Howard's Testy package.
While right now projects that redefine methods like
Kernel#puts or Integer#+ cannot be tested
the architecture of Verify allows to make it completely
independent of any Ruby core method (by capturing this behavior
before requiring the testee).
This is relatively dull work and would increase the size of this very small code size by an order of magnitude.
But in case such a beast is useful for anyone just drop me a mail and I might implement it after all ;).
Streams
They are part of Lab419::functional-0.1 onwards. I have explained the base of streams and my implementation on my Blog Streams, Lazy Programs for Lazy Programmers but as I pointed out on my Blog too there are far superiour authorities about streams. The master post is by James Edward Gray II and can be found here. I also immensly enjoyed the old MIT lectures about streams here.