[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

fine-grained Enumerable-like modules - a reference

Its Me

11/28/2004 4:40:00 AM

Some interesting ideas for fine-grained modules (in fact, down to downright
miniscule modules) in:
http://www.sds.lcs.mit.edu/Larch/handboo...

They use slightly different language, but the essense seems to be there:
Ruby => Larch
module => trait
includes => includes
code => introduces + asserts + implies
module parameterized by includer methods => trait with parameter
expects to be provided by includer => trait parameters, assumes

Here are some of their 'modules':
Maps
hashes, hash composition, arrays..
Containers
Sets, Bags, etc. and operations
LexicographicOrder
defines lex ordering for any string-like thing
MinMax
defines min, max for anything with appropriate <=
DerivedOrders
defines any 3 comparison operators, given the fourth
Relation
relational operators and predicates, leading up to ...
Graph
with graph operators

Cheers!


1 Answer

gabriele renzi

11/28/2004 11:48:00 AM

0

itsme213 ha scritto:
> Some interesting ideas for fine-grained modules (in fact, down to downright
> miniscule modules) in:
> http://www.sds.lcs.mit.edu/Larch/handboo...

the linnean separation of micromodules is interesting for me, but maybe
is not completely useful in a untyped language.

I'd like to see some more in ruby, anyway, i.e. an Association/Map mixin
for Hash-like objects and a couple of Readable/Writable mixins.

But I don't think matz is a great fan of them :/