[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Eggology

From: Peter Bex
Subject: Re: [Chicken-users] Eggology
Date: Thu, 23 Aug 2007 09:19:14 +0200
User-agent: Mutt/

On Thu, Aug 23, 2007 at 12:12:39PM +0700, Ivan Shmakov wrote:
>  SR> But it's important for popular eggs to be kept in a working state,
>  SR> and not change existing APIs in them when avoidable.
>         Could it be the reason to include version numbers into the .egg
>         names, so that, when the interface changes, both LIBRARY-M.N.egg
>         and LIBRARY-(+ 1 M).0.egg be available?

One of the few things Ruby gets right is that its 'gem' system (which is a
lot like eggs) allows you to have several versions of gems installed at the
same time.  That way, when I have a couple of legacy apps that require
Rails 1.1.6 (and I do) on my server, I can still run apps that require
Rails 1.2.3 without needing a chroot or something else that complicated.

It would rock if eggs could do this, too.  Gems does this by keeping all
files in /usr/lib/ruby/gems/<gem_dir-major.minor.patchlevel> directories.
That also means it's easy to fix is something gets broken: just remove
the broken egg^Wgem's directory.

It also means that egg makers don't have to worry about picking filenames
that don't clash with other egg names.  Of course, this also needs some
kind of proper module system or something else to make sure the system
knows where to look when loading a file that's part of an egg.

I'm not sure how gems does this.  I think when you require_gem it loads the
main file and the gem is expected to load any additional files.  These files
are loaded relatively to the gem's main file.

"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

Attachment: pgpJr4ymb8Hp2.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]