hipster <hipster / xs4all.nl> writes:

> 
> 1. Version check syntax
> 
> ruby version
>   require "1.6"               # at least 1.6
> 
> probably generalised into:
>   require "ruby 1.6"          # at least 1.6
>   require "ruby == 1.6.1"     # exactly 1.6.1

To make this more orthogonal, how about generalizing the context. Add
a 'with' qualifier to 'require' which takes an arbitrary
expression. That expression is evaluated within the context of the
module just loaded, so you could write:


    fred.rb:
        version = 4.3
        status = "debug"
        # module stuff..

    dave.rb

        require "fred" with version > 4 && status != "debug"

that gives us an interesting way to introduce metadata.

Then, how about extending require again, so that if the first match
that it finds doesn't satisfy the 'with', it keeps searching, so that
we can have multiple libraries in the search path, with programs being 
able to choose which ones they like?

Dave