jewel.clj and require/use

7 views
Skip to first unread message

Stuart Sierra

unread,
Apr 8, 2008, 11:23:17 AM4/8/08
to clo...@googlegroups.com
Hello, Steve G. (and others),

I like where you're going with jewel.clj in clojure-contrib. I
started hacking on it to add some features I wanted:

1. Separated out a "load-uri" function from "load-system-resource",
made both public;
2. Modified "require" to not automatically "refer" namespaces;
3. Added "use" as short-hand for require & refer;
4. Made "require" and "use" accept multiple jewel names.

The simple case, (use 'foo 'bar 'baz), is succinct; more complex forms
might look like:
(use 'foo 'bar '(baz :in "bazzer/quux" :only (baz-it)))

Only problem is with the placement of the "force" options, which
should probably apply to the whole (use ...) form rather than
individual jewels. That's for another day.

Patch attached; I haven't touched the one in SVN. What do you think?
-Stuart

jewel.clj.patch-SS-20080408

Stephen C. Gilardi

unread,
Apr 8, 2008, 2:19:17 PM4/8/08
to clo...@googlegroups.com
Hi Stuart,

On Apr 8, 2008, at 11:23 AM, Stuart Sierra wrote:

I like where you're going with jewel.clj in clojure-contrib.  I
started hacking on it to add some features I wanted:

Thanks!  I like your changes.  I've incorporated them and done some rearranging and renaming of my own.  Please let me know what you think.

Only problem is with the placement of the "force" options, which
should probably apply to the whole (use ...) form rather than
individual jewels.  That's for another day.

I agree.  I'll take a look.

Thanks!

--Steve

Rich Hickey

unread,
Apr 8, 2008, 4:26:24 PM4/8/08
to Clojure


On Apr 8, 2:19 pm, "Stephen C. Gilardi" <scgila...@gmail.com> wrote:
> Hi Stuart,
>
> On Apr 8, 2008, at 11:23 AM, Stuart Sierra wrote:
>
> > I like where you're going with jewel.clj in clojure-contrib. I
> > started hacking on it to add some features I wanted:
>
> Thanks! I like your changes. I've incorporated them and done some
> rearranging and renaming of my own. Please let me know what you think.
>

Glad to see you guys making progress, and should have chimed in
earlier, but I really dislike 'jewels' - seems so derivative of Ruby's
gems, and, well, too cute. Could we just call them libs? (I know, I'm
old-fashioned :)

Rich

Stuart Sierra

unread,
Apr 8, 2008, 4:43:13 PM4/8/08
to Clojure
On Apr 8, 2:19 pm, "Stephen C. Gilardi" <scgila...@gmail.com> wrote:
> Thanks! I like your changes. I've incorporated them and done some
> rearranging and renaming of my own. Please let me know what you think.

Looks good to me. I'll try working with this for a few days and see
how it goes.
-Stuart

Stuart Sierra

unread,
Apr 8, 2008, 4:49:39 PM4/8/08
to Clojure
On Apr 8, 4:26 pm, Rich Hickey <richhic...@gmail.com> wrote:
> I really dislike 'jewels' - seems so derivative of Ruby's
> gems, and, well, too cute. Could we just call them libs?

Okay by me. (lib/use ...) is shorter and more descriptive than (jewel/
use ...)
-Stuart

Stephen C. Gilardi

unread,
Apr 8, 2008, 5:14:59 PM4/8/08
to clo...@googlegroups.com
On Apr 8, 2008, at 4:26 PM, Rich Hickey wrote:
Glad to see you guys making progress, and should have chimed in
earlier, but I really dislike 'jewels' - seems so derivative of Ruby's
gems, and, well, too cute. Could we just call them libs? (I know, I'm
old-fashioned :)

I've renamed jewel to lib everywhere.  Please see the new "lib.clj".

I've removed pkg.clj and loader.clj which are obsolete and replaced by lib.clj.

Rich, it would be nice to have a version of "load" that would accept "path" and "name" (and possibly "protocol") arguments in addition to a Reader so that the metadata for functions (et al) defined in non-file streams would be on par with that of functions defined in files.  The additional arguments would be used to set the Compiler vars SOURCE and SOURCE_PATH during compilation of the stream.

This would allow us to use one load function in "load-uri" rather than figuring out if the resource is file and using a different function.  Would you please consider providing that?

Thanks,

--Steve

Reply all
Reply to author
Forward
0 new messages