Re: ClojureScript instead of CoffeeScript for complete web app development?

2012-06-14 Thread Jacobo Polavieja
El jueves, 14 de junio de 2012 08:39:19 UTC+2, Kevin Lynagh escribió:
>
>
>
>> As to your first point and only to clarify, had you made it a wrapper for 
>> D3 and in a node.js application, there would still be no problem in using 
>> it server-side, am I right?
>>
>
> Unfortunately, no---D3 requires a full DOM.
> Node.js is just the JavaScript engine.
> There are some fake DOM implementations that people use with node.js for 
> testing and scraping, but they were very rough last time I checked.
> PhantomJS is a very nice project that is a headless WebKit browser, which 
> we've used to run JavaScript with a DOM on the serverside.
> It can get a bit involved to coordinate that with other processes though...
>  
>
>> So, in short I've got a toy application in mind to learn either way, but 
>> the end project in mind is a trading application on the browser (which is 
>> my main field right now) that should deploy in as many devices/OS as 
>> possible (so, Javascript again). C2 fits in just perfect.
>>
>
> Speaking of toy applications with C2, I just open sourced an 
> implementation of "TodoMVC" using some new features slated for release in 
> C2 0.2.0:
>
> https://github.com/lynaghk/c2-demos/tree/master/todoMVC
>
> You might want to check this out and compare it with the n+1 existing 
> JavaScript application framework implementations to see which you like the 
> best.
>  
>
>> Many thanks for the answer as well as the talks, which have been trully 
>> great!
>>
>
> Thanks!
> The Conj talk was my first experience with the Clojure community, which 
> I've found to be very friendly and welcoming.
> Definitely don't shy away from posting to the list or dropping by #clojure 
> on IRC.
> Personally I'm very interested to hear about experiences of people who are 
> new to both JavaScript and Clojure(Script).
>

Oh, I didn't really think about the DOM thing... hehe!

Thanks for the TodoMVC bit, I'll have an in-depth look at it as soon as I 
understand Clojure better. I've already started with a tutorial to grasp 
the basic things and have looked for a book to complete the rest.

I'll sure be posting back with my troubles and experiences. As I haven't 
actually ever used Javascript I'm a good case to prove ClojureScript's 
ability to stay away from it :).

And the talks where great for me as you mentioned everything I wanted: 
functional programming benefits, Javascript/CoffeeScript VS ClojureScript, 
and the impact the way we display data can have (I too think programmers 
need to think lots more about this...)

Thanks a lot, you've been really helpful mate.

Cheers!

-- 
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: Why isn't there a fold-right?

2012-06-14 Thread Tassilo Horn
Tassilo Horn  writes:

> r-reduce> (let [f1 (apply comp* (take 100 (repeat inc)))
> f2 (apply comp (take 100 (repeat inc)))]
> (bench (f1 0) :verbose)
> (println "---")
> (bench (f2 0) :verbose))

Oh, in this benchmark probably lazyness bites back.  In the `comp` case
the `reverse` call will create a realized seq whereas in the `comp*`
case the realization will take place not before the composition fn f1 is
applied.  However, forcing the realization beforehand doesn't make it
much better.

--8<---cut here---start->8---
user> (let [coll (doall (take 100 (repeat inc)))
   f1 (apply comp* coll) 
   f2 (apply comp coll)] 
(bench (f1 0) :verbose) 
(println "---")
(bench (f2 0) :verbose))
amd64 Linux 3.4.2-gentoo 2 cpu(s)
OpenJDK 64-Bit Server VM 22.0-b10
Runtime arguments: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n 
-XX:+TieredCompilation -Xmx1G 
-Dclojure.compile.path=/home/horn/Repos/clj/testi/target/classes 
-Dtesti.version=0.1.0-SNAPSHOT -Dclojure.debug=false
Evaluation count : 600
 Execution time mean : 112.324465 ms  95.0% CI: (112.247218 ms, 
112.380682 ms)
Execution time std-deviation : 6.513809 ms  95.0% CI: (6.477450 ms, 
6.553029 ms)
 Execution time lower ci : 105.609401 ms  95.0% CI: (105.609401 ms, 
105.622918 ms)
 Execution time upper ci : 122.353763 ms  95.0% CI: (122.353763 ms, 
122.405315 ms)
---
amd64 Linux 3.4.2-gentoo 2 cpu(s)
OpenJDK 64-Bit Server VM 22.0-b10
Runtime arguments: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n 
-XX:+TieredCompilation -Xmx1G 
-Dclojure.compile.path=/home/horn/Repos/clj/testi/target/classes 
-Dtesti.version=0.1.0-SNAPSHOT -Dclojure.debug=false
Evaluation count : 1440
 Execution time mean : 43.519663 ms  95.0% CI: (43.516732 ms, 
43.524062 ms)
Execution time std-deviation : 492.299089 us  95.0% CI: (490.829889 us, 
494.198137 us)
 Execution time lower ci : 42.781398 ms  95.0% CI: (42.781398 ms, 
42.781398 ms)
 Execution time upper ci : 44.157311 ms  95.0% CI: (44.157311 ms, 
44.158513 ms)
nil
--8<---cut here---end--->8---

Bye,
Tassilo

-- 
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: Using read-string and macros together

2012-06-14 Thread Rob Harrop
Thanks Sean and Alan,

I had noticed the same issue with moving (read-string) inside the macro - 
it works great for literals, but then why bother.

I had almost resigned myself to that fact that this would require eval, but 
I wanted to exhaust all macro options first.

Thanks,

Rob

On Thursday, June 14, 2012 12:29:54 AM UTC+1, Rob Harrop wrote:
>
> Hi,
>
> I have a use case where I'd like to load small forms in String format from 
> a database and wrap them in functions. This is to support some basic 
> runtime customisation.
>
> I'm having problems getting read-string and macros to play nicely, a 
> problem which can be distilled as below:
>
> ; a simple macro to return a fn
> (defmacro xr [f]
>   `(fn [] ~f))
>
> ; calling the macro normally
> (apply (xr (println "hello")) []) ; nil (and prints hello)
>
> ; calling with the result of read string
> (apply (xr (read-string "(println \"hello\")")) []) ; (println "hello") 
> (and prints nothing)
>
> I'm sure I'm missing something very obvious here but I had assumed that 
> since (= '(println "rob") (read-string "(println \"rob\")")) that the above 
> example would work.
>
> Regards,
>
> Rob Harrop
>

-- 
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: Clojurescript (latest) advanced mode compilation => java.lang.ClassCastException ?

2012-06-14 Thread Dave Sann
It may take some time. I'll see what I can do.

D


On Thursday, 14 June 2012 00:09:49 UTC+10, David Nolen wrote:
>
> Does this problem only occur on a specific project? Can you create a 
> minimal reproducible case?
>
> Thanks,
> David
>
> On Wed, Jun 13, 2012 at 7:54 AM, 
>
>> So far I can only confirm the following.
>>
>> It does not occur if I revert to 
>> commit 7b6678bead5a0733d0388ddaa4e78e714b9d6187 but does 
>> from e959e0205a4b42a099c120a77427314d288c965b (Merge branch 
>> 'cljs-305-proto-inline') onward.
>>
>> I have been unable to get a stacktrace with the exception - So at the 
>> moment I really don't know why this is occurring.
>>
>> If I find out more I will report it.
>>
>> Otherwise - I am keen to know if anyone else sees a similar problem.
>>
>> D
>>
>>
>> On Tuesday, 12 June 2012 22:51:39 UTC+10, David Nolen wrote:
>>
>>> That ticket has been resolved. 
>>>
>>> For your own issue, more details required. If you can isolate it, open a 
>>> ticket.
>>>
>>> David
>>>
>>> On Tue, Jun 12, 2012 at 8:16 AM,
>>>
 I have started seeing java.lang.ClassCastException when compiling in 
 advanced mode.

 Compilation is fine with simple optimisations.

 This happens with source code that previously did not complain...

 I am wondering if this might be related to :

 https://groups.google.com/d/**topic/clojure/NHIzoUz0wmc/**discussion

 Anyone else see this?

 D

 -- 
 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+unsubscribe@**googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/clojure?hl=en

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

-- 
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: If a protocol creates a Java interface under the covers...

2012-06-14 Thread nicolas.o...@gmail.com
> (defn move
> "The function responsible for moving Pieces. Each piece knows how to move
> itself. If trying? is true, there will be no histiry of the new state of the
> board. Returns the new board."
>  ^clojure.lang.PersistentVector
> [game mappings p coords]
> {:pre [(satisfies? Piece p)]}  ;safety comes first
>
> (if (in? mappings (vector-of-doubles coords)) ;check that position exists on
> the grid
> (let [newPiece (update-position p coords)] ;the piece that results from the
> move
> (reset! (current-items game true) ;replace the appropriate board atom and
> log new state
> (populate-board game   ;replace dead-pieces with nils
> (-> (current-items game false) ;deref the appropriate board atom
>    (assoc (getListPosition p) nil) ;old position should have nil
>    (assoc (getListPosition newPiece) newPiece) ;new pos shoudl have the
> new piece
>
> (throw (IllegalArgumentException. (str coords " is NOT a valid position
> according to the mappings provided!")

There should not be any atom in this. The function would be more
reusable if it take a board and return
a board without changing any atom.
(You will still be to express the atom change around it but you could
also use to try and build a tree without undoing
anything.)

>
> (defmacro current-items
> [game atom?]
> `(condp = ~game
>       (symbol "chess")    (if ~atom? current-chessItems @current-chessItems)
>       (symbol "checkers") (if ~atom? current-checkers   @current-checkers)
> ))
>
I don't think this approach is extensible enough. You will want to
implement more games later.
So maybe a good thing is to use protocols or multimethods to represent
game rules.
The atoms should disappear until later. (You are building a library of
moves and rules, there is no notion
of state in that. Only when you use it for playing a game on a GUI you
will need a state)



> populate board is a monster I don't even want to look at it!
>
>
> (defn populate-board
> "Builds the appropriate board (chess or chekers). Will have nil at vacant
> positions. Really ugly fn but it does everything in 1 pass!"
>  ^clojure.lang.PersistentVector
> [game board]
> (loop [nb (vec (empty-board game)) ;building a brand new board after each
> move
>       p  board]
> (if (empty? p) nb
>  (let [fp (first p)]
>    (recur
>    (if (nil? fp) nb ;if encounter nil just carry on recursing with the
> current board
>       (assoc nb  ;else
>          (getListPosition fp)    ;the piece's position
>        (if (dead-piece? fp)   nil ;if the piece is dead stick nil
>                         fp)))  ; else stick the piece in
>         (rest p) )  ;carry on recursing
>
If it is just to remove dead pieces, you could do it during the move.
(When a piece is killed remove it immedialty.)
Then you don't need to copy the board, which will be in turn slightly
less expensive.
(Being able to share and not to copy is one of the benefits of immutability.)

Else something like (into [] (map (fn [x] (and (not (dead-piece? x))
x)) board)) should work.

-- 
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: If a protocol creates a Java interface under the covers...

2012-06-14 Thread Jim - FooBar();

On 14/06/12 10:01, nicolas.o...@gmail.com wrote:

There should not be any atom in this. The function would be more
reusable if it take a board and return
a board without changing any atom.
(You will still be to express the atom change around it but you could
also use to try and build a tree without undoing
anything.)


Yes you are right nicolas...I  really don't need to reset! the  atom 
inside 'move'...It has been addressed...



I don't think this approach is extensible enough. You will want to
implement more games later.
So maybe a good thing is to use protocols or multimethods to represent
game rules.
The atoms should disappear until later. (You are building a library of
moves and rules, there is no notion
of state in that. Only when you use it for playing a game on a GUI you
will need a state)


I don't want to involve multi-methods in this particular project for 
performance reasons...I do get your point but current-items is only 
fetching the atom or the derefed atom from a game...more game means 
adding a clause so it fetches the appropriate pieces...game rules will 
be implemented in core.logic it has nothing to do with this fn. I do 
agree I will only need the atom when playing an actual game though...



Jim


--
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: If a protocol creates a Java interface under the covers...

2012-06-14 Thread Jim - FooBar();

On 14/06/12 07:27, Tassilo Horn wrote:

I quickly glanced over your code.  Why do you still have `undo`?  That
shouldn't be needed in a fully immutable world.  If you make a move just
for trying out, then simply don't reset! your atom with the new value of
the current board.


Undo is still there cos I want to have an undo button on my gui for 
people to undo their moves after they've been properly executed (not 
just tried)...in other words it is not there to help with the recursion 
any more...I don't know if you noticed but i have a 'try-move' fn which 
just calls move without resetting the atom, an 'execute' which resets 
the atom with the result of 'try-move', and an 'undo' which again does 
not reset the atom...So it is only through 'execute' that the world can 
be changed and it is always  the atom that changes - not like before 
when the world could change without touching the atom...



Jim

--
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: If a protocol creates a Java interface under the covers...

2012-06-14 Thread Jim - FooBar();

On 14/06/12 06:38, Philip Potter wrote:


Another reason the interface exists is for interoperability - if you 
want a java class to participate in the protocol, you do it by 
implementing the corresponding interface.


Phil



People suggested that I should not consume the interface produced by a 
protocol definition from external sources (like a java class)...I think 
someone suggested I should use definterface instead for that reason...


Jim

--
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: Clojurescript (latest) advanced mode compilation => java.lang.ClassCastException ?

2012-06-14 Thread Dave Sann
I (think) I have tracked it down to the following section of code from 
jayq.core (simplified)

---

(ns jayq.core)

(extend-type js/jQuery
  IIndexed
  (-nth [this n]
(when (< n (count this))
  (.slice this n (inc n
  (-nth [this n not-found]
(if (< n (count this))
  (.slice this n (inc n))
  (if (undefined? not-found)
nil
not-found)))

  ILookup
  (-lookup
([this k]
   (or (.slice this k (inc k)) nil))
([this k not-found]
   (-nth this k not-found) ; < here if I 
comment and replace with 1 this will compile in advanced mode.
   ;1
   ))
  )

---

if I compile this in simple mode - it is ok.
In advanced, I get the following stack trace:

java.lang.ClassCastException: java.lang.String cannot be cast to 
clojure.lang.Named
at clojure.core$namespace.invoke(core.clj:1497)
at cljs.compiler$resolve_existing_var.invoke(compiler.clj:110)
at cljs.compiler$eval1054$fn__1056.invoke(compiler.clj:716)
at clojure.lang.MultiFn.invoke(MultiFn.java:163)
at cljs.compiler$emit_block.invoke(compiler.clj:333)
at cljs.compiler$emit_fn_method.invoke(compiler.clj:512)
at cljs.compiler$eval952$fn__954.invoke(compiler.clj:573)
at clojure.lang.MultiFn.invoke(MultiFn.java:163)
at cljs.compiler$emits.doInvoke(compiler.clj:232)
at clojure.lang.RestFn.invoke(RestFn.java:436)
at cljs.compiler$eval1089$fn__1091.invoke(compiler.clj:791)
at clojure.lang.MultiFn.invoke(MultiFn.java:163)
at cljs.compiler$emit_block.invoke(compiler.clj:333)
at cljs.compiler$eval996$fn__998.invoke(compiler.clj:633)
at clojure.lang.MultiFn.invoke(MultiFn.java:163)
at cljs.compiler$compile_file_STAR_.invoke(compiler.clj:1668)
at cljs.compiler$compile_file.invoke(compiler.clj:1705)
at cljs.compiler$compile_root.invoke(compiler.clj:1766)
at cljs.closure$compile_dir.invoke(closure.clj:364)
at cljs.closure$eval1981$fn__1982.invoke(closure.clj:396)
at cljs.closure$eval1910$fn__1911$G__1901__1918.invoke(closure.clj:266)
at cljs.closure$eval1968$fn__1969.invoke(closure.clj:410)
at cljs.closure$eval1910$fn__1911$G__1901__1918.invoke(closure.clj:266)
at cljs.closure$build.invoke(closure.clj:874)
at user$compile_cljs.invoke(NO_SOURCE_FILE:273)
at user$cljs_build.invoke(NO_SOURCE_FILE:284)
at clojure.lang.AFn.applyToHelper(AFn.java:167)
at clojure.lang.AFn.applyTo(AFn.java:151)
at clojure.core$apply.invoke(core.clj:605)
at clojure.core$partial$fn__4072.doInvoke(core.clj:2345)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at user$changed_fn$fn__2184.invoke(NO_SOURCE_FILE:88)
at user$watch.invoke(NO_SOURCE_FILE:103)
at user$main$fn__2271.invoke(NO_SOURCE_FILE:387)
at clojure.core$binding_conveyor_fn$fn__3989.invoke(core.clj:1819)
at clojure.lang.AFn.call(AFn.java:18)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)





On Thursday, 14 June 2012 18:28:56 UTC+10, Dave Sann wrote:
>
> It may take some time. I'll see what I can do.
>
> D
>
>
> On Thursday, 14 June 2012 00:09:49 UTC+10, David Nolen wrote:
>>
>> Does this problem only occur on a specific project? Can you create a 
>> minimal reproducible case?
>>
>> Thanks,
>> David
>>
>> On Wed, Jun 13, 2012 at 7:54 AM, 
>>
>>> So far I can only confirm the following.
>>>
>>> It does not occur if I revert to 
>>> commit 7b6678bead5a0733d0388ddaa4e78e714b9d6187 but does 
>>> from e959e0205a4b42a099c120a77427314d288c965b (Merge branch 
>>> 'cljs-305-proto-inline') onward.
>>>
>>> I have been unable to get a stacktrace with the exception - So at the 
>>> moment I really don't know why this is occurring.
>>>
>>> If I find out more I will report it.
>>>
>>> Otherwise - I am keen to know if anyone else sees a similar problem.
>>>
>>> D
>>>
>>>
>>> On Tuesday, 12 June 2012 22:51:39 UTC+10, David Nolen wrote:
>>>
 That ticket has been resolved. 

 For your own issue, more details required. If you can isolate it, open 
 a ticket.

 David

 On Tue, Jun 12, 2012 at 8:16 AM,

> I have started seeing java.lang.ClassCastException when compiling in 
> advanced mode.
>
> Compilation is fine with simple optimisations.
>
> This happens with source code that previously did not complain...
>
> I am wondering if this might be related to :
>
> https://groups.google.com/d/**topic/clojure/NHIzoUz0wmc/**discussion
>
> Anyone else see this?
>
> D
>
> -- 
> 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 mode

'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Jim - FooBar();

(doto foo
 (.bar x)
 (.baz y)
 (dotimes [i 10] (.zab g)))

won't work because foo is substituted as the second argument of 
'dotimes'! It has to be 'do' instead of 'doto'...


very subtle trap...

Jim

--
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: If a protocol creates a Java interface under the covers...

2012-06-14 Thread Philip Potter
On 14 June 2012 11:17, Jim - FooBar();  wrote:
> On 14/06/12 06:38, Philip Potter wrote:
>>
>>
>> Another reason the interface exists is for interoperability - if you want
>> a java class to participate in the protocol, you do it by implementing the
>> corresponding interface.
>>
>> Phil
>>
>
> People suggested that I should not consume the interface produced by a
> protocol definition from external sources (like a java class)...I think
> someone suggested I should use definterface instead for that reason...

It depends what you're trying to achieve.

You shouldn't use defprotocol if you are trying to create a java
interface. You should just use definterface.

Sometimes the abstraction you want really is a protocol and not an
interface. Then you should use defprotocol. Then, if later you (or
someone using your library) wants to write a Java class which
participates in the protocol, they can implement the interface.

Phil

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


[ANN] Tower, simple i18n library for Clojure

2012-06-14 Thread Peter Taoussanis
Hi all,

Just put up an early release of a little i18n library that some of you 
might find useful.

It's on Github (https://github.com/ptaoussanis/tower) and Clojars (
https://clojars.org/tower).

Features (taken from the readme):
* Consistent, lightweight wrappers for standard Java localization functions.
* Rails-like, all-Clojure translation function.
* Simple, map-based translation dictionary format. No XML or resource files!
* Seamless markdown support for translators.
* TODO: export/import to allow use with industry-standard tools for 
translators.
* TODO: Ring middleware for rapidly internationalizing web apps.

As always, any and all feedback very welcome!

Cheers!

- Peter Taoussanis (@ptaoussanis)

-- 
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: ClojureScript instead of CoffeeScript for complete web app development?

2012-06-14 Thread Paul deGrandis

I've been building out substantial ClojureScript apps for a few months now.
Previously I had written an HTML5 game engine, so I'm no stranger to lots 
of JavaScript.

My CLJS code base is smaller, easier to organize/maintain, more functional 
and declarative, and boasts a level of server-side interop that surpasses 
JS's best attempts (like meteor js).  Having the reader (and a REPL) in the 
browser opens up a lot of possibilities.

As Kevin stated there are a few sticky spots when working with 
ClojureScript, but those are quickly being solved.
If you're new to Clojure and client-side development (JavaScript), the lack 
of CLJS examples and documentation is going to be a hurdle for you.
Errors in the console are not obvious unless you have some idea about the 
implementation details of ClojureScript.  Error reporting will not tell you 
what line of CLJS code your error is on (or what you did wrong), you just 
have to look at the compiled JS source, know where in your CLJS source that 
code is being generated, and scan carefully until you spot the error in 
your code.  This was my biggest hurdle starting out.

Since you're picking up a toy project, I would choose whatever language 
you're most excited to learn.  Enthusiasm is a great motivator for 
overcoming any challenge.

Paul


On Thursday, June 14, 2012 3:10:51 AM UTC-4, Jacobo Polavieja wrote:
>
> El jueves, 14 de junio de 2012 08:39:19 UTC+2, Kevin Lynagh escribió:
>>
>>
>>
>>> As to your first point and only to clarify, had you made it a wrapper 
>>> for D3 and in a node.js application, there would still be no problem in 
>>> using it server-side, am I right?
>>>
>>
>> Unfortunately, no---D3 requires a full DOM.
>> Node.js is just the JavaScript engine.
>> There are some fake DOM implementations that people use with node.js for 
>> testing and scraping, but they were very rough last time I checked.
>> PhantomJS is a very nice project that is a headless WebKit browser, which 
>> we've used to run JavaScript with a DOM on the serverside.
>> It can get a bit involved to coordinate that with other processes 
>> though...
>>  
>>
>>> So, in short I've got a toy application in mind to learn either way, but 
>>> the end project in mind is a trading application on the browser (which is 
>>> my main field right now) that should deploy in as many devices/OS as 
>>> possible (so, Javascript again). C2 fits in just perfect.
>>>
>>
>> Speaking of toy applications with C2, I just open sourced an 
>> implementation of "TodoMVC" using some new features slated for release in 
>> C2 0.2.0:
>>
>> https://github.com/lynaghk/c2-demos/tree/master/todoMVC
>>
>> You might want to check this out and compare it with the n+1 existing 
>> JavaScript application framework implementations to see which you like the 
>> best.
>>  
>>
>>> Many thanks for the answer as well as the talks, which have been trully 
>>> great!
>>>
>>
>> Thanks!
>> The Conj talk was my first experience with the Clojure community, which 
>> I've found to be very friendly and welcoming.
>> Definitely don't shy away from posting to the list or dropping by 
>> #clojure on IRC.
>> Personally I'm very interested to hear about experiences of people who 
>> are new to both JavaScript and Clojure(Script).
>>
>
> Oh, I didn't really think about the DOM thing... hehe!
>
> Thanks for the TodoMVC bit, I'll have an in-depth look at it as soon as I 
> understand Clojure better. I've already started with a tutorial to grasp 
> the basic things and have looked for a book to complete the rest.
>
> I'll sure be posting back with my troubles and experiences. As I haven't 
> actually ever used Javascript I'm a good case to prove ClojureScript's 
> ability to stay away from it :).
>
> And the talks where great for me as you mentioned everything I wanted: 
> functional programming benefits, Javascript/CoffeeScript VS ClojureScript, 
> and the impact the way we display data can have (I too think programmers 
> need to think lots more about this...)
>
> Thanks a lot, you've been really helpful mate.
>
> Cheers!
>

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

Iterate and stack overflow

2012-06-14 Thread vmargioulas
Can someone explain why
... iterating over a sequence cause a stack overflow
(first (drop 1000 (iterate (partial map inc) (range 10 ->
java.lang.StackOverflowError

...but iterating over a vector works ok?
(first (drop 1000 (iterate (comp vec (partial map inc)) (range 10 -
> [1000 1001 1002 1003 1004 1005 1006 1007 1008 1009]

-- 
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: Iterate and stack overflow

2012-06-14 Thread Dave Sann
It doesn't overflow for me.


user=> (first (drop 1000 (iterate (partial map inc) (range 10
(1000 1001 1002 1003 1004 1005 1006 1007 1008 1009)


On Thursday, 14 June 2012 22:52:33 UTC+10, vmargioulas wrote:
>
> Can someone explain why 
> ... iterating over a sequence cause a stack overflow 
> (first (drop 1000 (iterate (partial map inc) (range 10 -> 
> java.lang.StackOverflowError 
>
> ...but iterating over a vector works ok? 
> (first (drop 1000 (iterate (comp vec (partial map inc)) (range 10 - 
> > [1000 1001 1002 1003 1004 1005 1006 1007 1008 1009] 
>

-- 
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: Iterate and stack overflow

2012-06-14 Thread Dave Sann
ah...but does for 1


On Thursday, 14 June 2012 22:58:58 UTC+10, Dave Sann wrote:
>
> It doesn't overflow for me.
>
>
> user=> (first (drop 1000 (iterate (partial map inc) (range 10
> (1000 1001 1002 1003 1004 1005 1006 1007 1008 1009)
>
>
> On Thursday, 14 June 2012 22:52:33 UTC+10, vmargioulas wrote:
>>
>> Can someone explain why 
>> ... iterating over a sequence cause a stack overflow 
>> (first (drop 1000 (iterate (partial map inc) (range 10 -> 
>> java.lang.StackOverflowError 
>>
>> ...but iterating over a vector works ok? 
>> (first (drop 1000 (iterate (comp vec (partial map inc)) (range 10 - 
>> > [1000 1001 1002 1003 1004 1005 1006 1007 1008 1009] 
>>
>

-- 
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: Iterate and stack overflow

2012-06-14 Thread Dave Sann
I suspect that the answer is the use of partial and the implementation of 
iterate

with (comp vec... you force realisation of the vector

without this I think you get (partial map (partial map (partial ) as f 
is repeatedly applied

if you do this,

(first (drop 10 (iterate #(apply list (map inc %)) (range 10

which forces the list to be realised, it wont overflow

D


On Thursday, 14 June 2012 23:00:15 UTC+10, Dave Sann wrote:
>
> ah...but does for 1
>
>
> On Thursday, 14 June 2012 22:58:58 UTC+10, Dave Sann wrote:
>>
>> It doesn't overflow for me.
>>
>>
>> user=> (first (drop 1000 (iterate (partial map inc) (range 10
>> (1000 1001 1002 1003 1004 1005 1006 1007 1008 1009)
>>
>>
>> On Thursday, 14 June 2012 22:52:33 UTC+10, vmargioulas wrote:
>>>
>>> Can someone explain why 
>>> ... iterating over a sequence cause a stack overflow 
>>> (first (drop 1000 (iterate (partial map inc) (range 10 -> 
>>> java.lang.StackOverflowError 
>>>
>>> ...but iterating over a vector works ok? 
>>> (first (drop 1000 (iterate (comp vec (partial map inc)) (range 10 - 
>>> > [1000 1001 1002 1003 1004 1005 1006 1007 1008 1009] 
>>>
>>

-- 
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: Iterate and stack overflow

2012-06-14 Thread Dave Sann
also

 (first (drop 10 (iterate #(doall (map inc %)) (range 10

so the better answer is probably - because map is lazy


On Thursday, 14 June 2012 23:06:27 UTC+10, Dave Sann wrote:
>
> I suspect that the answer is the use of partial and the implementation of 
> iterate
>
> with (comp vec... you force realisation of the vector
>
> without this I think you get (partial map (partial map (partial ) as f 
> is repeatedly applied
>
> if you do this,
>
> (first (drop 10 (iterate #(apply list (map inc %)) (range 10
>
> which forces the list to be realised, it wont overflow
>
> D
>
>
> On Thursday, 14 June 2012 23:00:15 UTC+10, Dave Sann wrote:
>>
>> ah...but does for 1
>>
>>
>> On Thursday, 14 June 2012 22:58:58 UTC+10, Dave Sann wrote:
>>>
>>> It doesn't overflow for me.
>>>
>>>
>>> user=> (first (drop 1000 (iterate (partial map inc) (range 10
>>> (1000 1001 1002 1003 1004 1005 1006 1007 1008 1009)
>>>
>>>
>>> On Thursday, 14 June 2012 22:52:33 UTC+10, vmargioulas wrote:

 Can someone explain why 
 ... iterating over a sequence cause a stack overflow 
 (first (drop 1000 (iterate (partial map inc) (range 10 -> 
 java.lang.StackOverflowError 

 ...but iterating over a vector works ok? 
 (first (drop 1000 (iterate (comp vec (partial map inc)) (range 10 - 
 > [1000 1001 1002 1003 1004 1005 1006 1007 1008 1009] 

>>>

-- 
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: Iterate and stack overflow

2012-06-14 Thread vmargioulas
Thanks, this explains the stack overflow

On Thursday, June 14, 2012 4:12:28 PM UTC+3, Dave Sann wrote:
>
> also
>
>  (first (drop 10 (iterate #(doall (map inc %)) (range 10
>
> so the better answer is probably - because map is lazy
>
>
> On Thursday, 14 June 2012 23:06:27 UTC+10, Dave Sann wrote:
>>
>> I suspect that the answer is the use of partial and the implementation of 
>> iterate
>>
>> with (comp vec... you force realisation of the vector
>>
>> without this I think you get (partial map (partial map (partial ) as 
>> f is repeatedly applied
>>
>> if you do this,
>>
>> (first (drop 10 (iterate #(apply list (map inc %)) (range 10
>>
>> which forces the list to be realised, it wont overflow
>>
>> D
>>
>>
>> On Thursday, 14 June 2012 23:00:15 UTC+10, Dave Sann wrote:
>>>
>>> ah...but does for 1
>>>
>>>
>>> On Thursday, 14 June 2012 22:58:58 UTC+10, Dave Sann wrote:

 It doesn't overflow for me.


 user=> (first (drop 1000 (iterate (partial map inc) (range 10
 (1000 1001 1002 1003 1004 1005 1006 1007 1008 1009)


 On Thursday, 14 June 2012 22:52:33 UTC+10, vmargioulas wrote:
>
> Can someone explain why 
> ... iterating over a sequence cause a stack overflow 
> (first (drop 1000 (iterate (partial map inc) (range 10 -> 
> java.lang.StackOverflowError 
>
> ...but iterating over a vector works ok? 
> (first (drop 1000 (iterate (comp vec (partial map inc)) (range 10 
> - 
> > [1000 1001 1002 1003 1004 1005 1006 1007 1008 1009] 
>


-- 
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: Central screwup

2012-06-14 Thread Stuart Sierra
 

> Is there anyone on the Clojure/core team with a contact among those 
> who run Central who could get them to look into this? 
>

I'm on the Sonatype OSSRH mailing list:
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide
(mailing list addresses at the bottom)

There was no mention of this issue there, but I'll ask about it. 
-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: ClojureScript instead of CoffeeScript for complete web app development?

2012-06-14 Thread Jacobo Polavieja
El jueves, 14 de junio de 2012 14:42:14 UTC+2, Paul deGrandis escribió:
>
>
> I've been building out substantial ClojureScript apps for a few months now.
> Previously I had written an HTML5 game engine, so I'm no stranger to lots 
> of JavaScript.
>
> My CLJS code base is smaller, easier to organize/maintain, more functional 
> and declarative, and boasts a level of server-side interop that surpasses 
> JS's best attempts (like meteor js).  Having the reader (and a REPL) in the 
> browser opens up a lot of possibilities.
>
> As Kevin stated there are a few sticky spots when working with 
> ClojureScript, but those are quickly being solved.
> If you're new to Clojure and client-side development (JavaScript), the 
> lack of CLJS examples and documentation is going to be a hurdle for you.
> Errors in the console are not obvious unless you have some idea about the 
> implementation details of ClojureScript.  Error reporting will not tell you 
> what line of CLJS code your error is on (or what you did wrong), you just 
> have to look at the compiled JS source, know where in your CLJS source that 
> code is being generated, and scan carefully until you spot the error in 
> your code.  This was my biggest hurdle starting out.
>
> Since you're picking up a toy project, I would choose whatever language 
> you're most excited to learn.  Enthusiasm is a great motivator for 
> overcoming any challenge.
>
> Paul
>
 
Hi Paul, thanks for answering. It'salways good to hear from someone with 
battle field experience, hehe!

I've picked a toy project jus to learn but the whole point is to develop 
larger apps. If it was just for a little app probably CoffeeScript would be 
a faster way to get into it, but I'm looking into larger apps and long term 
future. That's why (apart from the fact that I love the truly functional 
paradigm and lots of Clojure's innovations) I've decided to go the CLJS 
route. Hope it pans out ok although having some problems is expected, 
obviously.

Thanks again for your input! It's good to know there are some "more than a 
toy" codebases out there which are getting developed ok.

Cheers!

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

IllegalStateException "I/O in transaction" in REPL

2012-06-14 Thread Daniil Mirylenka
I'm trying to insert some values into MySQL db, via clojure.java.jdbc.
When I call my code from Leiningen REPL, I get:

IllegalStateException I/O in transaction 
 clojure.java.jdbc.internal/transaction* (internal.clj:212).


The same code runs without exception when executed outside repl (in my 
case, through "lein run").

I can imagine that repl causes some extra IO, but I can't see how it can 
happen *within* my jdbc transactions!

Somehow, I didn't manage to find the answer on google.

-- 
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: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread David Della Costa
Just saw this thread.  I went through something similar recently: I'm
a long-time emacs user just getting into Clojure, so naturally I set
it up with emacs.  I set it up with Leiningen (a 2.0.0 preview
version), and while I found it relatively painless, I did have a few
problems mostly with Emacs.  I think the stuff about getting
sidetracked with emacs configuration/package-management is pretty
true; it's very easy to get lost in the emacs wilderness, which is
much "hoarier" than Clojure.

I also think that, at present, while coming in through Leiningen is
definitely the most painless way to do things (I'm really loving it
actually, as a Ruby dev it kind of seems like rvm + bundler + rake all
wrapped up in one handy package), trying to navigate whether to use
1.x or 2.x preview is a bit confusing--and the variety of docs
available for setting things up is confusing.  Similarly, it's easy to
get lost (as a beginner) between namespace issues with packages and
how to set things up properly with Leiningen.  It'd be good to have
some documentation on that.

Getting testing up and running with midje was also a bit of a
challenge--I still haven't figured out how to get automated testing
going smoothly in emacs with the nice midje stuff Mr. Marick has
added, but I'll go back and tackle that some day.  At the least, I
finally got testing working via lein.

And at the danger of digressing wildly, as a beginner namespace and
file loading stuff is really hard to wrap my head around, but that
could be my own particular weakness.

All of that said, maybe I'll take a look at the docs and see if I can
add anything constructive, since I've set it up now a few times on
Macs.

In any case, I'm really loving playing with Clojure.  I hope to start
sneaking it into some real applications at work this year, and infect
some other devs with the Clojure bug...

Cheers,
Dave D.

2012/6/14 Sean Corfield :
> On Wed, Jun 13, 2012 at 6:27 PM, fenton  wrote:
>> I totally understand the value of having a single source of truth (DRY
>> principle).  My main problem was that to get from 0-60 for doing clojure
>> development is quite challenging.
>
> Which is why the official documentations needs contributions from
> folks who've gone thru this process recently... It's a bit of a
> chicken and egg situation: if the current docs aren't good enough,
> folks go off into the Internet wilderness and try to piece together
> the experience themselves. And then what they go thru often doesn't
> even come close to what _should_ be in the official documentation as
> the simplest solution. And of course we each typically only set up one
> machine (our own) so we don't have much incentive to repeat the
> process over and over to refine it for the official documentation. I
> sympathize with the process you've gone thru. I went thru it too. I
> created this document for Emacs + Leiningen on Windows -
> http://corfield.org/articles/emacs_win.html - and I have not
> publicized it because it's already out of date. And that was the third
> time I'd been thru the process: first on Mac, then on Ubuntu, then
> Windows XP.
>
>> I had a major piss around trying to get the marmelade repo working.
>>  Finally, someone suggested emacs 24, which itself is fairly hard to find
>> without a link to alpa.
>
> The kind folks on #clojure on IRC ensured I started with a prerelease
> of Emacs 24 which helped. Emacs 24 is now the current stable version,
> which makes discovery much easier.
>
>> So say I start at: http://marmalade-repo.org/, well then it says: "Install
>> package.el", it doesn't say how to install package.el, so now I gotta google
>
> Yup, that was my initial complaint.
>
>> I still don't know if I
>> need both clojure and clojure-contrib in my project.clj files or not.  They
>> are different versions, should they be in sync?
>
> Monolithic Clojure Contrib was deprecated when Clojure 1.3 appeared
> and is no longer maintained. See
> http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
>
>> I did find myself getting a bit angry writing this, because I'd really like
>> to see clojure displace java, but I think its fair to say that there is a
>> gap in helping people who have little
>> emacs/clojure/leiningen/swank/slime/cdt/lisp exposure getting on board.
>
> Yup. This complaint is very valid and comes up fairly regularly, and
> each time the official documentation gets a bit better (but it still
> has a long way to go).
>
>> I think github is a better place to document this stuff than confluence.
>
> The Clojure project uses JIRA / Confluence for issue tracking and
> documentation - and Github for code. Pull requests are not allowed.
> See http://clojure.org/contributing and http://clojure.org/patches -
> also see 
> http://dev.clojure.org/display/doc/Guidelines+for+Clojure+Contrib+committers
> for the mechanics of getting onboard as a contributor and getting your
> accounts / permissions set up.
>
> We definitely need improvements in the official g

Re: Broken "Sequences" screencast

2012-06-14 Thread David Della Costa
Hey folks, I see that this was never answered, but it remains a problem. 
 I've tried viewing the video on blip 
(http://blip.tv/clojure/clojure-sequences-740581) as well as downloading 
via iTunes, but no dice--I get about 8 seconds of Rich introducing the 
topic and then nothing.

I'd love to see this video, so if anyone has a copy or can point me to a 
working resource I'd be most appreciative--thank you!

Best,
Dave

2011年9月1日木曜日 17時46分11秒 UTC+9 Irakli Gozalishvili:
>
> Hi,
>
> Not sure if this right place to report about this, but I could not thing 
> of any better. I'm in a process of learning Clojure and I found 
> screen-casts linked from clojure.org http://blip.tv/clojure very useful. 
> Unfortunately thought ["Clojure Sequences"](
> http://blip.tv/clojure/clojure-sequences-740581) video is broken it plays 
> 7secs and stops. Would be great if anyone could fixed that!
>
> Regards
>

-- 
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: How about 'nth' accepts maps?

2012-06-14 Thread hyPiRion
On Tuesday, June 12, 2012 12:54:08 PM UTC+2, Chris Ford wrote:
>
> I guess the question should then be, should nth call seq on its argument?
>

This is horrible for performance. For a sequence, nth will run in O(n) 
time, whereas it for any indexed data structure (vectors, strings, 
arraylists, etc.) runs in constant time.

It is also semantically scary: By adding maps into the nth-definition, you 
may "trick" people into believing all maps are sorted. Besides, what should 
it return that "makes sense"? The value, or the key-value pair?

If you really need nth for your hash map in the way you describe and don't 
need to remove elements from the map, then I suggest creating a new data 
structure with a vector and a hash map. assoc will add a key-value pair in 
the hash map as well as conj(oin) [key value] onto the vector. Now, 
whenever you need to perform nth, you will get the speed of the vector, 
while maintaining the speed a map has otherwise.

-- 
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: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread John Gabriele
On Jun 13, 10:58 pm, Sean Corfield  wrote:
> On Wed, Jun 13, 2012 at 7:45 PM, Sean Corfield  wrote:
> > We definitely need improvements in the official getting started
> > documentation. Starting here -
> >http://dev.clojure.org/display/doc/Getting+Started- any specific
> > problems / improvements that folks identify will generally get fixed
> > fairly quickly if they're brought up on this list. There are a couple
> > of list members who are pretty motivated around improving the "newbie
> > experience"...
>
> And of course the official clojure-mode and swank-clojure
> documentation *is* on Github so fork/update/pull request is the
> natural workflow there.
>
> The information in the comments 
> onhttp://dev.clojure.org/display/doc/Getting+Started+with+Emacsneeds to
> be folded into the main instructions (and the comments deleted, IMO,
> since they just add to the noise and confusion).
>
> The page should start with links to install the current stable version
> of Emacs for Windows, Linux, Mac. The latest version of swank-clojure
> should be referenced (1.4.2).

It's difficult to keep wiki docs nice and up-to-date.

Writing good (and concise) docs is hard work.

Some potential contributors may not want to go through the time to
register and send in the CCA (or whatever the confluence wiki
requires).

Others may not want to take the time to contribute a magnum opus to
the wiki because they're not crazy about the idea of someone coming
around after them and making sweeping changes to their work.

I know I like to keep my own magnum opi sequestered off in my own docs
directory (for example, 
http://www.unexpected-vortices.com/clojure/10-minute-emacs-for-clojure.html
).

Wiki's have a tendency to become cluttered and disorganized. Same with
individual wiki pages, for that matter.

A great strength of wikis is that there's a lot of eyeballs that can
(or should be able to) easily fix typos & broken-links, update out-of-
date links, and so on.

IMO:

* core docs should be a focused set of .md files that contributors
work on by cloning, editing, and sending pull-requests.

* wiki docs should be easy to contribute to and should encourage links
to outside docs (though, include last-modified dates for those!).
Users can sort out which external articles and blog-posts are most
useful, which can then "bubble to the top", so to speak.

Just my 2¢.

---John

-- 
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: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Tassilo Horn
"Jim - FooBar();"  writes:

> (doto foo
>  (.bar x)
>  (.baz y)
>  (dotimes [i 10] (.zab g)))
>
> won't work because foo is substituted as the second argument of
> 'dotimes'!

The docs clearly state that.

> It has to be 'do' instead of 'doto'...

Then, you need (.bar foo x), (.baz foo y), and (.zap foo g), too.

Bye,
Tassilo

-- 
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: Broken "Sequences" screencast

2012-06-14 Thread Kevin Ilchmann Jørgensen
>From the rss.
http://blip.tv/file/get/Richhickey-ClojureSequences284.mov

The sound dont get any better thru.
/Kevin

On Thu, Jun 14, 2012 at 4:11 AM, David Della Costa
 wrote:
> Hey folks, I see that this was never answered, but it remains a problem.
>  I've tried viewing the video on blip
> (http://blip.tv/clojure/clojure-sequences-740581) as well as downloading via
> iTunes, but no dice--I get about 8 seconds of Rich introducing the topic and
> then nothing.
>
> I'd love to see this video, so if anyone has a copy or can point me to a
> working resource I'd be most appreciative--thank you!
>
> Best,
> Dave
>
> 2011年9月1日木曜日 17時46分11秒 UTC+9 Irakli Gozalishvili:
>>
>> Hi,
>>
>> Not sure if this right place to report about this, but I could not thing
>> of any better. I'm in a process of learning Clojure and I found screen-casts
>> linked from clojure.org http://blip.tv/clojure very useful. Unfortunately
>> thought ["Clojure
>> Sequences"](http://blip.tv/clojure/clojure-sequences-740581) video is broken
>> it plays 7secs and stops. Would be great if anyone could fixed that!
>>
>> Regards
>
> --
> 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

-- 
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: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Aaron Cohen
On Thu, Jun 14, 2012 at 8:09 AM, Jim - FooBar();  wrote:
> (doto foo
>  (.bar x)
>  (.baz y)
>  (dotimes [i 10] (.zab g)))
>
> won't work because foo is substituted as the second argument of 'dotimes'!
> It has to be 'do' instead of 'doto'...
>
> very subtle trap...
>
> Jim

I think the "trap" here (if there is one) is that coming from another
language, you might believe that "doto" is setting some magical
"context" value. For instance, the with statement in javascript does
some sort of magic to alter the "current scope".

If you understand that "doto" is simply a macro that alters the source
code that it is invoked upon, it's pretty clear what is wrong with
your code. This same understanding then applies to all the other
similar macros (.., ->, ->>). None of them are doing anything other
than rearranging source code.

--Aaron

-- 
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: IllegalStateException "I/O in transaction" in REPL

2012-06-14 Thread Meikel Brandmeyer (kotarak)
Hi,

the exception probably stems from the fact that you do the database 
interaction inside a dosync transaction.

Kind regards
Meikel

-- 
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: Clojurescript - Javascript constructor and namespace with the same name problem

2012-06-14 Thread David Nolen
:require now no longer requires :as. :require now also supports :refer
(thanks Michal!) which brings us in line with Clojure on the JVM. Still
discussing the implications of doing :import (CLJS-312).

David

On Mon, Jun 11, 2012 at 9:36 PM, Michał Marczyk wrote:

> Patch attached to 272 (note it's created on top of 312).
>
> Cheers,
> M.
>
>
> On 12 June 2012 03:22, David Nolen  wrote:
> > Thanks!
> >
> > On Mon, Jun 11, 2012 at 9:22 PM, Michał Marczyk <
> michal.marc...@gmail.com>
> > wrote:
> >>
> >> See
> >>
> >> http://dev.clojure.org/jira/browse/CLJS-312
> >>
> >> for :import (patch attached). Looking at 272 now...
> >>
> >>
> >> On 12 June 2012 03:16, Michał Marczyk  wrote:
> >> > On 11 June 2012 18:49, David Nolen  wrote:
> >> >> Anyone game to submit some fixes?
> >> >
> >> > I am. I'll create a new ticket for :import and build :require w/o :as
> >> > on top of that (attaching patch to CLJS-272).
> >> >
> >> > M.
> >>
> >> --
> >> 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
> >
> >
> > --
> > 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
>
> --
> 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
>

-- 
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: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Jim - FooBar();

On 14/06/12 15:10, Tassilo Horn wrote:

The docs clearly state that.


Where? I don't see any warnings...It does say "... calls all of the 
methods and functions with the
  value of x supplied at the front of the given arguments" but it 
wasn't obvious to me at first!


user=> (doc dotimes)
-
clojure.core/dotimes
([bindings & body])
Macro
  bindings => name n

  Repeatedly executes body (presumably for side-effects) with name
  bound to integers from 0 through n-1.
nil
user=> (doc doto)
-
clojure.core/doto
([x & forms])
Macro
  Evaluates x then calls all of the methods and functions with the
  value of x supplied at the front of the given arguments.  The forms
  are evaluated in order.  Returns x.

  (doto (new java.util.HashMap) (.put "a" 1) (.put "b" 2))
nil
user=>



Then, you need (.bar foo x), (.baz foo y), and (.zap foo g), too.



yes of course - that goes without saying... :-)

Jim



--
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: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread David Nolen
On Thu, Jun 14, 2012 at 10:39 AM, Jim - FooBar(); wrote:

> Evaluates x then calls all of the methods and functions with the
>  value of x supplied at the front of the given arguments
>

that's in the docstring for doto. but dotimes is not a method or a function
is it? :)

David

-- 
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: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Jim - FooBar();

well, no... :-)

Jim

On 14/06/12 15:52, David Nolen wrote:
On Thu, Jun 14, 2012 at 10:39 AM, Jim - FooBar(); 
mailto:jimpil1...@gmail.com>> wrote:


Evaluates x then calls all of the methods and functions with the
 value of x supplied at the front of the given arguments


that's in the docstring for doto. but dotimes is not a method or a 
function is it? :)


David

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


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

Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Jacobo Polavieja
Hi!

I've just started learning Clojure today. I've started reading "Clojure - 
Functional Programming for the JVM" (
http://java.ociweb.com/mark/clojure/article.html
).

Anyway, on the collections part (
http://java.ociweb.com/mark/clojure/article.html#Collections) it called my 
attention that 'some' returns "nil" instead of "false". The examples given 
(being stooges a vector of Strings) are:

(not-every? #(instance? String %) stooges) ; -> false
(some #(instance? Number %) stooges) ; -> nil

Is there a reason why (some) doesn't return false also? I've read through 
the doc but as I supposed, there's no explanation about the reasoning 
behind it.

Thanks!

-- 
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: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread David Nolen
not-every? is a predicate (note the ?)

some is not.

On Thu, Jun 14, 2012 at 11:31 AM, Jacobo Polavieja <
jacobopolavi...@gmail.com> wrote:

> Hi!
>
> I've just started learning Clojure today. I've started reading "Clojure -
> Functional Programming for the JVM" (
> http://java.ociweb.com/mark/clojure/article.html
> ).
>
> Anyway, on the collections part (
> http://java.ociweb.com/mark/clojure/article.html#Collections) it called
> my attention that 'some' returns "nil" instead of "false". The examples
> given (being stooges a vector of Strings) are:
>
> (not-every? #(instance? String %) stooges) ; -> false
> (some #(instance? Number %) stooges) ; -> nil
>
> Is there a reason why (some) doesn't return false also? I've read through
> the doc but as I supposed, there's no explanation about the reasoning
> behind it.
>
> Thanks!
>
> --
> 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

-- 
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: How about 'nth' accepts maps?

2012-06-14 Thread Tassilo Horn
hyPiRion  writes:

> If you really need nth for your hash map in the way you describe and
> don't need to remove elements from the map, then I suggest creating a
> new data structure with a vector and a hash map.

There's the ordered lib on clojars which provides sets and maps that
keep their insertion (or conj/assoc) order using exactly what you
suggest.

Bye,
Tassilo

-- 
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: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Tassilo Horn
Jacobo Polavieja  writes:

Hi Jacobo,

> (not-every? #(instance? String %) stooges) ; -> false
> (some #(instance? Number %) stooges) ; -> nil
>
> Is there a reason why (some) doesn't return false also?

`some` is no predicate (else it would have a ? appended).  It simply
returns the first truthy (i.e., not false nor nil) value of applying the
given fn to the elements of the fiven seq one after the other.

user> (some seq [[] (list) (hash-map) [1 2 3] [4 5]])
(1 2 3)

That said, if you use `some` with a proper predicate as you did, then
its safe to use it as a predicate, too.  The fact that it returns nil
instead of false is an implementation detail, but nil is as falsy as
false, so who cares...

Bye,
Tassilo

-- 
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: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Jacobo Polavieja
Thank you both! I had the epiphany now and realized it is what you both 
stated. But you had already answered! So quick :).

I think I've tried too run too much and have read through too fast. All 
morning setting up Clojure and learning Clojure. It's fun but my brain may 
now need some rest...

Thanks!

-- 
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: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Jim - FooBar();
you can always make your own with a little macro but if you just started 
learning today you may want to stick with some...


I, like you, wanted a version that returns true or false a couple of 
months ago.. here it is:


(defmacro in?
 "Returns true if colle contains elm, false otherwise."
 [colle elm]
`(if (some #{~elm} ~colle) true false))

Hope that helps...notice this is a macro not a function - the call to 
in? will expand at compile time into the body of the macro...in other 
words you've just created some new syntax!


Jim




On 14/06/12 16:31, Jacobo Polavieja wrote:

Hi!

I've just started learning Clojure today. I've started reading 
"Clojure - Functional Programming for the JVM" 
(http://java.ociweb.com/mark/clojure/article.html 
).


Anyway, on the collections part 
(http://java.ociweb.com/mark/clojure/article.html#Collections) it 
called my attention that 'some' returns "nil" instead of "false". The 
examples given (being stooges a vector of Strings) are:


(not-every? #(instance? String %) stooges) ; -> false
(some #(instance? Number %) stooges) ; -> nil

Is there a reason why (some) doesn't return false also? I've read 
through the doc but as I supposed, there's no explanation about the 
reasoning behind it.


Thanks!
--
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 


--
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: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread David Nolen
Definitely something that should not written as a macro :)

David

On Thu, Jun 14, 2012 at 1:14 PM, Jim - FooBar(); wrote:

>  you can always make your own with a little macro but if you just started
> learning today you may want to stick with some...
>
> I, like you, wanted a version that returns true or false a couple of
> months ago.. here it is:
>
> (defmacro in?
>  "Returns true if colle contains elm, false otherwise."
>  [colle elm]
> `(if (some #{~elm} ~colle) true false))
>
> Hope that helps...notice this is a macro not a function - the call to in?
> will expand at compile time into the body of the macro...in other words
> you've just created some new syntax!
>
> Jim
>
>
>
>
>
> On 14/06/12 16:31, Jacobo Polavieja wrote:
>
> Hi!
>
>  I've just started learning Clojure today. I've started reading "Clojure
> - Functional Programming for the JVM" (
> http://java.ociweb.com/mark/clojure/article.html
> ).
>
>  Anyway, on the collections part (
> http://java.ociweb.com/mark/clojure/article.html#Collections) it called
> my attention that 'some' returns "nil" instead of "false". The examples
> given (being stooges a vector of Strings) are:
>
>  (not-every? #(instance? String %) stooges) ; -> false
> (some #(instance? Number %) stooges) ; -> nil
>
>  Is there a reason why (some) doesn't return false also? I've read
> through the doc but as I supposed, there's no explanation about the
> reasoning behind it.
>
>  Thanks!
> --
> 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
>
>
>  --
> 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
>

-- 
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: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Jim - FooBar();

I don't see why not if you really really need to return true/false...
Of course as Tassilo said nil is falsey so it is unlikely that you would 
ever need to do that...


Jim

On 14/06/12 18:16, David Nolen wrote:

Definitely something that should not written as a macro :)

David

On Thu, Jun 14, 2012 at 1:14 PM, Jim - FooBar(); > wrote:


you can always make your own with a little macro but if you just
started learning today you may want to stick with some...

I, like you, wanted a version that returns true or false a couple
of months ago.. here it is:

(defmacro in?
 "Returns true if colle contains elm, false otherwise."
 [colle elm]
`(if (some #{~elm} ~colle) true false))

Hope that helps...notice this is a macro not a function - the call
to in? will expand at compile time into the body of the macro...in
other words you've just created some new syntax!

Jim





On 14/06/12 16:31, Jacobo Polavieja wrote:

Hi!

I've just started learning Clojure today. I've started reading
"Clojure - Functional Programming for the JVM"
(http://java.ociweb.com/mark/clojure/article.html
).

Anyway, on the collections part
(http://java.ociweb.com/mark/clojure/article.html#Collections) it
called my attention that 'some' returns "nil" instead of "false".
The examples given (being stooges a vector of Strings) are:

(not-every? #(instance? String %) stooges) ; -> false
(some #(instance? Number %) stooges) ; -> nil

Is there a reason why (some) doesn't return false also? I've read
through the doc but as I supposed, there's no explanation about
the reasoning behind it.

Thanks!
-- 
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 


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


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


--
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: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread nicolas.o...@gmail.com
>> (defmacro in?
>>  "Returns true if colle contains elm, false otherwise."
>>  [colle elm]
>> `(if (some #{~elm} ~colle) true false))

Yes. Should not be a macro. (There is no reason for it to be a macro).
On top of that, it is not very often useful to convert nil to false as
clojure understands nil/not-nil as false/true everywhere.
(Someone corrects me if there is a counter example.)

Might be useful for java interop?
Then I would define a
(defn to-bool [x]
   (if x true false))
and use it when necessary.

-- 
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: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread nicolas.o...@gmail.com
On Thu, Jun 14, 2012 at 6:19 PM, Jim - FooBar(); wrote:

>  I don't see why not if you really really need to return true/false...
>

Because it can be written as a function. Macro are only for things that
cannot be easily written as functions.
(And then it should be backed by functions that are usable but less
convenient.)
(That is the general theory. There might be exceptional situation where
macro are better. )

-- 
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: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Jim - FooBar();

On 14/06/12 18:20, nicolas.o...@gmail.com wrote:

(defn to-bool [x]
   (if x true false))
and use it when necessary.


why add the extra overhead of potentially boxing/unboxing x in such a 
simple case? Its not like the macro is getting out of control...Its a 
one liner...


Jim

--
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: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread nicolas.o...@gmail.com
>
>
>> why add the extra overhead of potentially boxing/unboxing x in such a
> simple case? Its not like the macro is getting out of control...Its a one
> liner...
>
> Because functions are first class and not macros.
Ex:

(map to-bool l)

-- 
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: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread Phil Hagelberg
On Wed, Jun 13, 2012 at 8:01 PM, David Della Costa
 wrote:
> I also think that, at present, while coming in through Leiningen is
> definitely the most painless way to do things (I'm really loving it
> actually, as a Ruby dev it kind of seems like rvm + bundler + rake all
> wrapped up in one handy package), trying to navigate whether to use
> 1.x or 2.x preview is a bit confusing--and the variety of docs
> available for setting things up is confusing.

Yeah, as of the last release we're pretty much advising everyone to go
with 2.x, but the docs still need to be updated to reflect that. What
are some of the confusing docs you mention? Most people have said the
install process is pretty simple.

> Similarly, it's easy to
> get lost (as a beginner) between namespace issues with packages and
> how to set things up properly with Leiningen.  It'd be good to have
> some documentation on that.

Maybe if the Leiningen tutorial linked to
http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html?

> All of that said, maybe I'll take a look at the docs and see if I can
> add anything constructive, since I've set it up now a few times on
> Macs.

That would be great; thanks. We could also use some help improving
http://leiningen.org; it's pretty messy right now.

-Phil

-- 
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: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Jim - FooBar();
I  have a functionize macro if I ever want to do that with a macro but I 
think we are getting off topic here...
all I'm saying is that if I want to keep a loop very tight and want to 
perform a couple of checks inline, why clutter the body of the loop  
with 'if's or 'some's or whatever...you want to keep it readable but 
inlined at the same time...functions deal with Object don't they? I do 
agree on all the points made here and I am indeed very careful with my 
macros...


Jim

On 14/06/12 18:26, nicolas.o...@gmail.com wrote:



why add the extra overhead of potentially boxing/unboxing x in
such a simple case? Its not like the macro is getting out of
control...Its a one liner...

Because functions are first class and not macros.
Ex:

(map to-bool l)

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


--
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: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Tassilo Horn
"Jim - FooBar();"  writes:

> (defmacro in?
>  "Returns true if colle contains elm, false otherwise."
>  [colle elm]
> `(if (some #{~elm} ~colle) true false))

Except for the complains that this doesn't need to be a macro (which I
agree with), it is also wrong.

  user> (in? [nil false] nil)
  false
  user> (in? [nil false] false)
  false

Bye,
Tassilo

-- 
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: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Jim - FooBar();

nice catch and point taken...

however the exact same thing would happen if this was a function...it's 
just wrong !


Jim


On 14/06/12 19:32, Tassilo Horn wrote:

"Jim - FooBar();"  writes:


(defmacro in?
  "Returns true if colle contains elm, false otherwise."
  [colle elm]
`(if (some #{~elm} ~colle) true false))

Except for the complains that this doesn't need to be a macro (which I
agree with), it is also wrong.

   user>  (in? [nil false] nil)
   false
   user>  (in? [nil false] false)
   false

Bye,
Tassilo



--
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: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Stuart Halloway
(doc boolean)

Cheers,
Stu

Stuart Halloway
Clojure/core
http://clojure.com

> >> (defmacro in?
> >>  "Returns true if colle contains elm, false otherwise."
> >>  [colle elm] 
> >> `(if (some #{~elm} ~colle) true false))
> 
> Yes. Should not be a macro. (There is no reason for it to be a macro).
> On top of that, it is not very often useful to convert nil to false as 
> clojure understands nil/not-nil as false/true everywhere.
> (Someone corrects me if there is a counter example.)
> 
> Might be useful for java interop?
> Then I would define a 
> (defn to-bool [x]
>(if x true false))
> and use it when necessary.

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

2012-06-14 Thread Rich Hickey
No, you are not allowed to reproduce the Clojure logo and put it up for sale.

I'd be happy to set up an official way to get stickers/shirts etc.

Rich


On Jun 11, 2012, at 6:23 PM, Sven Johansson wrote:

> I've been trawling the internet for Clojure stickers before and 
> come up empty. If there's really and truly nowhere to get these 
> online, I'll have it done before the end of the week and put it up 
> for order via whatever international order t-shirt/paraphernalia 
> online-shop that seems to work best. 
> 
> But... what about copyright and this kind of use? Am I actually
> allowed to reproduce the Clojure logo and put it up for sale on a 
> commercial site?
> 
> -- 
> Sven Johansson
> Twitter: @svjson
> 
> On Mon, Jun 11, 2012 at 11:11 PM, Joseph Smith  wrote:
> Me too!
> 
> ---
> Joseph Smith
> j...@uwcreations.com
> @solussd
> 
> 
> On Jun 11, 2012, at 2:08 PM, Christian Guimaraes  
> wrote:
> 
>> I'm interested also...
>> 
>> On Sun, Jun 10, 2012 at 2:03 AM, aboy021  wrote:
>> Is there anywhere that I can get a Clojure sticker? 
> 
> -- 
> 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

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

2012-06-14 Thread Sean Neilan
I'd buy one.

On Thu, Jun 14, 2012 at 1:52 PM, Rich Hickey  wrote:

> No, you are not allowed to reproduce the Clojure logo and put it up for
> sale.
>
> I'd be happy to set up an official way to get stickers/shirts etc.
>
> Rich
>
>
> On Jun 11, 2012, at 6:23 PM, Sven Johansson wrote:
>
> > I've been trawling the internet for Clojure stickers before and
> > come up empty. If there's really and truly nowhere to get these
> > online, I'll have it done before the end of the week and put it up
> > for order via whatever international order t-shirt/paraphernalia
> > online-shop that seems to work best.
> >
> > But... what about copyright and this kind of use? Am I actually
> > allowed to reproduce the Clojure logo and put it up for sale on a
> > commercial site?
> >
> > --
> > Sven Johansson
> > Twitter: @svjson
> >
> > On Mon, Jun 11, 2012 at 11:11 PM, Joseph Smith 
> wrote:
> > Me too!
> >
> > ---
> > Joseph Smith
> > j...@uwcreations.com
> > @solussd
> >
> >
> > On Jun 11, 2012, at 2:08 PM, Christian Guimaraes <
> cguimaraes...@gmail.com> wrote:
> >
> >> I'm interested also...
> >>
> >> On Sun, Jun 10, 2012 at 2:03 AM, aboy021 
> wrote:
> >> Is there anywhere that I can get a Clojure sticker?
> >
> > --
> > 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
>
> --
> 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

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

2012-06-14 Thread Joseph Smith
Excellent. I'd like a sticker for my notebook. :)

---
Joseph Smith
j...@uwcreations.com
@solussd


On Jun 14, 2012, at 11:52 AM, Rich Hickey  wrote:

> No, you are not allowed to reproduce the Clojure logo and put it up for sale.
> 
> I'd be happy to set up an official way to get stickers/shirts etc.
> 
> Rich
> 
> 
> On Jun 11, 2012, at 6:23 PM, Sven Johansson wrote:
> 
>> I've been trawling the internet for Clojure stickers before and 
>> come up empty. If there's really and truly nowhere to get these 
>> online, I'll have it done before the end of the week and put it up 
>> for order via whatever international order t-shirt/paraphernalia 
>> online-shop that seems to work best. 
>> 
>> But... what about copyright and this kind of use? Am I actually
>> allowed to reproduce the Clojure logo and put it up for sale on a 
>> commercial site?
>> 
>> -- 
>> Sven Johansson
>> Twitter: @svjson
>> 
>> On Mon, Jun 11, 2012 at 11:11 PM, Joseph Smith  wrote:
>> Me too!
>> 
>> ---
>> Joseph Smith
>> j...@uwcreations.com
>> @solussd
>> 
>> 
>> On Jun 11, 2012, at 2:08 PM, Christian Guimaraes  
>> wrote:
>> 
>>> I'm interested also...
>>> 
>>> On Sun, Jun 10, 2012 at 2:03 AM, aboy021  wrote:
>>> Is there anywhere that I can get a Clojure sticker? 
>> 
>> -- 
>> 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
> 
> -- 
> 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

-- 
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: Clojurescript (latest) advanced mode compilation => java.lang.ClassCastException ?

2012-06-14 Thread David Nolen
Thank you! http://dev.clojure.org/jira/browse/CLJS-315

On Thu, Jun 14, 2012 at 6:43 AM, Dave Sann  wrote:

> I (think) I have tracked it down to the following section of code from
> jayq.core (simplified)
>
> ---
>
> (ns jayq.core)
>
> (extend-type js/jQuery
>   IIndexed
>   (-nth [this n]
> (when (< n (count this))
>   (.slice this n (inc n
>   (-nth [this n not-found]
> (if (< n (count this))
>   (.slice this n (inc n))
>   (if (undefined? not-found)
> nil
> not-found)))
>
>   ILookup
>   (-lookup
> ([this k]
>(or (.slice this k (inc k)) nil))
> ([this k not-found]
>(-nth this k not-found) ; < here if I
> comment and replace with 1 this will compile in advanced mode.
>;1
>))
>   )
>
> ---
>
> if I compile this in simple mode - it is ok.
> In advanced, I get the following stack trace:
>
> java.lang.ClassCastException: java.lang.String cannot be cast to
> clojure.lang.Named
> at clojure.core$namespace.invoke(core.clj:1497)
> at cljs.compiler$resolve_existing_var.invoke(compiler.clj:110)
> at cljs.compiler$eval1054$fn__1056.invoke(compiler.clj:716)
> at clojure.lang.MultiFn.invoke(MultiFn.java:163)
> at cljs.compiler$emit_block.invoke(compiler.clj:333)
> at cljs.compiler$emit_fn_method.invoke(compiler.clj:512)
> at cljs.compiler$eval952$fn__954.invoke(compiler.clj:573)
> at clojure.lang.MultiFn.invoke(MultiFn.java:163)
> at cljs.compiler$emits.doInvoke(compiler.clj:232)
> at clojure.lang.RestFn.invoke(RestFn.java:436)
> at cljs.compiler$eval1089$fn__1091.invoke(compiler.clj:791)
> at clojure.lang.MultiFn.invoke(MultiFn.java:163)
> at cljs.compiler$emit_block.invoke(compiler.clj:333)
> at cljs.compiler$eval996$fn__998.invoke(compiler.clj:633)
> at clojure.lang.MultiFn.invoke(MultiFn.java:163)
> at cljs.compiler$compile_file_STAR_.invoke(compiler.clj:1668)
> at cljs.compiler$compile_file.invoke(compiler.clj:1705)
> at cljs.compiler$compile_root.invoke(compiler.clj:1766)
> at cljs.closure$compile_dir.invoke(closure.clj:364)
> at cljs.closure$eval1981$fn__1982.invoke(closure.clj:396)
> at cljs.closure$eval1910$fn__1911$G__1901__1918.invoke(closure.clj:266)
> at cljs.closure$eval1968$fn__1969.invoke(closure.clj:410)
> at cljs.closure$eval1910$fn__1911$G__1901__1918.invoke(closure.clj:266)
> at cljs.closure$build.invoke(closure.clj:874)
> at user$compile_cljs.invoke(NO_SOURCE_FILE:273)
> at user$cljs_build.invoke(NO_SOURCE_FILE:284)
> at clojure.lang.AFn.applyToHelper(AFn.java:167)
> at clojure.lang.AFn.applyTo(AFn.java:151)
> at clojure.core$apply.invoke(core.clj:605)
> at clojure.core$partial$fn__4072.doInvoke(core.clj:2345)
> at clojure.lang.RestFn.invoke(RestFn.java:408)
> at user$changed_fn$fn__2184.invoke(NO_SOURCE_FILE:88)
> at user$watch.invoke(NO_SOURCE_FILE:103)
> at user$main$fn__2271.invoke(NO_SOURCE_FILE:387)
> at clojure.core$binding_conveyor_fn$fn__3989.invoke(core.clj:1819)
> at clojure.lang.AFn.call(AFn.java:18)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:662)
>
>
>
>
>
> On Thursday, 14 June 2012 18:28:56 UTC+10, Dave Sann wrote:
>>
>> It may take some time. I'll see what I can do.
>>
>> D
>>
>>
>> On Thursday, 14 June 2012 00:09:49 UTC+10, David Nolen wrote:
>>>
>>> Does this problem only occur on a specific project? Can you create a
>>> minimal reproducible case?
>>>
>>> Thanks,
>>> David
>>>
>>> On Wed, Jun 13, 2012 at 7:54 AM,
>>>
 So far I can only confirm the following.

 It does not occur if I revert to commit **
 7b6678bead5a0733d0388ddaa4e78e**714b9d6187 but does from **
 e959e0205a4b42a099c120a7742731**4d288c965b (Merge branch
 'cljs-305-proto-inline') onward.

 I have been unable to get a stacktrace with the exception - So at the
 moment I really don't know why this is occurring.

 If I find out more I will report it.

 Otherwise - I am keen to know if anyone else sees a similar problem.

 D


 On Tuesday, 12 June 2012 22:51:39 UTC+10, David Nolen wrote:

> That ticket has been resolved.
>
> For your own issue, more details required. If you can isolate it, open
> a ticket.
>
> David
>
> On Tue, Jun 12, 2012 at 8:16 AM,
>
>> I have started seeing java.lang.ClassCastException when compiling in
>> advanced mode.
>>
>> Compilation is fine with simple optimisations.
>>
>> This happens with source code that previously did not complain...
>>
>> I am wondering if this might be related to :
>>
>> https://groups.google.com/d/**to**pic/clojure/NHIzoUz0wmc/**discus**
>> sion

Re: Clojure Sticker

2012-06-14 Thread Sven Johansson
On Thu, Jun 14, 2012 at 8:52 PM, Rich Hickey  wrote:

> No, you are not allowed to reproduce the Clojure logo and put it up for
> sale.
>
> I'd be happy to set up an official way to get stickers/shirts etc.
>
>
Thanks - that'd be much preferable!

Regards/Sven

-- 
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: Type hint for vector element?

2012-06-14 Thread Aaron Cohen
On Wed, Jun 13, 2012 at 8:22 PM, Warren Lynn  wrote:
> It is very common for all elements in a vector to be always of the same
> type. Is there any way to hint the type to Clojure? Does such hint can even
> improve performance? Thank you.
>

In general, not through type hints. However, there are implementations
of vector for primitive types, accessed using the "vector-of"
constructor function.
(http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/vector-of)

These are at least more space efficient, I'm not sure how they compare
performance-wise.

--Aaron

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

2012-06-14 Thread Aaron Cohen
On Thu, Jun 14, 2012 at 2:52 PM, Rich Hickey  wrote:
> No, you are not allowed to reproduce the Clojure logo and put it up for sale.
>
> I'd be happy to set up an official way to get stickers/shirts etc.
>
> Rich

I just wanted to mention that the American Apparel t-shirt that was
given out at Clojure/conj last year is still one of my favorite
t-shirts.

--Aaron

-- 
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: IllegalStateException "I/O in transaction" in REPL

2012-06-14 Thread dmirylenka
Could you please explain a bit more?

I don't have any dosync in my code.

Daniil

On Thursday, June 14, 2012 4:17:46 PM UTC+2, Meikel Brandmeyer (kotarak) 
wrote:
>
> Hi,
>
> the exception probably stems from the fact that you do the database 
> interaction inside a dosync transaction.
>
> Kind regards
> Meikel
>
>

-- 
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: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread fenton
I like the idea of taking care of copyright properly, thanks Sean for the 
links to those pages.  I think the black and white split, docs = 
confluence, code = github, is not so good.  I think John's point about the 
*.md files being a very good place for documentation.  I think the right 
way to do the documentation is like this:

1 - github with *.md.
2 - take care of copyright like you are now.
3 - have a trusted person be the owner of the repo...Phil/Sean or someone 
else like that.
4 - let folks clone, edit and then send pull requests back to the site 
owner.

my personal approach would be to give commit access to whoever seemed 
reasonable, though I know that freaks some people out.

I'm not going to give up the wonderful prettiness that github does with a 
line like:

```clojure
(defn myfunc [x] (+ 2 x))
```

which i can't do with confluence.  This group is about a programming 
language, nice colorizing is really great for documentation.

I think having directed tutorials one for each of mac/linux/windows.  Then 
these tutorials should go start to finish with the canonical implementation 
for that platform.  Yes emacs is very weird for newbies, but most 
clojurians use it.  There are reasons why they use it, and as long as we 
can have good docs around these things, then its okay.  It's like 
standardization.  I can sympathize with the concept of only teaching one 
thing at a time.  I totally agree with that.  But I also am not a big fan 
of teaching people something that they'd then throw away.

If anyone wants commit permissions to my repo, just send me your github 
name, and I'll add u.  I'd prefer that the clojure community took up some 
documentation inside of github with *.md files and that repo used instead, 
obviously tho.

Cheers.

On Thursday, June 14, 2012 10:31:44 AM UTC-7, Phil Hagelberg wrote:
>
> On Wed, Jun 13, 2012 at 8:01 PM, David Della Costa 
>  wrote: 
> > I also think that, at present, while coming in through Leiningen is 
> > definitely the most painless way to do things (I'm really loving it 
> > actually, as a Ruby dev it kind of seems like rvm + bundler + rake all 
> > wrapped up in one handy package), trying to navigate whether to use 
> > 1.x or 2.x preview is a bit confusing--and the variety of docs 
> > available for setting things up is confusing. 
>
> Yeah, as of the last release we're pretty much advising everyone to go 
> with 2.x, but the docs still need to be updated to reflect that. What 
> are some of the confusing docs you mention? Most people have said the 
> install process is pretty simple. 
>
> > Similarly, it's easy to 
> > get lost (as a beginner) between namespace issues with packages and 
> > how to set things up properly with Leiningen.  It'd be good to have 
> > some documentation on that. 
>
> Maybe if the Leiningen tutorial linked to 
>
> http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html?
>  
>
>
> > All of that said, maybe I'll take a look at the docs and see if I can 
> > add anything constructive, since I've set it up now a few times on 
> > Macs. 
>
> That would be great; thanks. We could also use some help improving 
> http://leiningen.org; it's pretty messy right now. 
>
> -Phil 
>

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

2012-06-14 Thread Bruce Durling
Rich,

On Thu, Jun 14, 2012 at 7:52 PM, Rich Hickey  wrote:
> No, you are not allowed to reproduce the Clojure logo and put it up for sale.
>
> I'd be happy to set up an official way to get stickers/shirts etc.

+1 for being able to buy an official one.

cheers,
Bruce

-- 
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: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Walter Tetzner

On Thursday, June 14, 2012 8:09:50 AM UTC-4, Jim foo.bar wrote:
>
> It has to be 'do' instead of 'doto'... 
>

Well, if you want to be able to use doto, you could do something like

(doto foo
  (.bar x)
  (.baz y)
  (#(dotimes [i 10] (.zab % 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: Clojure Sticker

2012-06-14 Thread Jason Lewis
I, for one, would be happy to collaborate on an open-source Clojure
ecommerce app, if it meant Rich would sell us stickers sooner.

(only half joking)

Jason
On Jun 14, 2012 5:33 PM, "Bruce Durling"  wrote:

> Rich,
>
> On Thu, Jun 14, 2012 at 7:52 PM, Rich Hickey  wrote:
> > No, you are not allowed to reproduce the Clojure logo and put it up for
> sale.
> >
> > I'd be happy to set up an official way to get stickers/shirts etc.
>
> +1 for being able to buy an official one.
>
> cheers,
> Bruce
>
> --
> 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

-- 
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: IllegalStateException "I/O in transaction" in REPL

2012-06-14 Thread Meikel Brandmeyer
Hi,

Am 14.06.2012 um 22:33 schrieb dmirylenka:

> Could you please explain a bit more?
> 
> I don't have any dosync in my code.

transaction* contains an io! form which throws such an exception when called in 
a dosync. How does the code look like, which does not work?

Kind regards
Meikel

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

2012-06-14 Thread Jim - FooBar();

On 14/06/12 19:52, Rich Hickey wrote:

I'd be happy to set up an official way to get stickers/shirts etc.


zazzle.com sells t-shirts already...not sure whether its legit or not 
though...


Jim

--
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: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Andy Fingerhut

On Jun 14, 2012, at 7:59 AM, Jim - FooBar(); wrote:

> well, no... :-) 
> 
> Jim
> 
> On 14/06/12 15:52, David Nolen wrote:
>> 
>> On Thu, Jun 14, 2012 at 10:39 AM, Jim - FooBar();  
>> wrote:
>> Evaluates x then calls all of the methods and functions with the
>>  value of x supplied at the front of the given arguments
>> 
>> that's in the docstring for doto. but dotimes is not a method or a function 
>> is it? :)

David, I think that Jim's point is that dotimes is a macro, not a method or a 
function, and yet the dotimes form is still being "modified" by doto before it 
is compiled and executed.

The current documentation for doto says it does this for "methods and 
functions", but does not mention macros, which could lead one to infer 
(incorrectly) that doto does *not* make such modifications to macro invocations.

I suspect Jim's concern would be addressed if the documentation for doto were 
made more accurate, e.g. in the sentence:

"Evaluates x then calls all of the methods and functions with the value of x 
supplied at the front of the given arguments."

replace the phrase "calls all of the methods and functions" with something like 
"evaluates all forms"

Andy

-- 
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: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Jim - FooBar();
why not even go a bit further and add a tiny warning with regards to 
evaluating macros as well? I mean I don't know about you guys but I've 
not been 'burned' before when trying to use macros inside macros and the 
error message is not immediately obvious what it means...it does say 
that the arguments should be in binding vector but it took me a good 10 
min to realise what is happening


anyway there are little pockets of clojure wisdom all over the place and 
I think it would be best having a 'common traps and pitfalls' somewhere 
centrally...


Jim

On 15/06/12 00:02, Andy Fingerhut wrote:


On Jun 14, 2012, at 7:59 AM, Jim - FooBar(); wrote:


well, no... :-)

Jim

On 14/06/12 15:52, David Nolen wrote:
On Thu, Jun 14, 2012 at 10:39 AM, Jim - FooBar(); 
mailto:jimpil1...@gmail.com>> wrote:


Evaluates x then calls all of the methods and functions with the
 value of x supplied at the front of the given arguments


that's in the docstring for doto. but dotimes is not a method or a 
function is it? :)


David, I think that Jim's point is that dotimes is a macro, not a 
method or a function, and yet the dotimes form is still being 
"modified" by doto before it is compiled and executed.


The current documentation for doto says it does this for "methods and 
functions", but does not mention macros, which could lead one to 
infer (incorrectly) that doto does *not* make such modifications to 
macro invocations.


I suspect Jim's concern would be addressed if the documentation for 
doto were made more accurate, e.g. in the sentence:


"Evaluates x then calls all of the methods and functions with 
the value of x supplied at the front of the given arguments."


replace the phrase "calls all of the methods and functions" with 
something like "evaluates all forms"


Andy

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


--
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: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread Phil Hagelberg
On Thu, Jun 14, 2012 at 2:09 PM, fenton  wrote
> I'm not going to give up the wonderful prettiness that github does with a
> line like:
>
> ```clojure
> (defn myfunc [x] (+ 2 x))
> ```
>
> which i can't do with confluence.  This group is about a programming
> language, nice colorizing is really great for documentation.

Hmm... while I agree that Confluence is bad for this sort of thing, I
don't see the Clojure maintainers changing their mind and accepting
pull requests since they've been pretty staunchly opposed to them for
ages.

However, I would be perfectly happy moving the "Getting Started with
Emacs" tutorial into the clojure-mode repository and changing the
Confluence wiki page to point to there. The "Getting Started with
Leiningen" page already points off to Github, and I think we're likely
to get higher quality contributions that way. I'll put it on my todo
list, but if you're interested in helping a pull request would make it
happen more quickly.

thanks,
Phil

-- 
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: Using read-string and macros together

2012-06-14 Thread Stephen Compall
On Thu, 2012-06-14 at 00:49 -0700, Rob Harrop wrote:
> I had almost resigned myself to that fact that this would require eval, but 
> I wanted to exhaust all macro options first.

As a compromise, you might consider a limited evaluator, such as used by
#=, or a sandboxed evaluator, such as the IRC bots use.

-- 
Stephen Compall
^aCollection allSatisfy: [:each|aCondition]: less is better


-- 
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: IllegalStateException "I/O in transaction" in REPL

2012-06-14 Thread Stephen Compall
On Thu, 2012-06-14 at 13:33 -0700, dmirylenka wrote:
> Could you please explain a bit more?
> 
> I don't have any dosync in my code.

Look through your backtrace for a call to
clojure.lang.LockingTransaction.runInTransaction.  Its caller is using
dosync.


-- 
Stephen Compall
^aCollection allSatisfy: [:each|aCondition]: less is better

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


ANN: lambic v. 0.1.0

2012-06-14 Thread Robert Levy
This announcement is more of a call for suggestions (even pull requests if
you are moved to do so) as there's not much to it yet, just enough to to
demonstrate the concept for simpler transformations.  I'm thinking of how
best to go about supporting a wider range of sequence transformations.

https://github.com/rplevy/lambic
https://clojars.org/lambic

The basic idea is that languages like Prolog are very good at manipulating
sequences "by example" based on pattern matching, and that using core.match
this can become the norm for Clojure too (either using this library or some
other I don't yet know about.)

In Clojure, when you encounter data that matches pattern X and you want to
systematically turn into data of the form Y, depending on how complex the
structures are, you tend to start with some solution, change it around, and
ultimately end up with a very elegant solution that is clearly the "best
way".

My present take on how to implement lambic is essentially to catalog these
"best ways" for a number of different classes of sequence transformations,
so that lambic knows what to do with them.  What do you think of this idea?
 Is there a way to use logical magic (magical logic?) to do something
better? ;)

-- 
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: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Andy Fingerhut
I highly recommend clojuredocs.org for adding examples of pitfalls/traps.  I've 
added several there myself, e.g. for clojure.core/future (and also 
clojure.core/pmap, clojure.java.shell/sh):

http://clojuredocs.org/clojure_core/clojure.core/future

It takes only a few minutes to do so.

Andy


On Jun 14, 2012, at 4:09 PM, Jim - FooBar(); wrote:

> why not even go a bit further and add a tiny warning with regards to 
> evaluating macros as well? I mean I don't know about you guys but I've not 
> been 'burned' before when trying to use macros inside macros and the error 
> message is not immediately obvious what it means...it does say that the 
> arguments should be in binding vector but it took me a good 10 min to realise 
> what is happening
> 
> anyway there are little pockets of clojure wisdom all over the place and I 
> think it would be best having a 'common traps and pitfalls' somewhere 
> centrally...
> 
> Jim
> 
> On 15/06/12 00:02, Andy Fingerhut wrote:
>> 
>> 
>> On Jun 14, 2012, at 7:59 AM, Jim - FooBar(); wrote:
>> 
>>> well, no... :-) 
>>> 
>>> Jim
>>> 
>>> On 14/06/12 15:52, David Nolen wrote:
 
 On Thu, Jun 14, 2012 at 10:39 AM, Jim - FooBar();  
 wrote:
 Evaluates x then calls all of the methods and functions with the
  value of x supplied at the front of the given arguments
 
 that's in the docstring for doto. but dotimes is not a method or a 
 function is it? :)
>> 
>> David, I think that Jim's point is that dotimes is a macro, not a method or 
>> a function, and yet the dotimes form is still being "modified" by doto 
>> before it is compiled and executed.
>> 
>> The current documentation for doto says it does this for "methods and 
>> functions", but does not mention macros, which could lead one to infer 
>> (incorrectly) that doto does *not* make such modifications to macro 
>> invocations.
>> 
>> I suspect Jim's concern would be addressed if the documentation for doto 
>> were made more accurate, e.g. in the sentence:
>> 
>> "Evaluates x then calls all of the methods and functions with the value of x 
>> supplied at the front of the given arguments."
>> 
>> replace the phrase "calls all of the methods and functions" with something 
>> like "evaluates all forms"
>> 
>> Andy
>> 
>> -- 
>> 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
> 
> 
> -- 
> 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

-- 
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: Clojurescript (latest) advanced mode compilation => java.lang.ClassCastException ?

2012-06-14 Thread David Nolen
This should be resolved in master - please let us know if you continue to
run into problems.

On Thu, Jun 14, 2012 at 3:06 PM, David Nolen  wrote:

> Thank you! http://dev.clojure.org/jira/browse/CLJS-315
>
>
> On Thu, Jun 14, 2012 at 6:43 AM, Dave Sann  wrote:
>
>> I (think) I have tracked it down to the following section of code from
>> jayq.core (simplified)
>>
>> ---
>>
>> (ns jayq.core)
>>
>> (extend-type js/jQuery
>>   IIndexed
>>   (-nth [this n]
>> (when (< n (count this))
>>   (.slice this n (inc n
>>   (-nth [this n not-found]
>> (if (< n (count this))
>>   (.slice this n (inc n))
>>   (if (undefined? not-found)
>> nil
>> not-found)))
>>
>>   ILookup
>>   (-lookup
>> ([this k]
>>(or (.slice this k (inc k)) nil))
>> ([this k not-found]
>>(-nth this k not-found) ; < here if I
>> comment and replace with 1 this will compile in advanced mode.
>>;1
>>))
>>   )
>>
>> ---
>>
>> if I compile this in simple mode - it is ok.
>> In advanced, I get the following stack trace:
>>
>> java.lang.ClassCastException: java.lang.String cannot be cast to
>> clojure.lang.Named
>> at clojure.core$namespace.invoke(core.clj:1497)
>> at cljs.compiler$resolve_existing_var.invoke(compiler.clj:110)
>>  at cljs.compiler$eval1054$fn__1056.invoke(compiler.clj:716)
>> at clojure.lang.MultiFn.invoke(MultiFn.java:163)
>> at cljs.compiler$emit_block.invoke(compiler.clj:333)
>>  at cljs.compiler$emit_fn_method.invoke(compiler.clj:512)
>> at cljs.compiler$eval952$fn__954.invoke(compiler.clj:573)
>>  at clojure.lang.MultiFn.invoke(MultiFn.java:163)
>> at cljs.compiler$emits.doInvoke(compiler.clj:232)
>> at clojure.lang.RestFn.invoke(RestFn.java:436)
>>  at cljs.compiler$eval1089$fn__1091.invoke(compiler.clj:791)
>> at clojure.lang.MultiFn.invoke(MultiFn.java:163)
>> at cljs.compiler$emit_block.invoke(compiler.clj:333)
>>  at cljs.compiler$eval996$fn__998.invoke(compiler.clj:633)
>> at clojure.lang.MultiFn.invoke(MultiFn.java:163)
>> at cljs.compiler$compile_file_STAR_.invoke(compiler.clj:1668)
>>  at cljs.compiler$compile_file.invoke(compiler.clj:1705)
>> at cljs.compiler$compile_root.invoke(compiler.clj:1766)
>>  at cljs.closure$compile_dir.invoke(closure.clj:364)
>> at cljs.closure$eval1981$fn__1982.invoke(closure.clj:396)
>> at cljs.closure$eval1910$fn__1911$G__1901__1918.invoke(closure.clj:266)
>>  at cljs.closure$eval1968$fn__1969.invoke(closure.clj:410)
>> at cljs.closure$eval1910$fn__1911$G__1901__1918.invoke(closure.clj:266)
>>  at cljs.closure$build.invoke(closure.clj:874)
>> at user$compile_cljs.invoke(NO_SOURCE_FILE:273)
>> at user$cljs_build.invoke(NO_SOURCE_FILE:284)
>>  at clojure.lang.AFn.applyToHelper(AFn.java:167)
>> at clojure.lang.AFn.applyTo(AFn.java:151)
>> at clojure.core$apply.invoke(core.clj:605)
>>  at clojure.core$partial$fn__4072.doInvoke(core.clj:2345)
>> at clojure.lang.RestFn.invoke(RestFn.java:408)
>> at user$changed_fn$fn__2184.invoke(NO_SOURCE_FILE:88)
>>  at user$watch.invoke(NO_SOURCE_FILE:103)
>> at user$main$fn__2271.invoke(NO_SOURCE_FILE:387)
>> at clojure.core$binding_conveyor_fn$fn__3989.invoke(core.clj:1819)
>>  at clojure.lang.AFn.call(AFn.java:18)
>> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>>  at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>  at java.lang.Thread.run(Thread.java:662)
>>
>>
>>
>>
>>
>> On Thursday, 14 June 2012 18:28:56 UTC+10, Dave Sann wrote:
>>>
>>> It may take some time. I'll see what I can do.
>>>
>>> D
>>>
>>>
>>> On Thursday, 14 June 2012 00:09:49 UTC+10, David Nolen wrote:

 Does this problem only occur on a specific project? Can you create a
 minimal reproducible case?

 Thanks,
 David

 On Wed, Jun 13, 2012 at 7:54 AM,

> So far I can only confirm the following.
>
> It does not occur if I revert to commit **
> 7b6678bead5a0733d0388ddaa4e78e**714b9d6187 but does from **
> e959e0205a4b42a099c120a7742731**4d288c965b (Merge branch
> 'cljs-305-proto-inline') onward.
>
> I have been unable to get a stacktrace with the exception - So at the
> moment I really don't know why this is occurring.
>
> If I find out more I will report it.
>
>  Otherwise - I am keen to know if anyone else sees a similar problem.
>
> D
>
>
> On Tuesday, 12 June 2012 22:51:39 UTC+10, David Nolen wrote:
>
>> That ticket has been resolved.
>>
>> For your own issue, more details required. If you can isolate it,
>> open a ticket.
>>
>> David
>>
>> On Tue, Jun 12, 2012 at 8:16 AM,
>>
>>> I have started seeing java.lang.ClassCastException when compiling in
>>> advanced mode.
>>>
>

Re: ANN: lambic v. 0.1.0

2012-06-14 Thread kovas boguta
Very cool!

I'm working on a very similar thing, but aimed at reference types and
with the ability for incremental transformations.

Specifying this kind of thing declaratively opens up the door to a lot
of possibilities.


On Thu, Jun 14, 2012 at 7:44 PM, Robert Levy  wrote:
> This announcement is more of a call for suggestions (even pull requests if
> you are moved to do so) as there's not much to it yet, just enough to to
> demonstrate the concept for simpler transformations.  I'm thinking of how
> best to go about supporting a wider range of sequence transformations.
>
> https://github.com/rplevy/lambic
> https://clojars.org/lambic
>
> The basic idea is that languages like Prolog are very good at manipulating
> sequences "by example" based on pattern matching, and that using core.match
> this can become the norm for Clojure too (either using this library or some
> other I don't yet know about.)
>
> In Clojure, when you encounter data that matches pattern X and you want to
> systematically turn into data of the form Y, depending on how complex the
> structures are, you tend to start with some solution, change it around, and
> ultimately end up with a very elegant solution that is clearly the "best
> way".
>
> My present take on how to implement lambic is essentially to catalog these
> "best ways" for a number of different classes of sequence transformations,
> so that lambic knows what to do with them.  What do you think of this idea?
>  Is there a way to use logical magic (magical logic?) to do something
> better? ;)
>
> --
> 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

-- 
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: Why is lein so slow?

2012-06-14 Thread sailormoo...@gmail.com

I found lein repl is slower and most of time it just freezes.

-- 
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: Why is lein so slow?

2012-06-14 Thread thenwithexpandedwingshesteershisflight
me too! And using lein cljsbuild auto takes several seconds to compile, 
whereas cljsc/build + some file copying for shared code takes under a 
second. Also, I've found cljsbuild auto sometimes doesn't compile my code 
completely. I can't figure out the pattern, but I edit something in one 
place in the code, save, lein sees the modified file and recompiles, 
browser refresh, code change not reflected, do a non-logic edit in the code 
somewhere else (e.g. format some whitespace), lein sees the change, 
recompiles, refresh, previous code change is reflected. I tried 
:incremental false, no difference. 
I guess what's making it slow is it must be doing all kinds of dependency 
checking and heavy Maven-type stuff.

On Friday, June 15, 2012 10:12:30 AM UTC+10, sailor...@gmail.com wrote:
>
>
> I found lein repl is slower and most of time it just freezes.
>

-- 
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: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread Tim Jones
On Thu, Jun 14, 2012 at 10:31:44AM -0700, Phil Hagelberg wrote:

> On Wed, Jun 13, 2012 at 8:01 PM, David Della Costa
>  wrote:
> > Similarly, it's easy to
> > get lost (as a beginner) between namespace issues with packages and
> > how to set things up properly with Leiningen.  It'd be good to have
> > some documentation on that.
> 
> Maybe if the Leiningen tutorial linked to
> http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html?

I'm new to SLIME and spent about a day before I figured out C-x M-p to switch 
namespaces within a project.

Tim



-- 
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: Why is lein so slow?

2012-06-14 Thread Andy Fingerhut

On Jun 13, 2012, at 5:27 PM, Warren Lynn wrote:

> I cannot help notice that leinengen seems quite slow. Even "lein help" takes 
> 8 seconds to finish printing all the information. I am using version 2 on 
> Windows 7(that .bat file). Can anyone explain what is going on? Or is it just 
> me? Thank you.

I have used Leiningen on Mac OS X 10.6.8, several versions of Ubuntu Linux, and 
Windows XP + Cygwin, all on the same hardware (some in virtual machines).

I have always found that anything involving the JVM startup time, or compiling 
the Clojure source code, to be noticeably slower on Windows XP + Cygwin than 
the same operations on Mac OS X or Ubuntu Linux.  I don't know the reasons for 
this, but it is a very obvious difference.

Andy

-- 
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: so why it has to be so complicated / Longest Increasing Sub-Seq

2012-06-14 Thread Tyler Perkins
Here's what I came up with, a pretty functional approach:

(fn [l]
  (let [lt(partial apply <)
pairs (->> (map vector l (rest l))
   (partition-by lt)
   (filter (comp lt first)))
max-count (apply max 0 (map count pairs))]
(->> pairs
 (filter (comp (partial = max-count) count))
 (first)
 (#(if %
 (conj (vec (map first %)) (last (last %)))
 [])

-- 
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: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread Korny Sietsma
"Yes emacs is very weird for newbies, but most clojurians use it."

I tend to think this is an unnecessary barrier for entry - yes, people
would be more productive in the long run using emacs, but it has it's own
big learning curve, and is definitely not necessary to get started in
clojure.  It's great to have comprehensive instructions for people who want
the full power of emacs - but we should also make sure there are clear
"getting started" instructions for people who are happy with a smart text
editor and a repl.

- Korny

On 15 June 2012 07:09, fenton  wrote:

> I like the idea of taking care of copyright properly, thanks Sean for the
> links to those pages.  I think the black and white split, docs =
> confluence, code = github, is not so good.  I think John's point about the
> *.md files being a very good place for documentation.  I think the right
> way to do the documentation is like this:
>
> 1 - github with *.md.
> 2 - take care of copyright like you are now.
> 3 - have a trusted person be the owner of the repo...Phil/Sean or someone
> else like that.
> 4 - let folks clone, edit and then send pull requests back to the site
> owner.
>
> my personal approach would be to give commit access to whoever seemed
> reasonable, though I know that freaks some people out.
>
> I'm not going to give up the wonderful prettiness that github does with a
> line like:
>
> ```clojure
> (defn myfunc [x] (+ 2 x))
> ```
>
> which i can't do with confluence.  This group is about a programming
> language, nice colorizing is really great for documentation.
>
> I think having directed tutorials one for each of mac/linux/windows.  Then
> these tutorials should go start to finish with the canonical implementation
> for that platform.  Yes emacs is very weird for newbies, but most
> clojurians use it.  There are reasons why they use it, and as long as we
> can have good docs around these things, then its okay.  It's like
> standardization.  I can sympathize with the concept of only teaching one
> thing at a time.  I totally agree with that.  But I also am not a big fan
> of teaching people something that they'd then throw away.
>
> If anyone wants commit permissions to my repo, just send me your github
> name, and I'll add u.  I'd prefer that the clojure community took up some
> documentation inside of github with *.md files and that repo used instead,
> obviously tho.
>
> Cheers.
>
>
> On Thursday, June 14, 2012 10:31:44 AM UTC-7, Phil Hagelberg wrote:
>>
>> On Wed, Jun 13, 2012 at 8:01 PM, David Della Costa
>>  wrote:
>> > I also think that, at present, while coming in through Leiningen is
>> > definitely the most painless way to do things (I'm really loving it
>> > actually, as a Ruby dev it kind of seems like rvm + bundler + rake all
>> > wrapped up in one handy package), trying to navigate whether to use
>> > 1.x or 2.x preview is a bit confusing--and the variety of docs
>> > available for setting things up is confusing.
>>
>> Yeah, as of the last release we're pretty much advising everyone to go
>> with 2.x, but the docs still need to be updated to reflect that. What
>> are some of the confusing docs you mention? Most people have said the
>> install process is pretty simple.
>>
>> > Similarly, it's easy to
>> > get lost (as a beginner) between namespace issues with packages and
>> > how to set things up properly with Leiningen.  It'd be good to have
>> > some documentation on that.
>>
>> Maybe if the Leiningen tutorial linked to
>> http://blog.8thlight.com/**colin-jones/2010/12/05/**
>> clojure-libs-and-namespaces-**require-use-import-and-ns.html
>> **?
>>
>> > All of that said, maybe I'll take a look at the docs and see if I can
>> > add anything constructive, since I've set it up now a few times on
>> > Macs.
>>
>> That would be great; thanks. We could also use some help improving
>> http://leiningen.org; it's pretty messy right now.
>>
>> -Phil
>>
>  --
> 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
>



-- 
Kornelis Sietsma  korny at my surname dot com http://korny.info
"We do not quit playing because we grow old, we grow old because we quit
playing" - O.W. Holmes

-- 
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://group

Re: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread Sean Corfield
On Thu, Jun 14, 2012 at 6:52 PM, Korny Sietsma  wrote:
>  It's great to have comprehensive instructions for people who want the full
> power of emacs - but we should also make sure there are clear "getting
> started" instructions for people who are happy with a smart text editor and
> a repl.

And the Getting Started page suggests that:
http://dev.clojure.org/display/doc/Getting+Started
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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.core.cache status?

2012-06-14 Thread Sean Corfield
I'm at a point where I'd like to start using clojure.core.cache
(aren't I brave? :)

I tried 0.5.0 which is the stable version - and had a bit of a fight
with the docs because 0.5.0 has quite a different API to what's
described here:

http://clojure.github.com/core.cache/#clojure.core.cache/ttl-cache-factory

I figured out what 0.5.0 wanted and basic testing looked good. Then as
I did more exhaustive testing, I started to get exceptions that
LazySeq could not be converted to Number from various functions in the
TTLCache - where it was attempting to manipulate elements returned
from the ttl data structure.

So I decided to try 0.6.0-SNAPSHOT... I changed my code back to match
the updated APIs (which do match the docs, at least).

My application tests all pass (yay!) but now I'm relying on a SNAPSHOT
and I'm wondering how stable the APIs are and how close a 0.6.0
release might be?

I know this is mostly a question for Fogus but I figured asking it
here would draw feedback from other folks who might already be using
core.cache... I've already had some feedback on #clojure on IRC but
I'd be interested in more...
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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: Broken "Sequences" screencast

2012-06-14 Thread David Della Costa
Kevin, thanks very much!  When I went to load that in a browser, I got
the message "This video is only available in the Blip player..." but I
was successfully able to download the video via curl.

You're right, there's a buzzing sound throughout, unfortunately...ah well.

Thanks again--

Dave

2012/6/14 Kevin Ilchmann Jørgensen :
> From the rss.
> http://blip.tv/file/get/Richhickey-ClojureSequences284.mov
>
> The sound dont get any better thru.
> /Kevin
>
> On Thu, Jun 14, 2012 at 4:11 AM, David Della Costa
>  wrote:
>> Hey folks, I see that this was never answered, but it remains a problem.
>>  I've tried viewing the video on blip
>> (http://blip.tv/clojure/clojure-sequences-740581) as well as downloading via
>> iTunes, but no dice--I get about 8 seconds of Rich introducing the topic and
>> then nothing.
>>
>> I'd love to see this video, so if anyone has a copy or can point me to a
>> working resource I'd be most appreciative--thank you!
>>
>> Best,
>> Dave
>>
>> 2011年9月1日木曜日 17時46分11秒 UTC+9 Irakli Gozalishvili:
>>>
>>> Hi,
>>>
>>> Not sure if this right place to report about this, but I could not thing
>>> of any better. I'm in a process of learning Clojure and I found screen-casts
>>> linked from clojure.org http://blip.tv/clojure very useful. Unfortunately
>>> thought ["Clojure
>>> Sequences"](http://blip.tv/clojure/clojure-sequences-740581) video is broken
>>> it plays 7secs and stops. Would be great if anyone could fixed that!
>>>
>>> Regards
>>
>> --
>> 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
>
> --
> 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

-- 
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: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread David Della Costa
Hey Phil, thanks for the response.

>> trying to navigate whether to use
>> 1.x or 2.x preview is a bit confusing--and the variety of docs
>> available for setting things up is confusing.
>
> Yeah, as of the last release we're pretty much advising everyone to go
> with 2.x, but the docs still need to be updated to reflect that. What
> are some of the confusing docs you mention? Most people have said the
> install process is pretty simple.

To be fair, I probably had problems based on how I am used to using
github rather than any failure of the docs.  The actual process is
simple, you are right.  I was trying to set up 2.0.0 preview but the
docs focus(ed) on the 1.x version, and it wasn't quite clear how that
worked at the time I set it up (a few weeks ago)--the link wasn't
obvious, and when pulling from git I wasn't sure what version I was
getting.  And in any case I see that someone updated the Leiningen
readme on github to promote 2.x first and foremost since last time I
checked: nice. That should help if anyone has confusion similar to
mine, so this is probably moot.

The variety of docs just refers to all the random tutorials out there
if you do a Google search.  Again, not really fair to compare to the
official Leiningen docs, which are pretty helpful.

More generally, I think a certain amount of this is unavoidable; newbs
will always be confused, there will always be a variety of conflicting
third-party tutorials available for any framework, and transitioning
from one major version to the next is always painful.  So I expect
this will smooth out as the community continues to grow and get more
folks coming in.

>> Similarly, it's easy to
>> get lost (as a beginner) between namespace issues with packages and
>> how to set things up properly with Leiningen.  It'd be good to have
>> some documentation on that.
>
> Maybe if the Leiningen tutorial linked to
> http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html?
>

Warning, digression: you know, I read that, and I still find the
differences between use and require confusing. I have to go back and
re-read it, and practice more. But, for example, I had trouble
figuring out how to include new directories so that midje test files
were picked up in my lein projects, with properly named namespaces.
There is probably a smart and Clojure-esque way to handle all of this.
 But I found it hard to figure out at first, and I think I'm still not
doing it right--I'm using the load-file function, which doesn't really
have anything to do with namespaces.

Again, I apologize, I know that was a digression.  In fact, I like
slogging through things and figuring out the best practices in
somewhat indirect ways, getting that "aha" moment when something I
read a month ago finally clicks, like I expect Mr. Jones' article to
do at some point.  But I also realize not everyone has that level of
patience...or perhaps more accurately, masochism.

>> All of that said, maybe I'll take a look at the docs and see if I can
>> add anything constructive, since I've set it up now a few times on
>> Macs.
>
> That would be great; thanks. We could also use some help improving
> http://leiningen.org; it's pretty messy right now.

Cool, I'll see what I can contribute!

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

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


Announcing KR v1.4.2 :: RDF and SPARQL support using clojure data / interfaces

2012-06-14 Thread Kevin Livingston
Hello everyone, I just wanted to announce the open-sourcing of a RDF and 
SPARQL (and more) library that has been under development and use for quite 
a while in our lab.  It supports the use of clojure symbols and lists as 
rdf resources and triples, and it can form triple patterns into sparql 
queries.  It extends and normalizes the two common Java APIs for 
RDF/SPARQL: Jena and Sesame, providing a consistent view and easier to 
write queries through the use of triple-patterns (symbols and sequences) 
instead of messy string munging.

There are release jars on clojars.org, and all the code is here:

https://github.com/drlivingston/kr

There are two examples in the kr-examples directory showing an in-memory 
triple store and a remote store.  There is a lot more that can be document 
and examples written.  A great source of examples exists in 
kr-core/src/test...  I'll try to keep documenting more and more...

It still has some wrinkles to be sure, but it's a highly functional and 
useful library.  I welcome feedback, and help improving it.

I hope you find it useful,
thanks,
Kevin

-- 
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: Central screwup

2012-06-14 Thread Nelson Morris
On Thu, Jun 14, 2012 at 8:38 AM, Stuart Sierra
 wrote:
>
>>
>> Is there anyone on the Clojure/core team with a contact among those
>> who run Central who could get them to look into this?
>
>
> I'm on the Sonatype OSSRH mailing list:
> https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide
> (mailing list addresses at the bottom)
>
> There was no mention of this issue there, but I'll ask about it.
> -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

akhudek just asked about only getting 1.2.0 from central in #clojure.
It appears the metadata has been reverted again.

>From  http://repo1.maven.org/maven2/org/clojure/clojure/ :
maven-metadata.xml 14-Sep-2010 12:18
  325
maven-metadata.xml.md5 14-Sep-2010 12:18
   32
maven-metadata.xml.sha114-Sep-2010 12:18
   40

$ curl  http://repo1.maven.org/maven2/org/clojure/clojure/maven-metadata.xml


  org.clojure
  clojure
  
1.2.0
1.2.0

  1.2.0

20100914121821
  


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


Enfocus issues

2012-06-14 Thread Andreas Kostler
Hi everyone,
I finally decided to give clojurescript a spin. Unfortunately, the momentum
died before I even got the ball running. I'm trying to replicate the
canonical example on the enfocus website using lein-cljsbuild [0.2.1] and
enfocus [0.9.1-SNAPSHOT]:


(ns my.namespace
  (:require [enfocus.core :as ef])
  (:require-macros [enfocus.macros :as em]))

(defn start []
  (em/at js/document
["body"] (em/content "Hello world!"))

(set! (.onload js/window) start)


lein cljsbuild once fails with the following error:

Compiling "resources/public/js/main.js" failed:
java.lang.AssertionError: Assert failed: set! target must be a field or a
symbol naming a var

Any clues?

Cheers
Andreas

-- 
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: Enfocus issues

2012-06-14 Thread David Nolen
On Fri, Jun 15, 2012 at 1:23 AM, Andreas Kostler <
andreas.koest...@leica-geosystems.com> wrote:

> (set! (.onload js/window) start)


Should be  (set! (.-onload js/window) start)

-- 
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: Enfocus issues

2012-06-14 Thread Andreas Kostler
There you go...wrong on the example-page then.
Thanks David


On 15 June 2012 15:00, David Nolen  wrote:

> On Fri, Jun 15, 2012 at 1:23 AM, Andreas Kostler <
> andreas.koest...@leica-geosystems.com> wrote:
>
>> (set! (.onload js/window) start)
>
>
> Should be  (set! (.-onload js/window) start)
>
>  --
> 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

-- 
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: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Tassilo Horn
"Jim - FooBar();"  writes:

> nice catch and point taken...
>
> however the exact same thing would happen if this was a
> function...it's just wrong !

Yes.  A correct version is

(defn in? [coll e]
  (some (partial = e) coll))

Bye,
Tassilo

-- 
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: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread fenton
What I'd suggest is that there be a git repo for clojure docs, where things 
can be brought together like the types of articles i'm writing, but tended 
by the clojure community.  So i wouldn't suggest putting: "Getting started 
with emacs (for clojure) sic." in the clojure-mode repo, but perhaps a git 
repo, owned by yourself or Rich or something, could be created where you 
can pull contributions into.  Then I could clone that repo, make changes 
and submit pull requests to you, which you could then reject with comments 
or approve, and then pull the changes into that repo.  Possible?  Others c 
this having value?  What are the issues with this approach?

On Thursday, June 14, 2012 4:12:10 PM UTC-7, Phil Hagelberg wrote:
>
> On Thu, Jun 14, 2012 at 2:09 PM, fenton  wrote 
> > I'm not going to give up the wonderful prettiness that github does with 
> a 
> > line like: 
> > 
> > ```clojure 
> > (defn myfunc [x] (+ 2 x)) 
> > ``` 
> > 
> > which i can't do with confluence.  This group is about a programming 
> > language, nice colorizing is really great for documentation. 
>
> Hmm... while I agree that Confluence is bad for this sort of thing, I 
> don't see the Clojure maintainers changing their mind and accepting 
> pull requests since they've been pretty staunchly opposed to them for 
> ages. 
>
> However, I would be perfectly happy moving the "Getting Started with 
> Emacs" tutorial into the clojure-mode repository and changing the 
> Confluence wiki page to point to there. The "Getting Started with 
> Leiningen" page already points off to Github, and I think we're likely 
> to get higher quality contributions that way. I'll put it on my todo 
> list, but if you're interested in helping a pull request would make it 
> happen more quickly. 
>
> thanks, 
> Phil 
>

-- 
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 practices for named arguments

2012-06-14 Thread David Jacobs
TL;DR: I want to know best practices for designing functions with multiple 
optional arguments.

Okay, so I'm working to build machine learning algorithms in Clojure, and 
they tend to need many arguments. Being a long-time Ruby dev, I like to 
provide sensible defaults for almost all potential arguments that the 
functions take. However, there are some parameters that have to be explicit 
(namely, the data).

To alleviate the pain here, I've started to experiment with named 
arguments. So far, I've come up with something like the following:

(defn descend [xs ys & args]
  (let [defaults {:gradient-fn gradient
  :cost-fn cost
  :yield-fn println
  :alpha 0.01
  :iterations 1000
  :thetas (matrix 0 (second (dim xs)) 1)}
options (merge defaults (apply hash-map args))
{:keys [gradient-fn cost-fn yield-fn thetas alpha iterations]} 
options]
(do-the-algorithm-using-locally-bound-vars)))

It's a little wordy and could be extracted into a macro a la defnk (RIP 
clojure.contrib.def), but it works.

However, if I then want to use method delegation for some algorithms, the 
named argument endeavor gets trickier.

Say I have the same function in two namespaces. One is a general gradient 
descent function, and the other is a specific gradient descent function 
whose only role is to curry a named parameter into the general function.

I want to do something like the following:

(defn descend [xs ys & args]
  (optimization/descend xs ys (conj args :cost-fn cost)))

The problem, of course, is that if I want to delegate the args array to 
another function, I have to destructure args first before passing it into 
another function. In fact, if I ever have a delegating function like this 
(where a partial apply isn't good enough), I can't pass args through to the 
delegating function because it's automatically vectorized.

How do I splat vectors into parameter lists? (Should I be passing in 
records/maps instead of named parameters?)

Thanks,
David

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