Re: Mnesia like?

2009-06-16 Thread rb

On Jun 15, 6:02 pm, Wilson MacGyver  wrote:
> Does clojure have anything like erlang's Mnesia? or is anyone working on such
> project? I know I can fall back to using JDBC+ various RDBMS, but I
> was curious if there is something that works like Mnesia.

Depending on what you mean by "works like Mnesia", you might be
interested to look at
http://hadoop.apache.org/hbase/

Cheers

Raph

>
> Thanks,
> Mac
>
> --
> Omnem crede diem tibi diluxisse supremum.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Mnesia like?

2009-06-16 Thread Wilson MacGyver

Sorry I wasn't very clear. What I meant was I didn't know if there
was something that's tightly integrated and feels very
native language-ish like Mnesia and erlang, but for clojure.

It doesn't sound like such thing exist yet...

On Tue, Jun 16, 2009 at 3:13 AM, rb  wrote:
>
> On Jun 15, 6:02 pm, Wilson MacGyver  wrote:
>> Does clojure have anything like erlang's Mnesia? or is anyone working on such
>> project? I know I can fall back to using JDBC+ various RDBMS, but I
>> was curious if there is something that works like Mnesia.
>
> Depending on what you mean by "works like Mnesia", you might be
> interested to look at
> http://hadoop.apache.org/hbase/
>
> Cheers
>
> Raph
>
>>
>> Thanks,
>> Mac
>>
>> --
>> Omnem crede diem tibi diluxisse supremum.
> >
>



-- 
Omnem crede diem tibi diluxisse supremum.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Runtime Compilation of Clojure from Android

2009-06-16 Thread rb



On Jun 16, 5:51 am, George Jahad  wrote:
> Remco van't Veer has done a lot of great working porting Clojure to
> Android, but one thing remains missing, runtime compilation which
> would allow a fully functional Repl.  The problem is that the Android
> VM doesn't use standard Java class files but rather Android specific
> ones.  There is a host-side tool that converts Java byte codes to
> Android ones.  But that tool doesn't normally run on Android.
>
> So, being an Android systems hacker, I was wondering how hard it would
> be to get runtime compilation working.
>
> Turns out, it doesn't seem to be too hard.  The trick is basically to
> run the Java to Android/Dalvik byte code converter through itself, so
> that the convertor can be run on Android; if you load that converted
> convertor into Android, you can then invoke it after each class is
> compiled, essentially like this:
>
> if(RT.booleanCast(COMPILE_FILES.deref()))
>   {
>     writeClassFile(internalName, bytecode);
>     String strings[] = {"--dex", "--output=/data/gbj/classes.dex", "/
> data/gbj/classes"};
>     com.android.dx.command.Main.main(strings);
>   }
>
> (Note that *compile-path* is set elsewhere to "/data/gbj/classes")
>
> Loading the generated class file is also a bit tricky, but not too
> bad.
>
> It isn't too fast, partly because of Android's slow GC and partly
> because I'm using the filesystem as intermediate storage before
> loading the classes, (because I haven't figured out how to do it all
> in memory yet.)
>
> I'll send out a full set of patches if there is interest, but for now
> here is an Android app with the repl built in so you can play with
> it.  (It is version of Remco's simple calculator app with a socket
> based repl added.)
>
> Much thanks to Remco upon whose Android/Clojure work this is all
> built.
>
> App install instructions below.
>
> g
>
> (Note: I've only tested these install instructions out on a Linux host
> with this sdk: android-sdk-linux_x86-1.5_r2.zip)
>
> Download the prebuilt apk file 
> here:http://georgejahad.com/clojure/calc-debug.apk
>

Is your source code available somewhere? (I'm interested to know how
you added the socket based REPL and how it interacts with the app )

Raphaël



> To configure the emulator:
> emulator -avd 
> adb  install -r    calc-debug.apk
> adb shell mkdir /data/gbj
> adb shell mkdir /data/gbj/classes
> adb shell chmod 777 /data/dalvik-cache
> adb shell chmod 777 /data/gbj
> adb shell chmod 777 /data/gbj/classes
> adb forward tcp:8030 tcp:8030
>
> Then start up the calc app from the emulator gui.
>
> Then access the repl like so:
> telnet localhost 8030
>
> Allow compilation like so:
> (def *android* true) (def *compile-files* true)
>
> Now you can compile from the repl.  For example, this adds a simple
> exponent operator to the calculator:
>
> (in-ns 'examples.calc)
> (defn exp [ b e] (reduce * (repeat b e)))
> (def calc-opers {\+ #'+
>                  \- #'-
>                  \/ #'/
>                  \* #'* \e #'exp})
> (def calc-allowed-chars (.toCharArray "e0123456789."))
>
> You can examine Remco's source code to see how the calculator works
> here:http://github.com/remvee/clj-android/blob/d1e96d33487ddcdc04b403e97f8...
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Runtime Compilation of Clojure from Android

2009-06-16 Thread Remco van 't Veer

Cool!  Please share the code on github or whatever.

I've been looking at reducing the memory footprint so I tend to
consider including dex into your app as a bad thing.  But it would be
really cool to do the slime dance during development.

I guess a more efficient approach lures in the bsh implementation at
android-scripting[1].  I haven't investigated yet but browsing the
code reveals it includes a (possibly modified) version of
org.objectweb.asm.

Remco


[1] http://code.google.com/p/android-scripting/


On Tue, Jun 16, 2009 at 5:51 AM, George
Jahad wrote:
>
> Remco van't Veer has done a lot of great working porting Clojure to
> Android, but one thing remains missing, runtime compilation which
> would allow a fully functional Repl.  The problem is that the Android
> VM doesn't use standard Java class files but rather Android specific
> ones.  There is a host-side tool that converts Java byte codes to
> Android ones.  But that tool doesn't normally run on Android.
>
> So, being an Android systems hacker, I was wondering how hard it would
> be to get runtime compilation working.
>
> Turns out, it doesn't seem to be too hard.  The trick is basically to
> run the Java to Android/Dalvik byte code converter through itself, so
> that the convertor can be run on Android; if you load that converted
> convertor into Android, you can then invoke it after each class is
> compiled, essentially like this:
>
> if(RT.booleanCast(COMPILE_FILES.deref()))
>  {
>    writeClassFile(internalName, bytecode);
>    String strings[] = {"--dex", "--output=/data/gbj/classes.dex", "/
> data/gbj/classes"};
>    com.android.dx.command.Main.main(strings);
>  }
>
> (Note that *compile-path* is set elsewhere to "/data/gbj/classes")
>
> Loading the generated class file is also a bit tricky, but not too
> bad.
>
>
> It isn't too fast, partly because of Android's slow GC and partly
> because I'm using the filesystem as intermediate storage before
> loading the classes, (because I haven't figured out how to do it all
> in memory yet.)
>
> I'll send out a full set of patches if there is interest, but for now
> here is an Android app with the repl built in so you can play with
> it.  (It is version of Remco's simple calculator app with a socket
> based repl added.)
>
> Much thanks to Remco upon whose Android/Clojure work this is all
> built.
>
> App install instructions below.
>
> g
>
>
> (Note: I've only tested these install instructions out on a Linux host
> with this sdk: android-sdk-linux_x86-1.5_r2.zip)
>
> Download the prebuilt apk file here:
> http://georgejahad.com/clojure/calc-debug.apk
>
>
>
> To configure the emulator:
> emulator -avd 
> adb  install -r    calc-debug.apk
> adb shell mkdir /data/gbj
> adb shell mkdir /data/gbj/classes
> adb shell chmod 777 /data/dalvik-cache
> adb shell chmod 777 /data/gbj
> adb shell chmod 777 /data/gbj/classes
> adb forward tcp:8030 tcp:8030
>
>
>
> Then start up the calc app from the emulator gui.
>
> Then access the repl like so:
> telnet localhost 8030
>
> Allow compilation like so:
> (def *android* true) (def *compile-files* true)
>
> Now you can compile from the repl.  For example, this adds a simple
> exponent operator to the calculator:
>
> (in-ns 'examples.calc)
> (defn exp [ b e] (reduce * (repeat b e)))
> (def calc-opers {\+ #'+
>                 \- #'-
>                 \/ #'/
>                 \* #'* \e #'exp})
> (def calc-allowed-chars (.toCharArray "e0123456789."))
>
> You can examine Remco's source code to see how the calculator works
> here:
> http://github.com/remvee/clj-android/blob/d1e96d33487ddcdc04b403e97f80fcf1b31bb9c2/examples/calc/src/examples/calc.clj
>
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Mnesia like?

2009-06-16 Thread Jonah Benton

Another schemaless db is mongo:

http://www.mongodb.org

It's written in c++, so it's out of process, but using the java driver
is pretty natural:

http://www.mongodb.org/display/DOCS/Java+Tutorial



On Tue, Jun 16, 2009 at 3:24 AM, Wilson MacGyver wrote:
>
> Sorry I wasn't very clear. What I meant was I didn't know if there
> was something that's tightly integrated and feels very
> native language-ish like Mnesia and erlang, but for clojure.
>
> It doesn't sound like such thing exist yet...
>
> On Tue, Jun 16, 2009 at 3:13 AM, rb  wrote:
>>
>> On Jun 15, 6:02 pm, Wilson MacGyver  wrote:
>>> Does clojure have anything like erlang's Mnesia? or is anyone working on 
>>> such
>>> project? I know I can fall back to using JDBC+ various RDBMS, but I
>>> was curious if there is something that works like Mnesia.
>>
>> Depending on what you mean by "works like Mnesia", you might be
>> interested to look at
>> http://hadoop.apache.org/hbase/
>>
>> Cheers
>>
>> Raph
>>
>>>
>>> Thanks,
>>> Mac
>>>
>>> --
>>> Omnem crede diem tibi diluxisse supremum.
>> >
>>
>
>
>
> --
> Omnem crede diem tibi diluxisse supremum.
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Spring and Clojure

2009-06-16 Thread hari sujathan


I think this question is highly important.
"Dependency Injection concept need not be restricted to Object
Oriented Programming!!!".
It should be possible to dependency inject arbitary code blocks to
other arbitary code blocks. This is what a future language would do as
per my strong belief.

free of the trappings of OO, types and inheritance--

-Hari Sujathan


On Jun 4, 3:34 am, Stuart Halloway  wrote:
> I think Clojure addresses (at the language level, and better) all the  
> issues that Spring addresses. So in the long run Spring is unnecessary  
> in a Clojure world.
>
> But in the short run you have the codebase you have, and the skills  
> that you have. So if it makes sense, do it.
>
> Stu
>
> > At this point I have no particular use case. We are solely a Spring  
> > shop where we build Spring web apps and we use Groovy beans (using  
> > dynamic lang support in Spring) for some stuff like MVC controllers,  
> > XML parsing, etc. I thought that it would be interesting to  
> > incorporate some Clojure beans for some tasks (perhaps some  
> > concurrent processing tasks, etc.) Does it even make saense?
>
> > Anyway, if someone would come up with a way to integrate Clojure  
> > code into Spring ApplicationContext and show the example, that would  
> > be interesting.
>
> > Best regards,
> > Dmitriy.
>
> > 2009/6/3 Luc Prefontaine 
> > We did the reverse (using Spring directly from Clojure) without any  
> > difficulty.
> > Never thought about creating Clojure beans however.
>
> > We had already some code to bootstrap Spring from Java.
> > Just called it from Clojure.
>
> > We wanted to drop Java as much as possible but did not want to loose  
> > some of the low level
> > stuff we wrote in Java.
>
> > Being curious, can you shed any light of the use you would make of  
> > Clojure beans ?
>
> > Luc P.
>
> > On Wed, 2009-06-03 at 09:02 -0700, Dmitriy Kopylenko wrote:
>
> >> Hello.
>
> >> I'm just wondering is there a way to create Clojure beans and inject
> >> them into other Spring beans (given that Clojure code implements Java
> >> interface) inside Spring ApplicationContext, similar to other dynamic
> >> langs support:
>
> >>http://static.springframework.org/spring/docs/2.5.x/reference/dynamic...
>
> >> ?
>
> >> Thanks,
> >> Dmitriy.
>
> > Luc Préfontaine
>
> > Armageddon was yesterday, today we have a real problem...

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



will clojure evolve to be able to do systems programming?

2009-06-16 Thread hari sujathan

thanks & regards,
Hari Sujathan

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



No OO restrictions is good. why not still add dependency injection?

2009-06-16 Thread hari sujathan

Hi,
   clojure web site says - "Clojure multimethods are a simple yet
powerful mechanism for runtime polymorphism that is free of the
trappings of OO, types and inheritance" .

I think dependency Injection has nothing to do with just OOP, though
it came out in OOP.
Why not dependency inject arbitary code to another arbitary code??

Thanks & Regards,
Hari Sujathan

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Mnesia like?

2009-06-16 Thread Adrian Cuthbertson

There's also Berkeley DB Java Edition, now owned by Oracle (it has a
GPL compatible license). It's an excellent, robust, embedded, fully
transactional key-store db.

See http://www.oracle.com/database/berkeley-db/je/index.html

On Tue, Jun 16, 2009 at 3:26 PM, Jonah Benton wrote:
>
> Another schemaless db is mongo:
>
> http://www.mongodb.org
>
> It's written in c++, so it's out of process, but using the java driver
> is pretty natural:
>
> http://www.mongodb.org/display/DOCS/Java+Tutorial
>
>
>
> On Tue, Jun 16, 2009 at 3:24 AM, Wilson MacGyver wrote:
>>
>> Sorry I wasn't very clear. What I meant was I didn't know if there
>> was something that's tightly integrated and feels very
>> native language-ish like Mnesia and erlang, but for clojure.
>>
>> It doesn't sound like such thing exist yet...
>>
>> On Tue, Jun 16, 2009 at 3:13 AM, rb  wrote:
>>>
>>> On Jun 15, 6:02 pm, Wilson MacGyver  wrote:
 Does clojure have anything like erlang's Mnesia? or is anyone working on 
 such
 project? I know I can fall back to using JDBC+ various RDBMS, but I
 was curious if there is something that works like Mnesia.
>>>
>>> Depending on what you mean by "works like Mnesia", you might be
>>> interested to look at
>>> http://hadoop.apache.org/hbase/
>>>
>>> Cheers
>>>
>>> Raph
>>>

 Thanks,
 Mac

 --
 Omnem crede diem tibi diluxisse supremum.
>>> >
>>>
>>
>>
>>
>> --
>> Omnem crede diem tibi diluxisse supremum.
>>
>> >
>>
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Mnesia like?

2009-06-16 Thread Jason Warner

why would you throw up for suggesting couchdb? :) I rather like
couchdb and some of its philosophies. One of my guys at work
implemented a view server for couchdb in clojure...so...it isn't all
bad ;)

On Jun 15, 11:11 am, Daniel Lyons  wrote:
> On Jun 15, 2009, at 10:02 AM, Wilson MacGyver wrote:
>
>
>
> > Does clojure have anything like erlang's Mnesia? or is anyone  
> > working on such
> > project? I know I can fall back to using JDBC+ various RDBMS, but I
> > was curious if there is something that works like Mnesia.
>
> I don't think there is one at the moment. It would be really cool  
> though.
>
> If you want to use Mnesia itself, you can always call Erlang from its  
> Java bridge. There is an example of interacting with Erlang in the  
> files section:
>
>    http://clojure.googlegroups.com/web/erlang+(2).clj
>
> If you're interested in Mnesia for scalability, you may be interested  
> in the Java library Terracotta, which is a distributed object  
> persistence system of some kind. I'm curious about it even though it  
> implies some objects and some XML, but I haven't used it yet.
>
>    http://www.terracotta.org/
>
> I might throw up a bit for suggesting this, but you might also want to  
> look at CouchDB, which uses HTTP to provide a generic JSON "document"  
> store based on Mnesia. It would probably be easier to interface with  
> than Erlang directly and ought to have most of the same benefits since  
> it's built on Mnesia.
>
>    http://couchdb.apache.org/
>
> Hope that helps,
>
> —
> Daniel Lyonshttp://www.storytotell.org-- Tell It!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: No OO restrictions is good. why not still add dependency injection?

2009-06-16 Thread Stuart Halloway

Hari,

I agree--dependency injection is not about OOP. It is about working  
around limitations in certain languages where it is difficult to  
decouple components for testing and flexible deployment.

I have not encountered similar limitations in Clojure. Do you have an  
example in Clojure that makes you wish for DI? I would be interested  
in taking a look and suggesting a more idiomatic Clojure approach.

Cheers,
Stu

> Hi,
>  clojure web site says - "Clojure multimethods are a simple yet
> powerful mechanism for runtime polymorphism that is free of the
> trappings of OO, types and inheritance" .
>
> I think dependency Injection has nothing to do with just OOP, though
> it came out in OOP.
> Why not dependency inject arbitary code to another arbitary code??
>
> Thanks & Regards,
> Hari Sujathan
>
> >


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: will clojure evolve to be able to do systems programming?

2009-06-16 Thread Sean Devlin

What exactly do you mean by systems programming?

If you mean hardware stuff that's outside the scope of the JVM, then
no, I doubt it.  However, I am hard pressed to think of situations
that you can code with Java SE (dunno about ME) that you can't handle
with Clojure.  Now that I think about it, I think Clojure would be
better a daemon stuff than most other tools because of the STM.

What specifically are you looking forward to doing?

On Jun 16, 9:30 am, hari sujathan  wrote:
> thanks & regards,
> Hari Sujathan
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Clojure at LispNYC tonight 7pm

2009-06-16 Thread Paul Stadig
On Wed, Jun 10, 2009 at 11:37 AM, Stuart Sierra  wrote:

>
> On Jun 9, 10:32 am, Stuart Sierra  wrote:
> > Join us Tuesday, June 9 from 7:00-9:00 for Stuart Sierra's
> > presentation:
> >
> > Implementing AltLaw.org in Clojure
>
> Slides and video here: http://lispnyc.org/wiki.clp?page=past-meetings
> We'll try to get something lighter than a 3GB mpeg soon.
>
> -Stuart
>

I watched this video. Thanks for posting it! There is some great information
in there, especially the "from the trenches" tips about working with Java
libraries.

Since you're one of the more active contributors to Clojure, would it be
appropriate to post the video to clojure.blip.tv?


Paul

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: No OO restrictions is good. why not still add dependency injection?

2009-06-16 Thread Jules

I still don't know what dependency injection means exactly. The
examples I've seen that are said to use dependency injection can be
solved by using first class functions. Are first class functions what
you want?

Jules

On Jun 16, 12:09 pm, hari sujathan  wrote:
> Hi,
>    clojure web site says - "Clojure multimethods are a simple yet
> powerful mechanism for runtime polymorphism that is free of the
> trappings of OO, types and inheritance" .
>
> I think dependency Injection has nothing to do with just OOP, though
> it came out in OOP.
> Why not dependency inject arbitary code to another arbitary code??
>
> Thanks & Regards,
> Hari Sujathan
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Runtime Compilation of Clojure from Android

2009-06-16 Thread George Jahad



On Jun 16, 3:15 am, "Remco van 't Veer"  wrote:
> Cool!  Please share the code on github or whatever.
>

working on it.

> I've been looking at reducing the memory footprint so I tend to
> consider including dex into your app as a bad thing.  But it would be
> really cool to do the slime dance during development.
>

yup.  I never intended this as a long term solution, just an easy
first step that proves the concept.


>  browsing the
> code reveals it includes a (possibly modified) version of
> org.objectweb.asm.
>

Now that is interesting.  So Android does have a port of ASM!  That
really will improve things.

g
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: No OO restrictions is good. why not still add dependency injection?

2009-06-16 Thread hari sujathan

hi Stuart,

I was trying to look from some mathematical concepts by representing -
OOP's inheritance by tree/graph structurtes(tree for single , and
graph
for multiple inheritence) with classes acting as  each node.
With functional programming - nodes are each block of code..

Dependency injection means- configuring some parameters into each of
these nodes(whether its class or a piece of code, DI is independent
concept).
I dont know on how to improve, and things I wrote above may just be
wrong(my own thought process).
I just started to read Bertrand meyer's book- "Object Oriented
software construction" which is simply awesome .

-Hari Sujathan

On Jun 16, 7:13 am, Stuart Halloway  wrote:
> Hari,
>
> I agree--dependency injection is not about OOP. It is about working  
> around limitations in certain languages where it is difficult to  
> decouple components for testing and flexible deployment.
>
> I have not encountered similar limitations in Clojure. Do you have an  
> example in Clojure that makes you wish for DI? I would be interested  
> in taking a look and suggesting a more idiomatic Clojure approach.
>
> Cheers,
> Stu
>
> > Hi,
> >  clojure web site says - "Clojure multimethods are a simple yet
> > powerful mechanism for runtime polymorphism that is free of the
> > trappings of OO, types and inheritance" .
>
> > I think dependency Injection has nothing to do with just OOP, though
> > it came out in OOP.
> > Why not dependency inject arbitary code to another arbitary code??
>
> > Thanks & Regards,
> > Hari Sujathan
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Runtime Compilation of Clojure from Android

2009-06-16 Thread George Jahad


I'm still cleaning up my changes.  But with regards to the repl, I'm
just using   clojure.contrib.server-socket and invoking it like so
from the :create routine:

   (create-repl-server 8030)
   (repl)


On Jun 16, 12:28 am, rb  wrote:
> On Jun 16, 5:51 am, George Jahad  wrote:
>
>
>
> > Remco van't Veer has done a lot of great working porting Clojure to
> > Android, but one thing remains missing, runtime compilation which
> > would allow a fully functional Repl.  The problem is that the Android
> > VM doesn't use standard Java class files but rather Android specific
> > ones.  There is a host-side tool that converts Java byte codes to
> > Android ones.  But that tool doesn't normally run on Android.
>
> > So, being an Android systems hacker, I was wondering how hard it would
> > be to get runtime compilation working.
>
> > Turns out, it doesn't seem to be too hard.  The trick is basically to
> > run the Java to Android/Dalvik byte code converter through itself, so
> > that the convertor can be run on Android; if you load that converted
> > convertor into Android, you can then invoke it after each class is
> > compiled, essentially like this:
>
> > if(RT.booleanCast(COMPILE_FILES.deref()))
> >   {
> >     writeClassFile(internalName, bytecode);
> >     String strings[] = {"--dex", "--output=/data/gbj/classes.dex", "/
> > data/gbj/classes"};
> >     com.android.dx.command.Main.main(strings);
> >   }
>
> > (Note that *compile-path* is set elsewhere to "/data/gbj/classes")
>
> > Loading the generated class file is also a bit tricky, but not too
> > bad.
>
> > It isn't too fast, partly because of Android's slow GC and partly
> > because I'm using the filesystem as intermediate storage before
> > loading the classes, (because I haven't figured out how to do it all
> > in memory yet.)
>
> > I'll send out a full set of patches if there is interest, but for now
> > here is an Android app with the repl built in so you can play with
> > it.  (It is version of Remco's simple calculator app with a socket
> > based repl added.)
>
> > Much thanks to Remco upon whose Android/Clojure work this is all
> > built.
>
> > App install instructions below.
>
> > g
>
> > (Note: I've only tested these install instructions out on a Linux host
> > with this sdk: android-sdk-linux_x86-1.5_r2.zip)
>
> > Download the prebuilt apk file 
> > here:http://georgejahad.com/clojure/calc-debug.apk
>
> Is your source code available somewhere? (I'm interested to know how
> you added the socket based REPL and how it interacts with the app )
>
> Raphaël
>
> > To configure the emulator:
> > emulator -avd 
> > adb  install -r    calc-debug.apk
> > adb shell mkdir /data/gbj
> > adb shell mkdir /data/gbj/classes
> > adb shell chmod 777 /data/dalvik-cache
> > adb shell chmod 777 /data/gbj
> > adb shell chmod 777 /data/gbj/classes
> > adb forward tcp:8030 tcp:8030
>
> > Then start up the calc app from the emulator gui.
>
> > Then access the repl like so:
> > telnet localhost 8030
>
> > Allow compilation like so:
> > (def *android* true) (def *compile-files* true)
>
> > Now you can compile from the repl.  For example, this adds a simple
> > exponent operator to the calculator:
>
> > (in-ns 'examples.calc)
> > (defn exp [ b e] (reduce * (repeat b e)))
> > (def calc-opers {\+ #'+
> >                  \- #'-
> >                  \/ #'/
> >                  \* #'* \e #'exp})
> > (def calc-allowed-chars (.toCharArray "e0123456789."))
>
> > You can examine Remco's source code to see how the calculator works
> > here:http://github.com/remvee/clj-android/blob/d1e96d33487ddcdc04b403e97f8...
>
>
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: No OO restrictions is good. why not still add dependency injection?

2009-06-16 Thread Jeff Heon

I've seen dependency injection used in choosing an implementation for
an interface with a configuration file i.e. without having to modify
the code.

I've only seen it used in component frameworks with lifecycle (a
lifetime ago with Jakarta Avalon and now with Spring.)

Currently we're using it in a web service environment, simply to
inject SQL queries into our database classes so we can modify the
queries without recompiling everything.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: No OO restrictions is good. why not still add dependency injection?

2009-06-16 Thread J. McConnell

On Tue, Jun 16, 2009 at 12:18 PM, hari sujathan  wrote:
>
> I was trying to look from some mathematical concepts by representing -
> OOP's inheritance by tree/graph structurtes(tree for single , and
> graph
> for multiple inheritence) with classes acting as  each node.
> With functional programming - nodes are each block of code..

I'm still not clear on what it is you are looking for. In case I am
understanding you correctly, have you considered using functions that
return classes in place of classes at each node? Is this anything like
what you are looking for?

user=> (declare classes)
#'user/classes
user=> (def tree { #(classes 1) #(classes 0) })
#'user/tree
user=> (def classes [String Object])
#'user/classes
user=> (doseq [[k v] tree] (println (str (k) " -> " (v
class java.lang.Object -> class java.lang.String
nil
user=> (def classes [Class Object])
#'user/classes
user=> (doseq [[k v] tree] (println (str (k) " -> " (v
class java.lang.Object -> class java.lang.Class
nil

- J.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: No OO restrictions is good. why not still add dependency injection?

2009-06-16 Thread Sean Devlin

Hari,
First, I'd recommend you watch Rich's videos on Clojure, both for Java
programmers and LISP programmers.  In it Rich explains why Clojure
*isn't* OO.  It's heresy to some who has written lots of Java, but
once you see Clojure in action, everything starts to make sense.  I
know when I went down my path (Java->Ruby->CL->Clojure), it took me a
while to feel comfortable living w/o objects.

Without knowing your specific problems, I can offer some suggestions
on how to get the effects of DI in a much more awesome way in Clojure

1.  Understand how to use higher order functions.  Here's a few great
examples:

map
reduce
filter
remove
some
every
comp

Notice how these functions take a *function* as one of their
arguments.  This is a classic case of where Clojure eliminates the
need for a DI framework.

2.  Learn to curry functions.

Suppose you have a function that applies a quadratic equation

user=>(defn quad
[a b c x]
(+ (* a x x) (* b x) c))

user=>(def my-ints (range 1 11))

You can map a specific parabola like so

user=>(map #(quad 1 0 0 %) my-ints)
(1 4 9 16 25 36 49 64 81 100)

Notice how three values were fixed and the last value varied,
producing the value you expect.  This way we could plot any parabola
by changing the value of the inputs.

3.  Write functions that generate functions

The last example was okay, but it felt a little forced.  Let's create
a function to do the currying for us:

user=>(defn my-parab [a b c] (fn[x](quad a b c x)))

Now, it isn't immediately obvious, but my-parab returns a function.

user=>(ifn? (my-parab 1 0 0))
true

Let's use it in a map

user=>(map (my-parab 1 0 0) my-ints)
(1 4 9 16 25 36 49 64 81 100)

I find that using functions to create functions is a way more powerful
factory method that can usually be achieved in Java.  They can be
combined & layered in ways that Spring can only dream of.

4.  Make comp your best friend

Being able to actually compose functions is amazing.  It lets you
write much much much smaller functions, and put them together in
wonderful new permutations.

;This squares a value, and then adds .005
(map (comp (my-parab 0 1 0.005) (my-parab 1 0 0) ) my-ints)

Notice I didn't even get into macros yet.  I hope these examples help
get you started hacking Clojure.

One more thing, read Stuart Holloway's book.  It's great.

Sean

On Jun 16, 12:18 pm, hari sujathan  wrote:
> hi Stuart,
>
> I was trying to look from some mathematical concepts by representing -
> OOP's inheritance by tree/graph structurtes(tree for single , and
> graph
> for multiple inheritence) with classes acting as  each node.
> With functional programming - nodes are each block of code..
>
> Dependency injection means- configuring some parameters into each of
> these nodes(whether its class or a piece of code, DI is independent
> concept).
> I dont know on how to improve, and things I wrote above may just be
> wrong(my own thought process).
> I just started to read Bertrand meyer's book- "Object Oriented
> software construction" which is simply awesome .
>
> -Hari Sujathan
>
> On Jun 16, 7:13 am, Stuart Halloway  wrote:
>
> > Hari,
>
> > I agree--dependency injection is not about OOP. It is about working  
> > around limitations in certain languages where it is difficult to  
> > decouple components for testing and flexible deployment.
>
> > I have not encountered similar limitations in Clojure. Do you have an  
> > example in Clojure that makes you wish for DI? I would be interested  
> > in taking a look and suggesting a more idiomatic Clojure approach.
>
> > Cheers,
> > Stu
>
> > > Hi,
> > >  clojure web site says - "Clojure multimethods are a simple yet
> > > powerful mechanism for runtime polymorphism that is free of the
> > > trappings of OO, types and inheritance" .
>
> > > I think dependency Injection has nothing to do with just OOP, though
> > > it came out in OOP.
> > > Why not dependency inject arbitary code to another arbitary code??
>
> > > Thanks & Regards,
> > > Hari Sujathan
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Mnesia like?

2009-06-16 Thread Jim Menard

On Tue, Jun 16, 2009 at 9:26 AM, Jonah Benton wrote:
>
> Another schemaless db is mongo:
>
> http://www.mongodb.org
>
> It's written in c++, so it's out of process, but using the java driver
> is pretty natural:
>
> http://www.mongodb.org/display/DOCS/Java+Tutorial

See also Geir Magnusson Jr.'s MongoDB Java driver, which comes with a
Clojure example that I wrote for him last year:

http://github.com/geir/mongo-java-driver/tree/master

http://github.com/geir/mongo-java-driver/blob/ca5b3ab3c2ab1caf8918cc84902abb7b476ba52b/src/examples/clojure/mongo.clj

Jim
-- 
Jim Menard, j...@io.com, jim.men...@gmail.com
http://www.io.com/~jimm/

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: will clojure evolve to be able to do systems programming?

2009-06-16 Thread tmountain

Due to the startup cost of the JVM, Clojure and Java probably aren't
the best choices for tiny five to ten line utility scripts. That being
said, Clojure works well for level stuff like bit twiddling, I/O, and
socket programming. If you're in an environment where Java is
available on your servers, it can be a good bet due to the extreme
simplicity of deployment.

Travis

On Jun 16, 9:30 am, hari sujathan  wrote:
> thanks & regards,
> Hari Sujathan
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Mnesia like?

2009-06-16 Thread Jonah Benton

Ah, that looks very nice...

On Tue, Jun 16, 2009 at 1:19 PM, Jim Menard wrote:
>
> On Tue, Jun 16, 2009 at 9:26 AM, Jonah Benton wrote:
>>
>> Another schemaless db is mongo:
>>
>> http://www.mongodb.org
>>
>> It's written in c++, so it's out of process, but using the java driver
>> is pretty natural:
>>
>> http://www.mongodb.org/display/DOCS/Java+Tutorial
>
> See also Geir Magnusson Jr.'s MongoDB Java driver, which comes with a
> Clojure example that I wrote for him last year:
>
> http://github.com/geir/mongo-java-driver/tree/master
>
> http://github.com/geir/mongo-java-driver/blob/ca5b3ab3c2ab1caf8918cc84902abb7b476ba52b/src/examples/clojure/mongo.clj
>
> Jim
> --
> Jim Menard, j...@io.com, jim.men...@gmail.com
> http://www.io.com/~jimm/
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: will clojure evolve to be able to do systems programming?

2009-06-16 Thread Stuart Halloway

Would be interesting to combine Clojure with NailGun for utility  
scripting...

http://sourceforge.net/projects/nailgun/

> Due to the startup cost of the JVM, Clojure and Java probably aren't
> the best choices for tiny five to ten line utility scripts. That being
> said, Clojure works well for level stuff like bit twiddling, I/O, and
> socket programming. If you're in an environment where Java is
> available on your servers, it can be a good bet due to the extreme
> simplicity of deployment.
>
> Travis
>
> On Jun 16, 9:30 am, hari sujathan  wrote:
>> thanks & regards,
>> Hari Sujathan
> >


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Rebinding functions?

2009-06-16 Thread Michel Salim

It's currently not possible to dynamically rebind functions:

(binding [+ -] (+ 5 3)) ==> 8 ;; not 2

Would this be supported in the future? It would make it easier, for
example, to extend the current tracing functionality, e.g.

(trace-in-expr [f1 f2] (f1 (f2 10))) ==>
(let [oldf1 f1 oldf2 f2]
  (binding [f1 (fn [& args] (trace-fn-call 'f1 oldf1 args))
f2 (fn [& args] (trace-fn-call 'f2 oldf2 args))]
(f1 (f2 10

Thanks,

--
Michel S.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Rebinding functions?

2009-06-16 Thread Paul Stadig
On Tue, Jun 16, 2009 at 1:38 PM, Michel Salim wrote:

>
> It's currently not possible to dynamically rebind functions:
>
> (binding [+ -] (+ 5 3)) ==> 8 ;; not 2
>
> Thanks,
>
> --
> Michel S.
>

It is possible to rebind (even core) functions, but there are a couple of
limitations. One of which is the fact that some functions are inlined by the
compiler. I believe the two argument case of '+ is one of those.

Paul

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Shouldn't c.l.Namespace implement c.l.Named?

2009-06-16 Thread pmf

I've noticed that clojure.lang.Namespace cannot be used with the name-
function (like (name *ns*)) because it does not implement
clojure.lang.Named. One has to use (.getName *ns*), which is a bit
ugly.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Rebinding functions?

2009-06-16 Thread Sean Devlin

Yes, people have shown examples on this list where

(+ a b)

is dramatically faster than

(+ a b c)

On Jun 16, 1:42 pm, Paul Stadig  wrote:
> On Tue, Jun 16, 2009 at 1:38 PM, Michel Salim wrote:
>
>
>
> > It's currently not possible to dynamically rebind functions:
>
> > (binding [+ -] (+ 5 3)) ==> 8 ;; not 2
>
> > Thanks,
>
> > --
> > Michel S.
>
> It is possible to rebind (even core) functions, but there are a couple of
> limitations. One of which is the fact that some functions are inlined by the
> compiler. I believe the two argument case of '+ is one of those.
>
> Paul
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



binding at the REPL

2009-06-16 Thread Stuart Halloway

This surprised me. What part of my mental model needs to be  
adjusted? :-)

user=> (def dozen 12)
#'user/dozen

user=> (binding [dozen 13] dozen)
12 ; hunh?

user=> (#(binding [dozen 13] dozen))
13


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: binding at the REPL

2009-06-16 Thread Sean Devlin

Did you try this from a fresh REPL?  Maybe you made a typo somewhere?
I can't reproduce it.

user=> (def dozen 12)
#'user/dozen
user=> (binding [dozen 13] dozen)
13

On Jun 16, 2:08 pm, Stuart Halloway  wrote:
> This surprised me. What part of my mental model needs to be  
> adjusted? :-)
>
> user=> (def dozen 12)
> #'user/dozen
>
> user=> (binding [dozen 13] dozen)
> 12 ; hunh?
>
> user=> (#(binding [dozen 13] dozen))
> 13
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Rebinding functions?

2009-06-16 Thread Michel S.



On Jun 16, 1:42 pm, Paul Stadig  wrote:
> On Tue, Jun 16, 2009 at 1:38 PM, Michel Salim wrote:
>
>
>
> > It's currently not possible to dynamically rebind functions:
>
> > (binding [+ -] (+ 5 3)) ==> 8 ;; not 2
>
> > Thanks,
>
> > --
> > Michel S.
>
> It is possible to rebind (even core) functions, but there are a couple of
> limitations. One of which is the fact that some functions are inlined by the
> compiler. I believe the two argument case of '+ is one of those.
>
I just verified and it does indeed work -- thanks. Time to read up on
macros to implement this tracing construct, then.

--
Michel
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: binding at the REPL

2009-06-16 Thread Mark Volkmann

On Tue, Jun 16, 2009 at 1:08 PM, Stuart
Halloway wrote:
>
> This surprised me. What part of my mental model needs to be
> adjusted? :-)
>
> user=> (def dozen 12)
> #'user/dozen
>
> user=> (binding [dozen 13] dozen)
> 12 ; hunh?

This outputs 13 for me with the latest version of Clojure from this morning.

> user=> (#(binding [dozen 13] dozen))
> 13

-- 
R. Mark Volkmann
Object Computing, Inc.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Rebinding functions?

2009-06-16 Thread Kevin Downey

you can use apply to avoid in-lining:

user=> (binding [+ -] (apply + '(5 3)))
2


On Tue, Jun 16, 2009 at 11:16 AM, Michel S. wrote:
>
>
>
> On Jun 16, 1:42 pm, Paul Stadig  wrote:
>> On Tue, Jun 16, 2009 at 1:38 PM, Michel Salim wrote:
>>
>>
>>
>> > It's currently not possible to dynamically rebind functions:
>>
>> > (binding [+ -] (+ 5 3)) ==> 8 ;; not 2
>>
>> > Thanks,
>>
>> > --
>> > Michel S.
>>
>> It is possible to rebind (even core) functions, but there are a couple of
>> limitations. One of which is the fact that some functions are inlined by the
>> compiler. I believe the two argument case of '+ is one of those.
>>
> I just verified and it does indeed work -- thanks. Time to read up on
> macros to implement this tracing construct, then.
>
> --
> Michel
> >
>



-- 
And what is good, Phaedrus,
And what is not good—
Need we ask anyone to tell us these things?

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: binding at the REPL

2009-06-16 Thread Sean Devlin

I use 1.0, btw.  Tested both on OSX and Windows.

On Jun 16, 2:19 pm, Mark Volkmann  wrote:
> On Tue, Jun 16, 2009 at 1:08 PM, Stuart
>
> Halloway wrote:
>
> > This surprised me. What part of my mental model needs to be
> > adjusted? :-)
>
> > user=> (def dozen 12)
> > #'user/dozen
>
> > user=> (binding [dozen 13] dozen)
> > 12 ; hunh?
>
> This outputs 13 for me with the latest version of Clojure from this morning.
>
> > user=> (#(binding [dozen 13] dozen))
> > 13
>
> --
> R. Mark Volkmann
> Object Computing, Inc.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: binding at the REPL

2009-06-16 Thread Stuart Halloway

OK, just updated the repos. and this isn't happening anymore. Kind of  
a strange bug though. Rich, do you know why this happened (and did you  
explicitly fix it at some point?)

> Strange, I get the expected result, Clojure SVN revision 1382:
>
> user> (def dozen 12)
> #'user/dozen
> user> (binding [dozen 13] dozen)
> 13
> user> (#(binding [dozen 13] dozen))
> 13
> user>
>
> -the other Stuart
>
>
> On Jun 16, 2:08 pm, Stuart Halloway  wrote:
>> This surprised me. What part of my mental model needs to be
>> adjusted? :-)
>>
>> user=> (def dozen 12)
>> #'user/dozen
>>
>> user=> (binding [dozen 13] dozen)
>> 12 ; hunh?
>>
>> user=> (#(binding [dozen 13] dozen))
>> 13
> >


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Mnesia like?

2009-06-16 Thread Daniel Lyons


On Jun 16, 2009, at 8:05 AM, Jason Warner wrote:

>
> why would you throw up for suggesting couchdb? :) I rather like
> couchdb and some of its philosophies. One of my guys at work
> implemented a view server for couchdb in clojure...so...it isn't all
> bad ;)


It doesn't have anything to do with Clojure and so probably isn't  
appropriate for this forum. Basically, I think CouchDB throws the baby  
out with the bathwater. Most people don't need scalability more than  
they need referential integrity and ACID compliance, so I consider it  
one of those evil premature optimizations. I think it's gaining ground  
mostly because it uses trendy technologies (Erlang, HTTP, JSON) and my  
generation of programmers think MySQL is an RDBMS and that the only  
problem with it is SQL. RDBMSes are more than record storage systems  
or object persistence layers; they are also integration technology and  
CouchDB misses this point entirely. ACID compliance was not invented  
by crusty WASPs to repress the proletariat; if you don't have it, your  
data will get screwed up, and the best CouchDB can offer you is the A  
and maybe the D. I also vehemently detest that it gives the app  
developer a bunch of problems that the RDBMS took care of for free.

It's a tradeoff like any other, I just think in general it's not worth  
the trade. Most programmers would be wise to improve their  
understanding of relational theory and SQL rather than to go out and  
get comfortable with CouchDB in the hope that someday they'll work for  
Facebook or write the next Twitter.

I also find the thought of using a language with software  
transactional memory to talk to a "database" that doesn't have  
transactions a little hilarious. :)

—
Daniel Lyons
http://www.storytotell.org -- Tell It!


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: binding at the REPL

2009-06-16 Thread Stuart Sierra

Strange, I get the expected result, Clojure SVN revision 1382:

user> (def dozen 12)
#'user/dozen
user> (binding [dozen 13] dozen)
13
user> (#(binding [dozen 13] dozen))
13
user>

-the other Stuart


On Jun 16, 2:08 pm, Stuart Halloway  wrote:
> This surprised me. What part of my mental model needs to be  
> adjusted? :-)
>
> user=> (def dozen 12)
> #'user/dozen
>
> user=> (binding [dozen 13] dozen)
> 12 ; hunh?
>
> user=> (#(binding [dozen 13] dozen))
> 13
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Shouldn't c.l.Namespace implement c.l.Named?

2009-06-16 Thread Meikel Brandmeyer

Hi,

Am 16.06.2009 um 19:42 schrieb pmf:


I've noticed that clojure.lang.Namespace cannot be used with the name-
function (like (name *ns*)) because it does not implement
clojure.lang.Named. One has to use (.getName *ns*), which is a bit
ugly.


There is ns-name.

Sincerely
Meikel



smime.p7s
Description: S/MIME cryptographic signature


Re: Shouldn't c.l.Namespace implement c.l.Named?

2009-06-16 Thread Sean Devlin

To borrow a term from ruby, the API should follow the "Principle of
Least Surprise".  While ns-name works, I agree with pmf.  It would be
nice if c.l.Namepsace implemented c.l.Named

My $.02

On Jun 16, 3:25 pm, Meikel Brandmeyer  wrote:
> Hi,
>
> Am 16.06.2009 um 19:42 schrieb pmf:
>
> > I've noticed that clojure.lang.Namespace cannot be used with the name-
> > function (like (name *ns*)) because it does not implement
> > clojure.lang.Named. One has to use (.getName *ns*), which is a bit
> > ugly.
>
> There is ns-name.
>
> Sincerely
> Meikel
>
>  smime.p7s
> 5KViewDownload
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: No OO restrictions is good. why not still add dependency injection?

2009-06-16 Thread Daniel Lyons

Sean,

On Jun 16, 2009, at 10:59 AM, Sean Devlin wrote:
> The last example was okay, but it felt a little forced.  Let's create
> a function to do the currying for us:
>
> user=>(defn my-parab [a b c] (fn[x](quad a b c x)))
>
> Now, it isn't immediately obvious, but my-parab returns a function.
>
> user=>(ifn? (my-parab 1 0 0))
> true
>
> Let's use it in a map
>
> user=>(map (my-parab 1 0 0) my-ints)
> (1 4 9 16 25 36 49 64 81 100)

Great stuff!

You probably already know this and just didn't want to bring it up,  
but you can use 'partial' instead too:

(map (partial quad 1 0 0) my-ints)

—
Daniel Lyons
http://www.storytotell.org -- Tell It!


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: No OO restrictions is good. why not still add dependency injection?

2009-06-16 Thread Sean Devlin

That would be point 5 :)

On Jun 16, 3:45 pm, Daniel Lyons  wrote:
> Sean,
>
> On Jun 16, 2009, at 10:59 AM, Sean Devlin wrote:
>
> > The last example was okay, but it felt a little forced.  Let's create
> > a function to do the currying for us:
>
> > user=>(defn my-parab [a b c] (fn[x](quad a b c x)))
>
> > Now, it isn't immediately obvious, but my-parab returns a function.
>
> > user=>(ifn? (my-parab 1 0 0))
> > true
>
> > Let's use it in a map
>
> > user=>(map (my-parab 1 0 0) my-ints)
> > (1 4 9 16 25 36 49 64 81 100)
>
> Great stuff!
>
> You probably already know this and just didn't want to bring it up,  
> but you can use 'partial' instead too:
>
> (map (partial quad 1 0 0) my-ints)
>
> —
> Daniel Lyonshttp://www.storytotell.org-- Tell It!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: No OO restrictions is good. why not still add dependency injection?

2009-06-16 Thread Howard Lewis Ship
I've written two successful open source IoC containers (HiveMind and T5
IoC).  I don't really see the need for an IoC container for Clojure.  It is
interesting that coding a stateless IoC layer in OO is a step towards
functional (T5 IoC does a lot of functional composition and supports lazy
evaluation after a fashion). However, Clojure & Functional is "cut to the
chase" relative to IoC in an OO environment and Clojure (via Vars and
(binding) ) supports a lot of concepts that would be extremely difficult to
do using an IoC container.

When doing Tapestry training I'm often faced with the question: "If Tapestry
pages are stateful (and that's good) why is it also good that IoC services
are stateless?" I think it's because a page (and its mutable state) is
modeling a user (which is naturally stateful) while IoC services are
modeling an operation which is very functional: inputs, outputs and
(generally) no side effects (except for database updates).

On Tue, Jun 16, 2009 at 7:13 AM, Stuart Halloway
wrote:

>
> Hari,
>
> I agree--dependency injection is not about OOP. It is about working
> around limitations in certain languages where it is difficult to
> decouple components for testing and flexible deployment.
>
> I have not encountered similar limitations in Clojure. Do you have an
> example in Clojure that makes you wish for DI? I would be interested
> in taking a look and suggesting a more idiomatic Clojure approach.
>
> Cheers,
> Stu
>
> > Hi,
> >  clojure web site says - "Clojure multimethods are a simple yet
> > powerful mechanism for runtime polymorphism that is free of the
> > trappings of OO, types and inheritance" .
> >
> > I think dependency Injection has nothing to do with just OOP, though
> > it came out in OOP.
> > Why not dependency inject arbitary code to another arbitary code??
> >
> > Thanks & Regards,
> > Hari Sujathan
> >
> > >
>
>
> >
>


-- 
Howard M. Lewis Ship

Creator of Apache Tapestry
Director of Open Source Technology at Formos

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Runtime Compilation of Clojure from Android

2009-06-16 Thread George Jahad



On Jun 16, 3:15 am, "Remco van 't Veer"  wrote:
> Cool!  Please share the code on github or whatever.
>


ok, I've forked your clojure tree and added my patches here:
http://github.com/GeorgeJahad/clojure/tree/master
The main changes are in Compiler.java, with a few in build.xml and
main.clj.

Note that you'll probably need to set the sdk-location in build.xml


I've cleaned things up a bit and set out a new prebuilt calc apk here:
http://georgejahad.com/clojure/calc-debug.apk

(Note: I've only tested these install instructions out on a Linux host
with this sdk: android-sdk-linux_x86-1.5_r2.zip)



To configure the emulator:
emulator -avd 
adb  install -rcalc-debug.apk
adb shell mkdir /data/clojure
adb shell mkdir /data/clojure/classes
adb shell chmod 777 /data/clojure
adb shell chmod 777 /data/clojure/classes
adb forward tcp:8032 tcp:8032



Then start up the calc app from the emulator gui.

Then access the repl like so:
telnet localhost 8032

Now you can compile from the repl.


My only change to examples.calc.clj was to add clojure.contrib.server-
socket and invoke it like so from the :create routine:

   (create-repl-server 8032)
   (repl)
My fork of your calc source is here:
http://github.com/GeorgeJahad/clj-android/blob/7f0497ee1aa155075d97333b73e6c3a7fed64cc3/examples/calc/src/examples/calc.clj

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: binding at the REPL

2009-06-16 Thread Rich Hickey

On Tue, Jun 16, 2009 at 2:27 PM, Stuart
Halloway wrote:
>
> OK, just updated the repos. and this isn't happening anymore. Kind of
> a strange bug though. Rich, do you know why this happened (and did you
> explicitly fix it at some point?)
>
>> Strange, I get the expected result, Clojure SVN revision 1382:
>>
>> user> (def dozen 12)
>> #'user/dozen
>> user> (binding [dozen 13] dozen)
>> 13
>> user> (#(binding [dozen 13] dozen))
>> 13
>> user>
>>
>> -the other Stuart
>>
>>
>> On Jun 16, 2:08 pm, Stuart Halloway  wrote:
>>> This surprised me. What part of my mental model needs to be
>>> adjusted? :-)
>>>
>>> user=> (def dozen 12)
>>> #'user/dozen
>>>
>>> user=> (binding [dozen 13] dozen)
>>> 12 ; hunh?
>>>
>>> user=> (#(binding [dozen 13] dozen))
>>> 13
>> >
>

I can't reproduce that.

Rich

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Determining exceptions that can leak from a function

2009-06-16 Thread tsuraan

Is there any way for me to tell what exceptions I'm not handling in a
clojure function?  javac will yell at me if I don't either handle or
declare every possibility.  I don't want the behaviour from clojure,
but having something like *warn-on-reflection* or even a function to
check for exception escape would be nice.  Does that exist?

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Best way to augment core functions to support other data types?

2009-06-16 Thread Chris Dean


I'm using the embedded key/value database Tokyo Cabinet on a project.
We have functions that use the database and some of the them are very
similar to the core clojure functions that access a map.

For example, the Tokyo Cabinet functions db-count, db-seq, and db-get
correspond nicely to count, seq, and get.

What's the best way to augment the function named count (.et.al.) to
provide the same functionality as db-count ?

It seems like I should be able to use multimethods, but don't see how
that would work.

I suppose I could write a Java wrapper class that implements the proper
interfaces.  Either using plain old Java or the Clojure proxy/gen-class
functions.

Cheers,
Chris Dean

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: binding at the REPL

2009-06-16 Thread Frantisek Sodomka

There was regression in Clojure SVN r1370. Test for 'binding' is in:
http://code.google.com/p/clojure-contrib/source/browse/trunk/src/clojure/contrib/test_clojure/vars.clj

I can reproduce it with r1370.

Frantisek

On Jun 16, 8:08 pm, Stuart Halloway  wrote:
> This surprised me. What part of my mental model needs to be  
> adjusted? :-)
>
> user=> (def dozen 12)
> #'user/dozen
>
> user=> (binding [dozen 13] dozen)
> 12 ; hunh?
>
> user=> (#(binding [dozen 13] dozen))
> 13
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: binding at the REPL

2009-06-16 Thread Rich Hickey



On Jun 16, 5:34 pm, Frantisek Sodomka  wrote:
> There was regression in Clojure SVN r1370. Test for 'binding' is 
> in:http://code.google.com/p/clojure-contrib/source/browse/trunk/src/cloj...
>
> I can reproduce it with r1370.
>

That was fixed in r1373

Rich
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Best way to augment core functions to support other data types?

2009-06-16 Thread Chouser

On Tue, Jun 16, 2009 at 5:22 PM, Chris Dean wrote:
>
>
> I'm using the embedded key/value database Tokyo Cabinet on a project.
> We have functions that use the database and some of the them are very
> similar to the core clojure functions that access a map.
>
> For example, the Tokyo Cabinet functions db-count, db-seq, and db-get
> correspond nicely to count, seq, and get.
>
> What's the best way to augment the function named count (.et.al.) to
> provide the same functionality as db-count ?
>
> It seems like I should be able to use multimethods, but don't see how
> that would work.

It won't.  Most clojure core functions are not multimethods -- partly
because they don't really need to be, and partly be cause they must be
fast.

> I suppose I could write a Java wrapper class that implements the proper
> interfaces.  Either using plain old Java or the Clojure proxy/gen-class
> functions.

That's probably the right way to go.  If you've got your own object
(even if it's really just a Clojure hash-map with Tokyo Cabinet
handles in it), and you want to be able to use Clojure core functions
on it, proxy will probably work nicely for you.  The core functions
generally depend on specific Java interfaces that are defined in the
clojure.lang package, and wrapping a proxy around that is usually
pretty easy.

--Chouser

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Best way to augment core functions to support other data types?

2009-06-16 Thread Meikel Brandmeyer

Hi,

Am 16.06.2009 um 23:22 schrieb Chris Dean:


What's the best way to augment the function named count (.et.al.) to
provide the same functionality as db-count ?

It seems like I should be able to use multimethods, but don't see how
that would work.


The functions themselves could be implemented
as multimethods. But that would have a performance
impact.

However at the moment we have some hardcoded
types in the Java implementations of the functions.
Maybe the Java implementations in RT could fallback
to some -method version? Then you just implement
seq-method to get seq for your datastructure.

The known things (vector, map, whatever), would
still have the same speed.

This was already done for print.

Sincerely
Meikel



smime.p7s
Description: S/MIME cryptographic signature


Re: Best way to augment core functions to support other data types?

2009-06-16 Thread Chris Dean


Chouser  writes:
>> I suppose I could write a Java wrapper class that implements the proper
>> interfaces.  Either using plain old Java or the Clojure proxy/gen-class
>> functions.
>
> That's probably the right way to go.  If you've got your own object
> (even if it's really just a Clojure hash-map with Tokyo Cabinet
> handles in it), and you want to be able to use Clojure core functions
> generally depend on specific Java interfaces that are defined in the
> clojure.lang package, and wrapping a proxy around that is usually
> pretty easy.

That sounds fine to me, thanks!  I'm going to stick to the interfaces in
clojure.lang and hope that's kosher.  (For example, clojure.lang.Counted)

Cheers,
Chris Dean

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



multimethods

2009-06-16 Thread Chris Dean


Recently, Chouser  wrote:
> Most clojure core functions are not multimethods -- partly because
> they don't really need to be, and partly be cause they must be fast.

I've wondered why this is for a while now.  

To put it another way, why have the dichotomy between multimethods and
plain functions at all?

CL is like this too (methods are not the same thing as plain functions),
but that has a (partly) historical reason.

If the issue is performance, then I understand that.  But my vote as a
user (not that anyone asked for my opinion!) is that I would rather have
everything logically be a method and take a performance penalty.  For me
it's a consistency and simplicity over performance argument, although
not everyone will agree.

Cheers,
Chris Dean

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: multimethods

2009-06-16 Thread Raoul Duke

> If the issue is performance, then I understand that.  But my vote as a
> user (not that anyone asked for my opinion!) is that I would rather have
> everything logically be a method and take a performance penalty.  For me
> it's a consistency and simplicity over performance argument, although
> not everyone will agree.

situations like that are kind of a double-edged banana.

on the whole, though, $0.02 i also greatly prefer the KISS approach
over the fiddly-due-to-performance approach.

sincerely.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Determining exceptions that can leak from a function

2009-06-16 Thread Jarkko Oranen

tsuraan wrote:
> Is there any way for me to tell what exceptions I'm not handling in a
> clojure function?  javac will yell at me if I don't either handle or
> declare every possibility.  I don't want the behaviour from clojure,
> but having something like *warn-on-reflection* or even a function to
> check for exception escape would be nice.  Does that exist?

The general sentiment is that checked exceptions are evil. ;)

Clojure is dynamic, and there's simply no way to tell what exceptions
a function might throw, because functions can be redefined and they
can take other functions as parameters. On the Java side, the core
code actually has a catch-all that wraps all exceptions, just to stop
Java from complaining about non-declared exceptions and non-caught
ones.

Generally, exceptions will only occur if your code has a bug. That is,
unless you're doing IO or something else inherently non-functional, in
which case you should isolate the dangerous code and exercise extra
care anyway.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



clojure.contrib.trace enhancement proposal: dotrace

2009-06-16 Thread Michel Salim

I've often felt the need to enable tracing on some particular
functions, but do not really want to modify their definitions and then
add a requirement on clojure.contrib.trace. Here's a macro I came up
with, inspired by the tracing syntax in Chez Scheme:

(defmacro dotrace
  "Given a sequence of functions to trace, evaluate the given
expressions
  in an environment in which the given functions have tracing enabled"
  [fns & exprs]
  (if (empty? fns)
`(do ~...@exprs)
(let [func  (first fns)
  fns (next fns)]
  `(let [f# ~func]
 (binding [~func (fn [& args#] (trace-fn-call '~func f# args#))]
   (dotrace ~fns ~...@exprs))

I've tested and it appears to work fine (both from REPL -- there was a
slight hiccup earlier when I was testing; turns out that my
CLOJURE_EXT directory contains a JAR file from an Enclojure project
that bundles its own clojure-contrib.jar; and from Slime).

If others find it useful, I'd love for this to be added. Please let me
know if there are any improvements I could make -- this is my first
Clojure macro, so I'm sure I'm doing some non-idiomatic things.

Thanks,

--
Michel S.
(my contributor agreement should be with Rich already)
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: multimethods

2009-06-16 Thread CuppoJava

I agree that it would be nice to be able to treat all functions as
methods. But performance is also a key feature of Clojure that
attracts a large percentage of its users, myself included. The initial
reason I chose Clojure over Python, or Ruby, or any other scripting
language was its exceptional performance.
  -Patrick
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: multimethods

2009-06-16 Thread Raoul Duke

> I agree that it would be nice to be able to treat all functions as
> methods. But performance is also a key feature of Clojure that
> attracts a large percentage of its users, myself included. The initial
> reason I chose Clojure over Python, or Ruby, or any other scripting
> language was its exceptional performance.

i am not a language implementer, so this might not make much sense, but:

would it be possible for routines to check to see if they are not
using multimethod-ness, and in that case be performance optimized, yet
have the syntax for them all be somehow less different?

just trying to think of how one could present the programmer with
consistent abilities, while not avoiding possible optimization. of
course, some folks probably don't like such things and i don't totally
disagree (cf. http://prog21.dadgum.com/40.html).

sincerely.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Shouldn't c.l.Namespace implement c.l.Named?

2009-06-16 Thread Stephen C. Gilardi


On Jun 16, 2009, at 1:42 PM, pmf wrote:


I've noticed that clojure.lang.Namespace cannot be used with the name-
function (like (name *ns*)) because it does not implement
clojure.lang.Named. One has to use (.getName *ns*), which is a bit
ugly.


I've had this same thought in the past, but the Named interface  
returns strings from its .getName and .getNamespace calls:


user=> (show clojure.lang.Named)
===  public abstract interface clojure.lang.Named  ===
[ 0] getName : String ()
[ 1] getNamespace : String ()
nil

Subclasses of Named are named by either one string (when not namespace  
qualified) or by two strings (when namespace qualified).


In contrast, the name of a namespace is a symbol:

user=> (class (.getName *ns*))
clojure.lang.Symbol

Given that difference, it would not be appropriate for  
clojure.lang.Namespace to implement clojure.lang.Named.


As Meikel mentioned, Clojure provides ns-name for this purpose.

--Steve



smime.p7s
Description: S/MIME cryptographic signature


Re: Determining exceptions that can leak from a function

2009-06-16 Thread tsuraan

> Clojure is dynamic, and there's simply no way to tell what exceptions
> a function might throw, because functions can be redefined and they
> can take other functions as parameters. On the Java side, the core
> code actually has a catch-all that wraps all exceptions, just to stop
> Java from complaining about non-declared exceptions and non-caught
> ones.

Would it be possible to determine the exceptions that are thrown by
the java functions called by a clojure function?  Does that
information exist in the java type signatures or any data associated
with a function?

> Generally, exceptions will only occur if your code has a bug. That is,
> unless you're doing IO or something else inherently non-functional, in
> which case you should isolate the dangerous code and exercise extra
> care anyway.

Yeah, it's basically IO that I'm concerned with.  I'm mostly using
clojure to glue together AMQP, Lucene, and JInterface; my code is
really small, but those three have all sorts of exceptions they can
throw depending on network failures, disk corruption, etc.  I'd like
an easy way to ensure that I'm properly catching failures, especially
in the lucene area, where I need to rebuild corrupt indices when they
go bad.  Some way of making sure I don't miss exceptions would be
nice; perhaps something more automatic than reading the documentation
would be ideal :)

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Clojure goes Git!

2009-06-16 Thread Rich Hickey

Clojure and contrib repos are now on GitHub:

http://github.com/richhickey/clojure
http://github.com/richhickey/clojure-contrib

Issues and other development collaboration has moved to Assembla:

http://www.assembla.com/spaces/clojure
http://www.assembla.com/spaces/clojure-contrib

General discussions are going to stay right here on Google Groups:

http://groups.google.com/group/clojure

And there's a new group for Clojure developers and contributors:

http://groups.google.com/group/clojure-dev

non-contributors can follow along:

http://groups.google.com/group/clojure-dev/feeds

You can follow Clojure development on Twitter (exact content TBD):

http://twitter.com/clojuredev

Some items are still outstanding:

Importation of existing issues
Placement of generated contrib documentation
Patch submission policy

In particular, please don't send pull requests via GitHub at this
time.

The move to git was much requested, but accompanied by a certain
amount of apprehension from the non-git-savvy and some Windows users.
If you *are* git-savvy, please do your best to support others on the
group and irc as they get setup and find their bearings.

I'm looking forward to these new tools further enhancing the
collaboration amongst the Clojure community.

Thanks again to all for your participation!

Rich
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Clojure goes Git!

2009-06-16 Thread Sean Devlin

Thanks you!

On Jun 16, 8:17 pm, Rich Hickey  wrote:
> Clojure and contrib repos are now on GitHub:
>
> http://github.com/richhickey/clojurehttp://github.com/richhickey/clojure-contrib
>
> Issues and other development collaboration has moved to Assembla:
>
> http://www.assembla.com/spaces/clojurehttp://www.assembla.com/spaces/clojure-contrib
>
> General discussions are going to stay right here on Google Groups:
>
> http://groups.google.com/group/clojure
>
> And there's a new group for Clojure developers and contributors:
>
> http://groups.google.com/group/clojure-dev
>
> non-contributors can follow along:
>
> http://groups.google.com/group/clojure-dev/feeds
>
> You can follow Clojure development on Twitter (exact content TBD):
>
> http://twitter.com/clojuredev
>
> Some items are still outstanding:
>
>         Importation of existing issues
>         Placement of generated contrib documentation
>         Patch submission policy
>
> In particular, please don't send pull requests via GitHub at this
> time.
>
> The move to git was much requested, but accompanied by a certain
> amount of apprehension from the non-git-savvy and some Windows users.
> If you *are* git-savvy, please do your best to support others on the
> group and irc as they get setup and find their bearings.
>
> I'm looking forward to these new tools further enhancing the
> collaboration amongst the Clojure community.
>
> Thanks again to all for your participation!
>
> Rich
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Another Clojure Box

2009-06-16 Thread Darmac

Hi, I have been experimenting with Clojure last two months and in my
learning process I used several applications.
So, I have made a package and want it to share it with everybody that
want to learn Clojure.

What's wrong with the existing Clojure Box? well... nothing at all;
but if you are like me and want to avoid the complexity of learning a
new programming language in a new ide (for me) like emacs you may be
find this package usefull.

You have a customized version of scite, an application named
WinCommand to work more confortable with Clojure repl and JSwat to
debug your code.

Remember that WinCommand is developed using .Net framework (VS 2008)
but it was developed 4-5 years ago and my programming skills wasn't
the bests, so if you find something that can be fixed you can suggest
me.

Give it a try and let me know what do you think about it!

Ahh...jejeje... well.. if you want to download it you can find here:
http://sites.google.com/site/dariomac/Home/projects

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Clojure goes Git!

2009-06-16 Thread Richard Newman

Fantastic! Thanks Rich!

--
Sent from my iPhone.

On Jun 16, 2009, at 17:17, Rich Hickey  wrote:

>
> Clojure and contrib repos are now on GitHub:
>
> http://github.com/richhickey/clojure
> http://github.com/richhickey/clojure-contrib
>
> Issues and other development collaboration has moved to Assembla:
>
> http://www.assembla.com/spaces/clojure
> http://www.assembla.com/spaces/clojure-contrib
>
> General discussions are going to stay right here on Google Groups:
>
> http://groups.google.com/group/clojure
>
> And there's a new group for Clojure developers and contributors:
>
> http://groups.google.com/group/clojure-dev
>
> non-contributors can follow along:
>
> http://groups.google.com/group/clojure-dev/feeds
>
> You can follow Clojure development on Twitter (exact content TBD):
>
> http://twitter.com/clojuredev
>
> Some items are still outstanding:
>
>Importation of existing issues
>Placement of generated contrib documentation
>Patch submission policy
>
> In particular, please don't send pull requests via GitHub at this
> time.
>
> The move to git was much requested, but accompanied by a certain
> amount of apprehension from the non-git-savvy and some Windows users.
> If you *are* git-savvy, please do your best to support others on the
> group and irc as they get setup and find their bearings.
>
> I'm looking forward to these new tools further enhancing the
> collaboration amongst the Clojure community.
>
> Thanks again to all for your participation!
>
> Rich
> >

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Clojure goes Git!

2009-06-16 Thread Mark Volkmann
On Tue, Jun 16, 2009 at 7:17 PM, Rich Hickey  wrote:

>
> Clojure and contrib repos are now on GitHub:
>
> http://github.com/richhickey/clojure
> http://github.com/richhickey/clojure-contrib
>
> In particular, please don't send pull requests via GitHub at this
> time.
>

What's the reason to avoid "git pull"? Is there another way to get updates?

-- 
R. Mark Volkmann
Object Computing, Inc.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Clojure goes Git!

2009-06-16 Thread Antony Blakey


On 17/06/2009, at 10:29 AM, Mark Volkmann wrote:

> On Tue, Jun 16, 2009 at 7:17 PM, Rich Hickey   
> wrote:
>
> Clojure and contrib repos are now on GitHub:
>
> http://github.com/richhickey/clojure
> http://github.com/richhickey/clojure-contrib
>
> In particular, please don't send pull requests via GitHub at this
> time.
>
> What's the reason to avoid "git pull"? Is there another way to get  
> updates?

To send a pull *request* in git is asking a remote repository to  
accept *your* changes. It's how you contribute, it's not about  
updating your copy of the repository.

Antony Blakey
-
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

In anything at all, perfection is finally attained not when there is  
no longer anything to add, but when there is no longer anything to  
take away.
   -- Antoine de Saint-Exupery



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Clojure goes Git!

2009-06-16 Thread Mark Volkmann
On Tue, Jun 16, 2009 at 8:04 PM, Antony Blakey wrote:

>
> On 17/06/2009, at 10:29 AM, Mark Volkmann wrote:
>
> > On Tue, Jun 16, 2009 at 7:17 PM, Rich Hickey 
> > wrote:
> >
> > Clojure and contrib repos are now on GitHub:
> >
> > http://github.com/richhickey/clojure
> > http://github.com/richhickey/clojure-contrib
> >
> > In particular, please don't send pull requests via GitHub at this
> > time.
> >
> > What's the reason to avoid "git pull"? Is there another way to get
> > updates?
>
> To send a pull *request* in git is asking a remote repository to
> accept *your* changes. It's how you contribute, it's not about
> updating your copy of the repository.
>

I think you've got that backwards. A "git push" is how I would ask the
remote repo to accept my changes. A "git pull" says I want to update my
local repo with changes someone made in the remote repo.

-- 
R. Mark Volkmann
Object Computing, Inc.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Clojure goes Git!

2009-06-16 Thread Antoni Batchelli

Awesome news! :)

Git has a rather steep learning curve, but it pays to invest time on  
it (or on any other distributed SCM).

For learning Git I found "Git Magic" ( 
http://www-cs-students.stanford.edu/~blynn/gitmagic/ 
  ) to be very helpful, and "Git Internals" ( 
https://peepcode.com/products/git-internals-pdf 
  ) if you want to understand how it works internally.

Toni.

On Jun 16, 2009, at 5:17 PM, Rich Hickey wrote:

>
> Clojure and contrib repos are now on GitHub:
>
> http://github.com/richhickey/clojure
> http://github.com/richhickey/clojure-contrib
>
> Issues and other development collaboration has moved to Assembla:
>
> http://www.assembla.com/spaces/clojure
> http://www.assembla.com/spaces/clojure-contrib
>
> General discussions are going to stay right here on Google Groups:
>
> http://groups.google.com/group/clojure
>
> And there's a new group for Clojure developers and contributors:
>
> http://groups.google.com/group/clojure-dev
>
> non-contributors can follow along:
>
> http://groups.google.com/group/clojure-dev/feeds
>
> You can follow Clojure development on Twitter (exact content TBD):
>
> http://twitter.com/clojuredev
>
> Some items are still outstanding:
>
>   Importation of existing issues
>   Placement of generated contrib documentation
>   Patch submission policy
>
> In particular, please don't send pull requests via GitHub at this
> time.
>
> The move to git was much requested, but accompanied by a certain
> amount of apprehension from the non-git-savvy and some Windows users.
> If you *are* git-savvy, please do your best to support others on the
> group and irc as they get setup and find their bearings.
>
> I'm looking forward to these new tools further enhancing the
> collaboration amongst the Clojure community.
>
> Thanks again to all for your participation!
>
> Rich
> >


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Clojure goes Git!

2009-06-16 Thread Antoni Batchelli
I believe that sending a pull request, in this case, means asking  
someone at the master repository to pull a changes from, for example,  
your own local repository.

Toni.

On Jun 16, 2009, at 6:07 PM, Mark Volkmann wrote:

> On Tue, Jun 16, 2009 at 8:04 PM, Antony Blakey  > wrote:
>
> On 17/06/2009, at 10:29 AM, Mark Volkmann wrote:
>
> > On Tue, Jun 16, 2009 at 7:17 PM, Rich Hickey 
> > wrote:
> >
> > Clojure and contrib repos are now on GitHub:
> >
> > http://github.com/richhickey/clojure
> > http://github.com/richhickey/clojure-contrib
> >
> > In particular, please don't send pull requests via GitHub at this
> > time.
> >
> > What's the reason to avoid "git pull"? Is there another way to get
> > updates?
>
> To send a pull *request* in git is asking a remote repository to
> accept *your* changes. It's how you contribute, it's not about
> updating your copy of the repository.
>
> I think you've got that backwards. A "git push" is how I would ask  
> the remote repo to accept my changes. A "git pull" says I want to  
> update my local repo with changes someone made in the remote repo.
>
> -- 
> R. Mark Volkmann
> Object Computing, Inc.
>
> >


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Clojure goes Git!

2009-06-16 Thread Mark Derricutt
My impression is that a "git push" is you submitting the changes to the
remote repo, but a "git pull" *request* is asking Rich to review/pull your
changes.

If github land, this would involve Rich looking at his "fork queue" in the
GUI and going "accept accept accept", or doing a command line "git pull".

-- 

On Wed, Jun 17, 2009 at 1:07 PM, Mark Volkmann wrote:

> I think you've got that backwards. A "git push" is how I would ask the
> remote repo to accept my changes. A "git pull" says I want to update my
> local repo with changes someone made in the remote repo.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Clojure goes Git!

2009-06-16 Thread Antony Blakey


On 17/06/2009, at 10:37 AM, Mark Volkmann wrote:

> I think you've got that backwards. A "git push" is how I would ask  
> the remote repo to accept my changes. A "git pull" says I want to  
> update my local repo with changes someone made in the remote repo.

No, you can send a *request* to Rich, via GitHub, to pull from your  
repository. That's what a git pull *request* is - it's a request for  
someone else to git pull. A 'git pull' is, as you say, the command to  
pull commits into your repository and apply them, but that's not what  
Rich is talking about here.

A common GitHub workflow is to fork someone's repository, clone your  
fork, push your changes to your GitHub fork, and then send a pull  
request to the owner of the 'canonical' repository that you forked  
from, asking them to pull certain commits from your fork.

Antony Blakey
--
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

Human beings, who are almost unique in having the ability to learn  
from the experience of others, are also remarkable for their apparent  
disinclination to do so.
   -- Douglas Adams



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Clojure goes Git!

2009-06-16 Thread Antony Blakey

For anyone looking for explanatory material on git, I have, and can  
therefore recommend these:

http://www.pragprog.com/titles/tsgit/pragmatic-version-control-using-git
http://www.pragprog.com/screencasts/v-scgithub/insider-guide-to-github
https://peepcode.com/products/git

Antony Blakey
--
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

Success is not the key to happiness. Happiness is the key to success.
  -- Albert Schweitzer


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Clojure goes Git!

2009-06-16 Thread Antony Blakey


On 17/06/2009, at 10:58 AM, Antony Blakey wrote:

> For anyone looking for explanatory material on git, I have, and can  
> therefore recommend these:
>
> http://www.pragprog.com/titles/tsgit/pragmatic-version-control-using-git
> http://www.pragprog.com/screencasts/v-scgithub/insider-guide-to-github
> https://peepcode.com/products/git

And I forgot I had this: https://peepcode.com/products/git-internals-pdf

Antony Blakey
-
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

On the other side, you have the customer and/or user, and they tend to  
do what we call "automating the pain." They say, "What is it we're  
doing now? How would that look if we automated it?" Whereas, what the  
design process should properly be is one of saying, "What are the  
goals we're trying to accomplish and how can we get rid of all this  
task crap?"
   -- Alan Cooper



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Clojure goes Git!

2009-06-16 Thread Richard Newman

> And I forgot I had this: https://peepcode.com/products/git-internals-pdf

Seconded. Worth the $9 to save the time spent trawling through bad  
blog posts for similar info! As far as I can tell, this is also pretty  
much the only resource to have if you want to do more than just "human- 
oriented" version control using Git.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Clojure goes Git!

2009-06-16 Thread Antony Blakey


On 17/06/2009, at 10:58 AM, Antony Blakey wrote:

> http://www.pragprog.com/screencasts/v-scgithub/insider-guide-to-github

BTW: the first episode of this is free, and includes a section called  
'Send Pull Request'. It's purely about GitHub, rather than git itself.

Antony Blakey
--
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

Human beings, who are almost unique in having the ability to learn  
from the experience of others, are also remarkable for their apparent  
disinclination to do so.
   -- Douglas Adams



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Clojure goes Git!

2009-06-16 Thread Wrexsoul

On Jun 16, 10:04 pm, Antony Blakey  wrote:
> On 17/06/2009, at 10:58 AM, Antony Blakey wrote:
>
> >http://www.pragprog.com/screencasts/v-scgithub/insider-guide-to-github
>
> BTW: the first episode of this is free

On Jun 16, 9:56 pm, Richard Newman  wrote:
> > And I forgot I had this:https://peepcode.com/products/git-internals-pdf
>
> Seconded. Worth the $9 to save the time spent trawling through bad
> blog posts for similar info! As far as I can tell, this is also pretty
> much the only resource to have if you want to do more than just "human-
> oriented" version control using Git.

Are you two implying that there is no free documentation for git? That
goes against the spirit of open source, wouldn't you say, if the docs
are all proprietary?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Clojure goes Git!

2009-06-16 Thread Richard Newman

>> Seconded. Worth the $9 to save the time spent trawling through bad
>> blog posts for similar info! As far as I can tell, this is also  
>> pretty
>> much the only resource to have if you want to do more than just  
>> "human-
>> oriented" version control using Git.
>
> Are you two implying that there is no free documentation for git?

No. There is plenty of documentation for git -- the man pages are  
good, and the Git docs[1] are also useful.

However, the Peepcode PDF, 121 pages of diagrams and clear text,  
certainly beats the brief Git for Computer Scientists[2], and also  
includes clear descriptions of typical workflow steps, installation,  
etc. (not relevant in my case, but still useful to have in one place).

I'm happy to pay $9 for that.

> That goes against the spirit of open source, wouldn't you say, if  
> the docs
> are all proprietary?

The docs produced by the Git project aren't proprietary: there are  
plenty at [1], not to mention `man git`. I just see a great deal of  
value in clear, explanatory text as produced by accomplished technical  
writers. If the Peepcode PDF saves me five minutes, it was worth the  
money.

I don't think a discussion of the spirit of open source is  
particularly relevant to this forum, so I shan't address that point.

-R

[1] 
[2] 

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Rebinding functions?

2009-06-16 Thread Michel Salim



On Jun 16, 2:22 pm, Kevin Downey  wrote:
> you can use apply to avoid in-lining:
>
> user=> (binding [+ -] (apply + '(5 3)))
> 2
>
Indeed; this is what my macro ended up doing anyway, since it has to
work regardless of the arity of the functions to trace.

--
Michel
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Determining exceptions that can leak from a function

2009-06-16 Thread Ozzi Lee

You certainly should be able to do it using the Java reflection API on
the repl.

(.getMethods java.io.InputStream) will get you an array of Methods in
InputStream. From there you should be able to get what you want:

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/reflect/Method.html

This sort of thing might be nice to have in repl-utils:

http://code.google.com/p/clojure-contrib/wiki/ReplUtilsApiDoc
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Rebinding functions?

2009-06-16 Thread CuppoJava

This post worries me.
I've considered rewriting functions as inlining-macros for
optimization purposes. But I thought it would be a transparent change.
This post shows that it's not a transparent change, and could
potentially lead to some very odd looking bugs.

What if I wanted to optimize println by replacing it with a inlining-
macro? Now users that rebind println to do something extra will be
bewildered that the binding is not working.

Any thoughts?
-Patrick
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



accum

2009-06-16 Thread Wrexsoul

I'm shocked that this is missing from clojure.core:

(defn accum [f init coll]
  (loop [x init c coll]
(if (empty? c)
  x
  (recur (f x (first c)) (rest c)

user=> (accum + 0 [1 2 3])
6
user=> (accum + 0 [1 2 3 4 5])
15

This is one of the most basic, useful functions in functional
programming. :)

Here's any triangular number:

(defn tri [n] (accum + 0 (take n (iterate inc 1

Here's a lazy seq of them all:

(def *tris* (for [i (iterate inc 1)] (tri i)))

This, however, is more efficient (and demonstrates another case where
super-lazy-seq makes something very compact and readable):

(defn accum-map [f init coll]
  (super-lazy-seq [x init c coll]
(if (seq c)
  (next-item x (f x (first c)) (rest c)

(def *tris* (rest (accum-map + 0 (iterate inc 1

Notice how similar the accum-map code is to the accum code? With just
lazy-seq it would not be as clear. :)

The "rest" in the replacement def for *tris* is because accum-map
returns the init value as the first value of the sequence, i.e., it's
equivalent to making a sequence of (tri 0), (tri 1), (tri 2), and so
on.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: accum

2009-06-16 Thread Parth



On Jun 17, 9:34 am, Wrexsoul  wrote:
> I'm shocked that this is missing from clojure.core:
>
> (defn accum [f init coll]
>   (loop [x init c coll]
>     (if (empty? c)
>       x
>       (recur (f x (first c)) (rest c)
>
> user=> (accum + 0 [1 2 3])
> 6
> user=> (accum + 0 [1 2 3 4 5])
> 15
>
> This is one of the most basic, useful functions in functional
> programming. :)
>
> Here's any triangular number:
>
> (defn tri [n] (accum + 0 (take n (iterate inc 1
>

Maybe "apply" can be used

user=> (apply + [1 2 3])
6
user=> (apply + [1 2 3 4 5])
15
user=> (defn tri [n] (accum + 0 (take n (iterate inc 1
#'user/tri
user=> (tri 10)
55
user=> (def inf (iterate inc 1))
#'user/inf
user=> (defn tri2 [n] (apply + (take n inf)))
#'user/tri2
user=> (tri2 10)
55
user=>

or "reduce"?
user=> (reduce + 0 [1 2 3])
6
user=> (reduce + 10 [1 2 3])
16
user=> (reduce + 0 [1 2 3 4 5])
15

Regards,
Parth

> Here's a lazy seq of them all:
>
> (def *tris* (for [i (iterate inc 1)] (tri i)))
>
> This, however, is more efficient (and demonstrates another case where
> super-lazy-seq makes something very compact and readable):
>
> (defn accum-map [f init coll]
>   (super-lazy-seq [x init c coll]
>     (if (seq c)
>       (next-item x (f x (first c)) (rest c)
>
> (def *tris* (rest (accum-map + 0 (iterate inc 1
>
> Notice how similar the accum-map code is to the accum code? With just
> lazy-seq it would not be as clear. :)
>
> The "rest" in the replacement def for *tris* is because accum-map
> returns the init value as the first value of the sequence, i.e., it's
> equivalent to making a sequence of (tri 0), (tri 1), (tri 2), and so
> on.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: accum

2009-06-16 Thread Daniel Lyons


On Jun 16, 2009, at 10:34 PM, Wrexsoul wrote:

>
> I'm shocked that this is missing from clojure.core:
>
> (defn accum [f init coll]
>  (loop [x init c coll]
>(if (empty? c)
>  x
>  (recur (f x (first c)) (rest c)
>
> user=> (accum + 0 [1 2 3])
> 6
> user=> (accum + 0 [1 2 3 4 5])
> 15
>
> This is one of the most basic, useful functions in functional
> programming. :)

Indeed! It's called reduce:

http://clojure.org/api#toc476

I'm shocked you haven't noticed it in the API documentation. Being  
able to read is one of the most basic, useful skills in programming.  
Especially if you want to be pompous without being an ass.

> Here's any triangular number:
>
> (defn tri [n] (accum + 0 (take n (iterate inc 1
>
> Here's a lazy seq of them all:
>
> (def *tris* (for [i (iterate inc 1)] (tri i)))
>
> This, however, is more efficient (and demonstrates another case where
> super-lazy-seq makes something very compact and readable):
>
> (defn accum-map [f init coll]
>  (super-lazy-seq [x init c coll]
>(if (seq c)
>  (next-item x (f x (first c)) (rest c)
>
> (def *tris* (rest (accum-map + 0 (iterate inc 1
>
> Notice how similar the accum-map code is to the accum code? With just
> lazy-seq it would not be as clear. :)

Oh? What about compared to this:

(use 'clojure.contrib.seq-utils)

(def *tris* (reductions + (iterate inc 1)))

—
Daniel Lyons
http://www.storytotell.org -- Tell It!


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: accum

2009-06-16 Thread Sean Devlin

Daniel, don't feed the WrexTroll

On Jun 17, 12:44 am, Daniel Lyons  wrote:
> On Jun 16, 2009, at 10:34 PM, Wrexsoul wrote:
>
>
>
>
>
>
>
> > I'm shocked that this is missing from clojure.core:
>
> > (defn accum [f init coll]
> >  (loop [x init c coll]
> >    (if (empty? c)
> >      x
> >      (recur (f x (first c)) (rest c)
>
> > user=> (accum + 0 [1 2 3])
> > 6
> > user=> (accum + 0 [1 2 3 4 5])
> > 15
>
> > This is one of the most basic, useful functions in functional
> > programming. :)
>
> Indeed! It's called reduce:
>
> http://clojure.org/api#toc476
>
> I'm shocked you haven't noticed it in the API documentation. Being  
> able to read is one of the most basic, useful skills in programming.  
> Especially if you want to be pompous without being an ass.
>
>
>
>
>
> > Here's any triangular number:
>
> > (defn tri [n] (accum + 0 (take n (iterate inc 1
>
> > Here's a lazy seq of them all:
>
> > (def *tris* (for [i (iterate inc 1)] (tri i)))
>
> > This, however, is more efficient (and demonstrates another case where
> > super-lazy-seq makes something very compact and readable):
>
> > (defn accum-map [f init coll]
> >  (super-lazy-seq [x init c coll]
> >    (if (seq c)
> >      (next-item x (f x (first c)) (rest c)
>
> > (def *tris* (rest (accum-map + 0 (iterate inc 1
>
> > Notice how similar the accum-map code is to the accum code? With just
> > lazy-seq it would not be as clear. :)
>
> Oh? What about compared to this:
>
> (use 'clojure.contrib.seq-utils)
>
> (def *tris* (reductions + (iterate inc 1)))
>
> —
> Daniel Lyonshttp://www.storytotell.org-- Tell It!
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: accum

2009-06-16 Thread Wrexsoul

On Jun 17, 12:44 am, Parth  wrote:
> On Jun 17, 9:34 am, Wrexsoul  wrote:
> > I'm shocked that this is missing from clojure.core:
>
> > (defn accum [f init coll]
> >   (loop [x init c coll]
> >     (if (empty? c)
> >       x
> >       (recur (f x (first c)) (rest c)
>
> > user=> (accum + 0 [1 2 3])
> > 6
> > user=> (accum + 0 [1 2 3 4 5])
> > 15
>
> > This is one of the most basic, useful functions in functional
> > programming. :)
>
> > Here's any triangular number:
>
> > (defn tri [n] (accum + 0 (take n (iterate inc 1
>
> Maybe "apply" can be used
>
> user=> (apply + [1 2 3])
> 6
> user=> (apply + [1 2 3 4 5])
> 15

Yes, in the specific case of + it can, or other functions already
defined to take arbitrary arguments and accumulate them.

> or "reduce"?
> user=> (reduce + 0 [1 2 3])
> 6
> user=> (reduce + 10 [1 2 3])
> 16
> user=> (reduce + 0 [1 2 3 4 5])
> 15

Well that's weird. I SPECIFICALLY did a search of the entire api docs
to see if there was anything like "accum" already in there. I examined
every occurrence of "seq" and turned up a blank.

The docs definitely have problems if this can be missed despite a very
thorough search. The only more-thorough search would have been to
actually read the docs in their entirety, rather than to search them!


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: accum

2009-06-16 Thread Wrexsoul

On Jun 17, 12:44 am, Daniel Lyons  wrote:
> Indeed! It's called reduce:
>
> http://clojure.org/api#toc476
>
> I'm shocked you haven't noticed it in the API documentation.

I SPECIFICALLY did a search of the entire api docs to see if there was
anything like "accum" already in there. I examined every occurrence of
"seq" and turned up a blank.

The docs definitely have problems if this can be missed despite a very
thorough search. The only more-thorough search would have been to
actually read the docs in their entirety, rather than to search them!

> Being able to read is one of the most basic, useful skills
> in programming.

This rudeness is completely uncalled-for.

> Especially if you want to be pompous without being an ass.

Personal attacks are not welcome here.

> > Notice how similar the accum-map code is to the accum code? With just
> > lazy-seq it would not be as clear. :)
>
> Oh? What about compared to this:
>
> (use 'clojure.contrib.seq-utils)

Don't have that library. Still hasn't been released yet, last I
checked.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: accum

2009-06-16 Thread Wrexsoul

On Jun 17, 12:57 am, Sean Devlin  wrote:
> Daniel, don't feed the WrexTroll

Personal attacks are unwelcome here.

> > Indeed! It's called reduce:
>
> >http://clojure.org/api#toc476
>
> > I'm shocked you haven't noticed it in the API documentation.

I SPECIFICALLY did a search of the entire api docs to see if there was
anything like "accum" already in there. I examined every occurrence of
"seq" and turned up a blank.

The docs definitely have problems if this can be missed despite a very
thorough search. The only more-thorough search would have been to
actually read the docs in their entirety, rather than to search them!

> > Being able to read is one of the most basic, useful skills
> > in programming.

This rudeness is uncalled-for.

> > Especially if you want to be pompous without being an ass.

Personal attacks are unwelcome here.

> > Oh? What about compared to this:
>
> > (use 'clojure.contrib.seq-utils)
>
> > (def *tris* (reductions + (iterate inc 1)))

Depends on a library that hasn't been released yet.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Clojure goes Git!

2009-06-16 Thread Wrexsoul

On Jun 16, 10:43 pm, Richard Newman  wrote:
> The docs produced by the Git project aren't proprietary: there are  
> plenty at [1], not to mention `man git`. I just see a great deal of  
> value in clear, explanatory text

Enough value that there should be free clear, explanatory text about
open source software, not just free dense, hard-to-use manuals, if you
ask me. :)
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: multimethods

2009-06-16 Thread Konrad Hinsen

On 17.06.2009, at 00:20, Chris Dean wrote:

> To put it another way, why have the dichotomy between multimethods and
> plain functions at all?

Performance is one reason, as has been discussed already. But for  
many of Clojure's plain functions, it is not clear what their  
dispatch function should be if they were to be converted to  
multimethods.

As for the performance issue, Clojure is different from most other  
languages in that its built-in functions have no very special status:  
they are just the values of some vars in the namespace clojure.core.  
It is rather straightforward to define equivalent multimethods in  
some other namespace and use those instead. This leaves the  
programmer a choice between fast and flexible, which I think is very  
nice.

I have written mutlimethod variants for some of Clojure's core  
functions; they are available in clojure.contrib.generic. More could  
be added of course.

Konrad.




--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Clojure goes Git!

2009-06-16 Thread Richard Newman

> Clojure and contrib repos are now on GitHub:
>
> http://github.com/richhickey/clojure
> http://github.com/richhickey/clojure-contrib

A big thumbs-up on this: I've already started extending the contrib  
test suite (starting with clojure.set) in my own fork, which would be  
a much more painful process for all parties without GitHub and git. I  
guess this means that a DVCS does indeed encourage community  
involvement!

(I'll continue to accrue patches in my repo until a patch submission  
process arises.)

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: accum

2009-06-16 Thread Parth



On Jun 17, 10:24 am, Wrexsoul  wrote:
> On Jun 17, 12:44 am, Daniel Lyons  wrote:
>


>
> > (use 'clojure.contrib.seq-utils)
>
> Don't have that library. Still hasn't been released yet, last I
> checked.

I am not sure if a pre-built clojure-contrib.jar is available.

You could consider building from sources. It should be quite
straightforward.

[src]% git clone  git://github.com/richhickey/clojure-contrib.git
[src]% cd clojure-contrib
[clojure-contrib]% ant clean jar -Dclojure.jar=../clojure/clojure.jar
[clojure-contrib]% ls
build.xml  classes/  ClojureCLR/  clojure-contrib.jar  clojure-contrib-
slim.jar  clojurescript/  CPL.TXT*  epl-v10.html  launchers/  pom.xml
README.txt  Revisions  src/
[clojure-contrib]%

Note that -Dclojure.jar in the ant command above should point
to whereever you have the clojure.jar.

clojure-contrib has a lot of useful libs that you will miss out
on in case you are not using it.

Regards,
Parth

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Clojure goes Git!

2009-06-16 Thread Tassilo Horn

Antoni Batchelli  writes:

Hi Antoni,

> For learning Git I found "Git Magic" ( 
> http://www-cs-students.stanford.edu/~blynn/gitmagic/ 
>   ) to be very helpful, and "Git Internals" ( 
> https://peepcode.com/products/git-internals-pdf 
>   ) if you want to understand how it works internally.

I just want to add John Wiegley's excellent

  Git from the bottom up [1]

to the list of must-reads for mastering git.

Bye,
Tassilo
__
[1] http://ftp.newartisans.com/pub/git.from.bottom.up.pdf

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: multimethods

2009-06-16 Thread Chris Dean


Konrad Hinsen  writes:
> But for many of Clojure's plain functions, it is not clear what their
> dispatch function should be if they were to be converted to
> multimethods.

Indeed.  It can be a non-trivial design exercise.  But your
clojure.contrib.generic code shows that one can make headway on the
problem, especially for operators on collections which I would expect to
have polymorphic behavior.

> As for the performance issue, Clojure is different from most other  
> languages in that its built-in functions have no very special status:  
> they are just the values of some vars in the namespace clojure.core.  
> It is rather straightforward to define equivalent multimethods in  
> some other namespace and use those instead. 

Sure.  It's easy to write one's own version of get et.al.  What's hard
to do is to get packages that you didn't write to use that version of
get.  You need everyone to use c.c.generic.collection or all the
different libraries will have trouble interacting with each other.

There is this same namespace problem in Common Lisp, if you're familiar
with that package system.  While it's possible to use the same names as
are in the CL "core", almost no one does.

Cheers,
Chris Dean

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: accum

2009-06-16 Thread Sean Devlin

Wrexsoul,
Your right, I was out of line.  I'm sorry.  I should go through the
effort to explain myself rather than resort to personal attacks.

Sean

On Jun 17, 1:25 am, Wrexsoul  wrote:
> On Jun 17, 12:57 am, Sean Devlin  wrote:
>
> > Daniel, don't feed the WrexTroll
>
> Personal attacks are unwelcome here.
>
> > > Indeed! It's called reduce:
>
> > >http://clojure.org/api#toc476
>
> > > I'm shocked you haven't noticed it in the API documentation.
>
> I SPECIFICALLY did a search of the entire api docs to see if there was
> anything like "accum" already in there. I examined every occurrence of
> "seq" and turned up a blank.
>
> The docs definitely have problems if this can be missed despite a very
> thorough search. The only more-thorough search would have been to
> actually read the docs in their entirety, rather than to search them!
>
> > > Being able to read is one of the most basic, useful skills
> > > in programming.
>
> This rudeness is uncalled-for.
>
> > > Especially if you want to be pompous without being an ass.
>
> Personal attacks are unwelcome here.
>
> > > Oh? What about compared to this:
>
> > > (use 'clojure.contrib.seq-utils)
>
> > > (def *tris* (reductions + (iterate inc 1)))
>
> Depends on a library that hasn't been released yet.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---