[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

ANN: StrongTyping 2.0.6a

Ryan Pavlik

9/8/2003 7:29:00 AM

StrongTyping 2.0.6a
===================

StrongTyping is a little ruby module that provides a convenient way
for ruby methods to check parameter types, and also dynamically
query them. In addition to merely checking a single set of types,
it allows easy overloading based on a number of different templates.

For example:

require 'strongtyping'
include StrongTyping

def foo(a, b, c)
expect(a, String, b, Numeric, c, [Integer, NilClass])
...
end


def bar(*args)
overload(args, String, String) {
| s1, s2 |
...
return
}

overload(args, String, Integer) {
| s, i |
...
return
}

overload_default args
end

You can find StrongTyping at the following location:

http://mephle.org/Str...

(This has been around for awhile, but as Mephle is being released and
people may not have seen it, I decided now would be an appropriate
time.)

--
Ryan Pavlik <rpav@mephle.com>