Forum: Ruby Labrador-0.0.1 pre alpha released

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
703fbc991fd63e0e1db54dca9ea31b53?d=identicon&s=25 Robert Dober (Guest)
on 2007-06-13 23:11
(Received via mailing list)
Hi list

the very diligent folks from RubyForge have approved my request early
so I can thankfully pronounce the first release of Labrador.

Strange name for a strange package :) Here you go:

Labrador is a little bit like me, badly organized.
It is a quite unrelated collection of Ruby Code.
Maybe some day it will evolve into independant packages, maybe it will

Right, what can Labrador do for you?

First there is labrador/properties allowing to define properties
without instance variables
by means of closures. Check out the rdoc to learn more about it but a
very quick overview.

The technique I use comes from Tom Christiansans famous TOT, Tom's
Object Tutorial.

+ Safe, nobody will change your const property there is just no way.
+ Instance variable safe subclassing, as long as you carefully check
your properties
  in your inheritance chain and define your properties accordingly you
can use
  instance variables internally without any danger of interference.
  Instance variable free classes are thus ideal for frameworks.
+ The approach allows for interesting enhancements like e.g.
synchronisation mechanisms
  by properties, changing property traits dynamically and many more.

- Slow, benchmarks show consistently that property access is about 4
times slower than
  Instance variable accessors.
- Complicated, although the complexity of the implementation is
perfectly hidden enhancements
  can become difficult and might impose some more performance penalty.
A very extensive test
  suit - provided as far as I know - is necessary.

Labrador Enums
Very condense enumerator notation for lazy people. Special Style I
want to share with
those who are interested.

labrador/enum/map is released
labrador/enum/reject is under development.

  assert_equal %w{ b c d }, %w{ a b c }.map(:succ)
  assert_equal %w{ b c d }, %w{ a b c }.map.succ

  assert_equal [*2..4], [*0..2] ).map(:+, 2).sort

Look into test/test-map.rb for more examples.

703fbc991fd63e0e1db54dca9ea31b53?d=identicon&s=25 Robert Dober (Guest)
on 2007-06-13 23:14
(Received via mailing list)
this might be useful ;)

This topic is locked and can not be replied to.