On Tue, Jul 28, 2009 at 4:17 PM, Laurent PETIT <laurent.pe...@gmail.com>wrote:

>
> 2009/7/28 Meikel Brandmeyer <m...@kotka.de>
>
> Hi,
>>
>> Am 28.07.2009 um 19:08 schrieb Jeff Brown:
>>
>>  Is that really the right thing to do?
>>>
>>
>> Strongly opinion-flavoured answer:
>> Never ever write code w/o namespace.
>>
>> Even scripts gain advantages if you
>> provide an entry point in a namespace:
>>
>> - easier debugging since loading doesn't
>>  fire off the script's actions
>> - multiple entry points
>> - easier re-use of the scripts functionality
>>  as a library
>>
>
> Many +1 as well : if you start using an IDE (or if you care that some of
> your users do), then chances are the IDE will try to periodically reload the
> namespaces (event based or cron-like based), and having "scripts" firing
> actions on load is a big no no for using those IDEs then :-(
>
> --
>

I think this is good news for how the Grails Clojure plugin works.  The way
it is implemented, if your functions are in the "grails" namespace then they
are callable without any special syntax, like this...

clj.some_clojure_function()

To access a function in any other namespace you must be explicit about the
namespace, like this...

clj['someNamespace'].some_clojure_function()

I think that this encourages folks to do the right thing (define a
namespace).

I may make the default namespace configurable so it doesn't have to be
"grails".

For those who haven't seen it, there is a very short movie linked from
http://grails.org/plugin/clojure that shows how the Clojure integration
works in Grails.



jb
-- 
Jeff Brown
SpringSource
http://www.springsource.com/

Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to