[prev in list] [next in list] [prev in thread] [next in thread]
List: ruby-talk
Subject: Re: [ANN] Non-standard library project
From: "T. Onoma" <transami () runbox ! com>
Date: 2004-08-23 4:34:35
Message-ID: 200408230034.24625.transami () runbox ! com
[Download RAW message or body]
On Tuesday 10 August 2004 11:20 am, Gavin Sinclair wrote:
> On Wednesday, August 11, 2004, 12:41:23 AM, Ara.T.Howard wrote:
> >> That should give some idea of the nature of the project.
> >>
> >> Gavin
> >
> > what kinds of things are you still looking for gavin?
>
> Well, I anticipate that eventually the project will contain around 30
> libraries. At the moment there are about 5 documented ideas on the
> Wiki. So I don't have a shopping list, rather an open ear for
> suggestions.
Gavin, I just noticed this post and was looking at the project. I currently
have a library of my own that I call "succ". Now I'm sure many people have
there own personal libraries, but I have been farily careful with mine and
it contains mostly only well refined modifications to the Ruby standard
classes, that I've picked up here and there, and a few new small libraries as
well. Would those be of interest?
Speaking of which I sometimes think it would be nice if there were an easy way
append flags onto #require in order to turn on or off certain features. Kind
of a macro thing. A good psuedo-example of this:
# succ/nil.rb
module NilClass
if Kernel.require_flags[:nil_as_emptiness]
def to_f; 0.0; end
def to_s; ''; end
def to_h; {}; end
def to_a; []; end
# ...
end
def intern
self
end
# ... other stuff
end
Then with something to determine default behavior too:
Kernel.require_default = true
# turn off :nil_as_emptiness
require 'succ/nil', :nil_as_emptiness
Or
Kernel.require_default = false
# turn on :nil_as_emptiness
require 'succ/nil', :nil_as_emptiness
Or something like that. Thoughts?
--
T.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic