Re: Confused about comp

2012-12-15 Thread Peter West
On Saturday, 15 December 2012 17:42:05 UTC+10, puzzler wrote: > > (I took the liberty of replacing #(= \a %) with #{\a}) > > On Fri, Dec 14, 2012 at 11:37 PM, Mark Engelberg > > > wrote: > >> (comp (partial apply str) (partial filter #{\a})) >> > > You're most welcome. Thank you for this. A co

Re: clojure.core/format generalization

2012-12-15 Thread Alexander Semenov
Sorry for that stupid question. Was coding to much. :) Cheers. On Saturday, December 15, 2012 3:42:24 AM UTC+3, Alexander Semenov wrote: > > Hi, folks. > > I need a generalized version of clojure.core/format function, i.e. > function that accepts a pattern like "-%s-%s-%s-", two functions and fo

Re: Confused about comp

2012-12-15 Thread Baishampayan Ghose
The apply is needed here because filter is going to return a sequence of strings and you really want to `apply' str on it. -BG On Sat, Dec 15, 2012 at 1:39 PM, Peter West wrote: > A couple of questions, if I may. > > In (partial apply str) why the apply? > > Given the apply, why the partial?

Re: Confused about comp

2012-12-15 Thread Peter West
On Saturday, 15 December 2012 18:09:13 UTC+10, Peter West wrote: > > > > On Saturday, 15 December 2012 17:42:05 UTC+10, puzzler wrote: >> >> (I took the liberty of replacing #(= \a %) with #{\a}) >> >> On Fri, Dec 14, 2012 at 11:37 PM, Mark Engelberg wrote: >> >>> (comp (partial apply str) (parti

Re: Clojure Full Syntactical Reference

2012-12-15 Thread John Gabriele
On Friday, December 14, 2012 6:40:50 PM UTC-5, lin...@redhandgaming.net wrote: > > Where can I find, or does there exist, a place where I can view all > Clojure's built in functions with a short description of their arguments > and what they do? > As Andy pointed out, Clojuredocs is the place

Re: Confused about comp

2012-12-15 Thread Peter West
Thanks Baishampayan. I'm still puzzled about this though, because (doc str) says that with one argument x, str returns x.toString(). What it returns is "clojure.lang.LazySeq@fe1" So it seems to be returning a lazy sequence. Why is the function not simply applied? Other functions are "applied" s

Re: Confused about comp

2012-12-15 Thread Peter West
On Saturday, 15 December 2012 17:42:05 UTC+10, puzzler wrote: > > (I took the liberty of replacing #(= \a %) with #{\a}) > > On Fri, Dec 14, 2012 at 11:37 PM, Mark Engelberg > > > wrote: > >> (comp (partial apply str) (partial filter #{\a})) >> > > Puzzler, Your change replaces the single argume

Re: Confused about comp

2012-12-15 Thread Marko Topolnik
> I'm still puzzled about this though, because (doc str) says that with one > argument x, str returns x.toString(). What it returns is > "clojure.lang.LazySeq@fe1" > > So it seems to be returning a lazy sequence. Why is the function not > simply applied? Other functions are "applied" simple by

Re: Confused about comp

2012-12-15 Thread Baishampayan Ghose
An example will make it clear for you... (str ) => (str '("foo" "bar" "baz")) (apply str ) => (str "foo" "bar" "baz) Hope this helps. -BG On Sat, Dec 15, 2012 at 3:48 PM, Peter West wrote: > Thanks Baishampayan. > > I'm still puzzled about this though, because (doc str) says that with one > a

Re: Need ideas for carving project into namespaces

2012-12-15 Thread Jim - FooBar();
I know my reply is a bit delayed but the past 2-3 days have been frantic! On 12/12/12 18:00, Michał Marczyk wrote: @Jim: That function generates factory functions which themselves use no reflection and incur no performance penalty at all. The only performance hit visible at runtime comes from t

Re: Need ideas for carving project into namespaces

2012-12-15 Thread Jim - FooBar();
@Mark To be honest i cannot answer your question...however it works...demo follows: sorted@sorted-desktop:~$ lein2 repl nREPL server started on port 50832 REPL-y 0.1.0-beta10 Clojure 1.4.0 Exit: Control+D or (exit) or (quit) Commands: (user/help) Docs: (doc function-name-here)

another n00b defrecord combination question

2012-12-15 Thread mond
I have defined these types of records for modelling a simple shopping cart: ; An item in the cart (defrecord Item [id name product quantity purchased]) ; The product that relates to the item in the cart (defrecord Product [id name description prices]) ; A price definition (defrecord Price [price

Re: Confused about comp

2012-12-15 Thread Armando Blancas
> > (comp (partial apply str) (partial filter #{\a})) > Or, (comp join (partial filter #{\a})) -- 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 moder

Re: another n00b defrecord combination question

2012-12-15 Thread mond
I think I am close to answering this myself (which is always nice!) I have done the necessary joins with map and I can return a product description user=> (map (fn [item product] (= (:product item (:id product))) (:description product)) items products) ("Men's Leather Slip on Brogues" "CK Y Fro

Re: another n00b defrecord combination question

2012-12-15 Thread mond
OK - I have it now: (map (fn [item product] (= (:product item (:id product))) [(:id item) (:description product)]) items products) This feels OK to me but if anyone has a nicer / more idiomatic solution, I will be happy to take feedback. ray On Saturday, December 15, 2012 7:08:21 PM UTC+1, mo

Re: another n00b defrecord combination question

2012-12-15 Thread Benjamin R. Haskell
(responses inline) On Sat, 15 Dec 2012, mond wrote: I have defined these types of records for modelling a simple shopping cart: ; An item in the cart (defrecord Item [id name product quantity purchased]) ; The product that relates to the item in the cart (defrecord Product [id name descriptio

Re: another n00b defrecord combination question

2012-12-15 Thread Benjamin R. Haskell
On Sat, 15 Dec 2012, Benjamin R. Haskell wrote: Or if you really want a list, you need to quote it: (map (fn [item product] '(:id item :description product)) items products) Oops, wrong. Rather, you would want clojure.core/list: (map (fn [item product] (list :id item :description product))

Re: Long response time after a clojure process was inactive for some time

2012-12-15 Thread Stefan Ring
On Thursday, December 13, 2012 8:21:09 PM UTC+1, Trastabuga wrote: > > A while ago I created a small web site based on Clojure. I noticed that > when there was no requests to the site for some period of time (a few > hours) it may take up to 20-30 seconds to process an incoming request. > I am wo

Re: Confused about comp

2012-12-15 Thread Marek Šrank
...which should be also a lot faster :) On Saturday, December 15, 2012 5:44:01 PM UTC+1, Armando Blancas wrote: > > (comp (partial apply str) (partial filter #{\a})) >> > > Or, (comp join (partial filter #{\a})) > > -- You received this message because you are subscribed to the Google Groups "

Re: Confused about comp

2012-12-15 Thread Alan Malloy
Nonsense. Why would that be any faster? (join coll) is defined as (apply str coll). On Saturday, December 15, 2012 12:21:45 PM UTC-8, Marek Šrank wrote: > > ...which should be also a lot faster :) > > On Saturday, December 15, 2012 5:44:01 PM UTC+1, Armando Blancas wrote: >> >> (comp (partial app

Re: another n00b defrecord combination question

2012-12-15 Thread mond
Thanks for picking up the cudgels Ben! To be honest I am struggling to repeat your advice in the REPL. In any case, I decided to change the data structures in line with your advice and put the IDs into maps rather than the records. (defrecord Item [name product quantity purchased]) (defrecord

Clojure syntax coloring for wordpress blogs

2012-12-15 Thread Nick Gonzalez
Does anyone have a good method for syntax coloring clojure code snippets for a wordpress blog? I've recently started my new blog, and I'm posting clojure snippets, and would like for them to be syntax highlighted and indented properly. Nick Gonzalez -- You received this message because you a

Re: defrecord and overriding "empty"

2012-12-15 Thread Joseph Smith
Well here I am over a year later with the same problem. I'm curious, what was your solution for the time being? On Tuesday, September 27, 2011 1:06:37 PM UTC-5, David Nolen wrote: > > On Tue, Sep 27, 2011 at 1:54 PM, Nathan Sorenson > > wrote: > >> Should IPersistentCollection even be defining '

JavaFX and Clojure

2012-12-15 Thread Christian Sperandio
Hi, After some studies about JavaFX with Clojure, and bricks broke with my head, I wrote a sort of wrapper to work more easily with both. It's here : https://github.com/chrix75/javafx-clj You can play with JavaFX in your REPL and you have the macro with-javax and wit-javafx-let that let you wri

ClojureCLR binary download issue

2012-12-15 Thread Shantanu Kumar
Hi, Thought to bring up the recent ClojureCLR binary download issue: 1. The http://clojure.org/ homepage links ClojureCLR to the old Github repo. 2. The `Download` links on ClojureCLR repo have gone missing: https://github.com/clojure/clojure-clr #2 may have to do with Github's recent announcem

Re: another n00b defrecord combination question

2012-12-15 Thread Benjamin R. Haskell
On Sat, 15 Dec 2012, mond wrote: Thanks for picking up the cudgels Ben! Ha. It's nice to have reached a point where I feel at-all confident with any of this... happy to help. To be honest I am struggling to repeat your advice in the REPL.  In any case, I decided to change the data struct

How to structure a Clojure day for noobs?

2012-12-15 Thread ulsa
In a couple of months, I'll have a whole day of teaching Clojure to ten of my colleagues. They are experienced Java programmers, but otherwise Clojure rookies. Any tips on how to structure such a workshop day? -- You received this message because you are subscribed to the Google Groups "Clojure

Re: How to structure a Clojure day for noobs?

2012-12-15 Thread Marko Topolnik
There is one advice I can give from my teaching experience: don't overwhelm them with data. A person can assimilate only so many concepts in a day, no matter whether the workshop lasts two or eight hours. Pick a few key concepts and spend much time on approaching each concept from many differe

Re: defrecord and overriding "empty"

2012-12-15 Thread David Nolen
In core.logic we have a protocol called IUninitialized that you can implement. That works well enough for our needs. On Saturday, December 15, 2012, Joseph Smith wrote: > Well here I am over a year later with the same problem. I'm curious, what > was your solution for the time being? > > On Tuesd

Re: Clojure syntax coloring for wordpress blogs

2012-12-15 Thread Alexander Solovyov
On Sat, Dec 15, 2012 at 11:02 PM, Nick Gonzalez wrote: > Does anyone have a good method for syntax coloring clojure code snippets > for a wordpress blog? I've recently started my new blog, and I'm posting > clojure snippets, and would like for them to be syntax highlighted and > indented properly

Re: ANN: lein-clr 0.2.0 for ClojureCLR

2012-12-15 Thread Aaron
Cool. I'm just seeing this now. I actually spent some time a while back getting a very simple nleiningen working in ClojureCLR. I had nuget downloads working and also the ability to AOT compile namespaces and merge them into a single DLL. It's not fully ready for prime time yet though, in p

Re: JavaFX and Clojure

2012-12-15 Thread Christian Sperandio
I had a test to show how it work. Le samedi 15 décembre 2012 22:10:50 UTC+1, Christian Sperandio a écrit : > > Hi, > > After some studies about JavaFX with Clojure, and bricks broke with my > head, I wrote a sort of wrapper to work more easily with both. > It's here : https://github.com/chrix75/

Re: Confused about comp

2012-12-15 Thread Peter West
Hi Mark and Baishampayan, I can see what difference it makes, but I can't get a handle on the rationale. For instance, I found this discussion: http://stackoverflow.com/questions/1257028/why-should-i-use-apply-in-clojure It starts with a quote from a Rich Hickey blog post, as follows. > A big d

Re: Confused about comp

2012-12-15 Thread Mark Engelberg
On Sat, Dec 15, 2012 at 3:58 PM, Peter West wrote: > But it can't, can it? In this context (apply f [i]) with respect to (f i)* > apply *has *side-effects*! > This doesn't really make any sense. There are no side effects here. I think maybe you just don't understand what apply does. Let me t

Re: ClojureCLR binary download issue

2012-12-15 Thread dmiller
On Saturday, December 15, 2012 3:27:26 PM UTC-6, Shantanu Kumar wrote: > > Hi, > > Thought to bring up the recent ClojureCLR binary download issue: > > 1. The http://clojure.org/ homepage links ClojureCLR to the old Github > repo. > Whoever maintains the homepage will have to fix this. Note: t

Re: Who's using Clojure?

2012-12-15 Thread vemv
Surely because Fogus was in process of upgrading it :D go check it out now! http://dev.clojure.org/display/community/Clojure+Success+Stories On Friday, December 14, 2012 3:34:23 PM UTC+1, Jeff Heon wrote: > > I'm asked to log in now to access this page. > > On Thursday, April 28, 2011 11:03:53 P

Using Google Template Library with ClojureScript App

2012-12-15 Thread Ari
Hi, Since it can not be included as a dependency, how does one integrate the Google Closure Template library into a Leiningen-based Clojure/ClojureScript application? Ideally, I'd like for the templates to be auto-compiled as is done for *.cljs files via the cljsbuild plugin. Thanks. -Ari -

Running a clojure script

2012-12-15 Thread Mark Engelberg
Let's say I have a file "hello.clj" that simply contains the line: (println "hello, world") What's the simplest way to run this clojure file? I'm looking for something simpler than setting up a lein project. Is there something along the lines of: java clojure.jar hello.clj that would actually wo

Re: Running a clojure script

2012-12-15 Thread Dave Ray
Yep. java -jar clojure.jar hello.clj Should do the trick. Alternatively, java -cp clojure.jar clojure.main hello.clj Will also work if you need to control the classpath more. Dave On Saturday, December 15, 2012, Mark Engelberg wrote: > Let's say I have a file "hello.clj" that simply con

Re: Clojure syntax coloring for wordpress blogs

2012-12-15 Thread Vijay Kiran
I use WP-Syntax[1] plugin which uses GeSHi , which seems be working fine for me on my blog [2] [1] http://wordpress.org/extend/plugins/wp-syntax/ [2] http://www.vijaykiran.com/2012/01/31/web-application-development-with-clojure-part-3/ On Saturday, December 15, 2012 10:02:11 PM UTC+1, Nick Gon

Re: Running a clojure script

2012-12-15 Thread Mark Engelberg
Thanks. I think that used to be on the Getting Started page, but now the page is just links to info about how to get up and running with IDEs, so I had trouble finding it. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send em

Re: ClojureCLR binary download issue

2012-12-15 Thread Shantanu Kumar
On Sunday, 16 December 2012 06:01:54 UTC+5:30, dmiller wrote: > > [Off-topic] -- I noticed this when I wanted to confirm the binaries >> because I was running into the following error: >> >> FATAL UNHANDLED EXCEPTION: System.MissingFieldException: Field >> 'clojure.lang.RT.OutVar' not found. >>

Re: Running a clojure script

2012-12-15 Thread Armando Blancas
Why are you using puzzler's account and what did you did to him?! On Saturday, December 15, 2012 7:28:56 PM UTC-8, puzzler wrote: > > Thanks. I think that used to be on the Getting Started page, but now the > page is just links to info about how to get up and running with IDEs, so I > had troub

ClojureCLR errors on Mono Linux

2012-12-15 Thread Shantanu Kumar
Hi, I noticed the following ClojureCLR errors using Mono 2.10 on Ubuntu 12.04 (they do not happen on Windows using either .NET or Mono): 1. when running Clojure.Compile.exe: Exception: System.MissingFieldException: Field 'clojure.lang.RT.OutVar' not found. 2. when using Clojure.Main.exe: Exc

Re: ClojureCLR binary download issue

2012-12-15 Thread Shantanu Kumar
On Sunday, 16 December 2012 09:20:31 UTC+5:30, Shantanu Kumar wrote: > > On Sunday, 16 December 2012 06:01:54 UTC+5:30, dmiller wrote: > >> >> [Off-topic] -- I noticed this when I wanted to confirm the binaries >>> because I was running into the following error: >>> >>> FATAL UNHANDLED EXCEPTION

Re: ClojureCLR errors on Mono Linux

2012-12-15 Thread Shantanu Kumar
This is when using ClojureCLR 1.4.0 Debug-4.0 version. Shantanu On Sunday, 16 December 2012 09:45:21 UTC+5:30, Shantanu Kumar wrote: > > Hi, > > I noticed the following ClojureCLR errors using Mono 2.10 on Ubuntu 12.04 > (they do not happen on Windows using either .NET or Mono): > > 1. when runn

Re: Running a clojure script

2012-12-15 Thread Mark Engelberg
Hmmm, looks like googlegroups is stripping out my email address and replacing it with one of my google account handles. Probably depends on what method you are using to view the group messages. I'm not going out of my way to be pseudonymous, it just seems to be a feature of the group. On Sat, De

Belgian Clojure base meetup?

2012-12-15 Thread Thomas Goossens
If you are from Belgium, Don't get too excited - yet - . I've been wondering about organising a small meetup somewhere next semester. (I peeked at our northern neighbours: http://www.meetup.com/The-Amsterdam-Clojure-Meetup-Group/events/88386392/) Though, I have no idea at all how many people he