Re: Do you like the Clojure syntax?

2013-08-13 Thread Christian Sperandio
Even if I think the current syntax is one of the best, could you say what Clojure's capability couldn't be done with another syntax? Other languages implement FP without lisp syntax and the macros could be done in another way, perhaps with AST (like in groovy). Le 13 août 2013 08:53, "Alex Barano

Re: Do you like the Clojure syntax?

2013-08-13 Thread Alex Baranosky
IMO, macros without homoiconicity are unnecessarily complex: so in that sense Clojure's syntax makes macros simpler. Where macros are simply reorganizing some data in Clojure, in a language like Groovy you've got to jump through hoops and only get a limited slice of the power. Homoiconicity gives

Re: Lazy group-by for sorted maps?

2013-08-13 Thread Colin Yates
Yep, sure. Thanks. On 13 Aug 2013 05:56, "Michael-Keith Bernard (SegFaultAX)" < mkbernard@gmail.com> wrote: > For the partition-by solution to work, you have to ensure that the result > set from the query is sorted by the foreign key: > > (partition-by identity "aaabbbcccaaabbbcc") > ;;=> ((\

Re: Do you like the Clojure syntax?

2013-08-13 Thread Michael Klishin
2013/8/13 Christian Sperandio > Even if I think the current syntax is one of the best, could you say what > Clojure's capability couldn't be done with another syntax? > They could, Elixir is a good recent example. However, it's a very tricky thing to get right, while s-expressions have been arou

Re: Do you like the Clojure syntax?

2013-08-13 Thread Korny Sietsma
I think it depends on what is important to you. For me, the syntax is core to the language because it encourages a certain mindset. The default for everything is (verb noun noun noun...) - this is the kingdom of verbs, and functions are how you build things. If you added an infix syntax, or some

Re: [ANN] Clojure Cheatsheet for Emacs

2013-08-13 Thread Kris Jenkins
Hi Phil, It looks like your package list is out of date - there's a newer version of the cheatsheet than that one. Try: M-x package-refresh-contents M-x package-install RET clojure-cheatsheet That should get your index pointing to the latest copy. Give me a shout if you still have trouble. :-

Re: Do you like the Clojure syntax?

2013-08-13 Thread Răzvan Rotaru
luni, 12 august 2013, 11:00:27 UTC+3, Alan Forrester a scris: > > > Do you have arguments against Clojure's current syntax? > > Alan Well, there are disadvantages. And I don't mean Clojure in particular, but lisp in general. Flattening everything to lists and similar data structures sucks ou

function creation, partial or #()

2013-08-13 Thread Jay Fields
Say you have a simple function: (defn do-work [f] (f)) When you want to call do-work you need a function, let's pretend we want to use this function: (defn say-hello [n] (println "hello" n)) Which of the following solutions do you prefer? (do-work (partial say-hello "bob")) (do-work #(say-hello

Re: function creation, partial or #()

2013-08-13 Thread Jim - FooBar();
On 13/08/13 13:47, Jay Fields wrote: Say you have a simple function: (defn do-work [f] (f)) When you want to call do-work you need a function, let's pretend we want to use this function: (defn say-hello [n] (println "hello" n)) Which of the following solutions do you prefer? (do-work (partial

Re: [ANN] Clojure Cheatsheet for Emacs

2013-08-13 Thread Philip Potter
Thanks Kris! I don't know what went wrong before, because I couldn't even find it on the MELPA site, but it works great now. Phil On 13 August 2013 10:29, Kris Jenkins wrote: > Hi Phil, > > It looks like your package list is out of date - there's a newer version > of the cheatsheet than that on

Re: function creation, partial or #()

2013-08-13 Thread Max Penet
Hi, Partial calls apply, so it's not as performant as #(..). That can make quite the difference depending on where it's used. All instances of partial were removed recently in carmine/nippy and that resulted in quite a performance improvement. On Tuesday, August 13, 2013 2:47:01 PM UTC+2, Jay

[ANN] core.typed 0.1.24

2013-08-13 Thread Ambrose Bonnaire-Sergeant
Hi, Announcing a new release of core.typed . [org.clojure/core.typed "0.1.24"] There are some breaking changes surrounding the ann-{datatype,protocol} macros, see the changelog and their corresponding var docs for the details. We also now support adding a

Libgdx (Error: Native library for macosx-x86 not found)

2013-08-13 Thread app
I'm getting "Native library for macosx-x86 not found" or "Could not initialize class org.robovm.llvm.binding.LLVMJNI" error while trying to compile one of the demo games of libgdx engine. What could it be? -- -- You received this message because you are subscribed to the Google Groups "Clojure

Re: Do you like the Clojure syntax?

2013-08-13 Thread Steven Degutis
That isn't universally true. For me it was the opposite: this syntax made it easier for my brain to process than any other language, even when I was first learning it. Maybe my brain is diabetic and just can't handle syntactic sugar. But I bet I'm not the only person like this. On Tue, Aug 13, 20

Re: Do you like the Clojure syntax?

2013-08-13 Thread Michal Till
Hi, I actually think that this is a really important question and for me despite the fact that I *love* Clojure my answer is NO, i don't like the syntax. To me it represents a significant barrier for reading. When I read an imperative OOP language I instinctively "see" through the code what th

Re: Feature toggles via Leiningen profiles

2013-08-13 Thread Michal Till
> Rather than shadowing one implementation with another, I'd recommend keeping both implementations in different namespaces and dispatching based on config, which can be read from the classpath. Sorry for a newbie question, but how do I do "dispatching based on config" exactly? The point for me

Re: Do you like the Clojure syntax?

2013-08-13 Thread Lee Spector
On Aug 13, 2013, at 10:02 AM, Steven Degutis wrote: > That isn't universally true. For me it was the opposite: this syntax made it > easier for my brain to process than any other language, even when I was first > learning it. Maybe my brain is diabetic and just can't handle syntactic > sugar.

[ANN] mod-lang-clojure 0.1.0 for Vert.x released

2013-08-13 Thread Toby Crawley
Stream and I just released the first "stable" version of the mod-lang-clojure module, 0.1.0. This module provides support for writing Vert.x applications in Clojure. # What is Vert.x? Vert.x[0] is an asynchronous polyglot application platform for the JVM built on top of Netty. # Current featur

Re: Do you like the Clojure syntax?

2013-08-13 Thread Softaddicts
Then they are very weak in terms of tooling evaluation. If people are unwilling to look objectively at a pros/cons analysis why bother with them ? Why scrap the syntax for this kind of people ? I am not saying that there are not nice people to have a coffee with or a beer. I am just saying that t

ANN Introducing Route One

2013-08-13 Thread Michael Klishin
On behalf of the ClojureWerkz team, I'm happy to announce our not-so-new project that has recently reached 1.0.0-rc1 stage: Route One [1]. Route One is a route generation library complimentary to Clout, part of Compojure. It takes a route definition and parameters and produces a URL/URI/path. It

Re: Do you like the Clojure syntax?

2013-08-13 Thread Mikera
On Monday, 12 August 2013 15:52:53 UTC+8, Răzvan Rotaru wrote: > Hi, > > I'm curious about the general opinion on the Clojure syntax, whether > people actually like it or just use it because it provides macros. So I > would like to ask you to participate in a poll. Thank You. > > The importance

Re: Do you like the Clojure syntax?

2013-08-13 Thread Răzvan Rotaru
luni, 12 august 2013, 18:34:34 UTC+3, Phillip Lord a scris: > > David Pollak > writes: > > The survey itself is too "flat". It's like asking "do you like red or > > green?" Well... I like green on my walls, but I like red on my ties. > > I'd agree with this. > > "Do you like" is also a relati

Re: ANN Introducing Route One

2013-08-13 Thread Baishampayan Ghose
Curious, how does it differ from Clout? ~BG On Tue, Aug 13, 2013 at 9:38 PM, Michael Klishin wrote: > On behalf of the ClojureWerkz team, I'm happy to announce our not-so-new > project that has recently reached 1.0.0-rc1 stage: Route One [1]. > > Route One is a route generation library compliment

[ANN] Leiningen 2.3.1 released

2013-08-13 Thread Phil Hagelberg
Hello folks. With some help from Nelson Morris I've pushed out the 2.3.1 release of Leiningen. This fixes the self-install issues as well as the issue around AOT classes not being included in jar files. It also adds a new flag (:monkeypatch-clojure-test false) you can use to disable Leiningen's m

Help with Incanter and Emacs

2013-08-13 Thread Akhil Wali
Hi All, A really noob question. Why do I get "FileNotFoundException Could not locate incanter__init.class or incanter.clj on classpath: clojure.lang.RT.load (RT.java:443)" when i load a file that uses incanter in emacs? Here's the file... (ns default.core (:require incanter core charts s

Re: Help with Incanter and Emacs

2013-08-13 Thread Tim Visher
On Tue, Aug 13, 2013 at 1:59 PM, Akhil Wali wrote: > Hi All, > > A really noob question. > > Why do I get "FileNotFoundException Could not locate incanter__init.class or > incanter.clj on classpath: clojure.lang.RT.load (RT.java:443)" when i load > a file that uses incanter in emacs? > Here's th

Re: Help with Incanter and Emacs

2013-08-13 Thread Akhil Wali
Well Here's my project.clj. (defproject someproj "0.1.0-SNAPSHOT" :dependencies [[org.clojure/clojure "1.5.1"] [incanter "1.5.2"]]) Here's my .lein/profiles.clj as well. {:user {:plugins [[lein-ritz "0.7.0"] [compojure-app/lein-template "0.2.7"]] :de

Re: function creation, partial or #()

2013-08-13 Thread Tim Visher
On Tue, Aug 13, 2013 at 8:47 AM, Jay Fields wrote: > Say you have a simple function: (defn do-work [f] (f)) > > When you want to call do-work you need a function, let's pretend we > want to use this function: (defn say-hello [n] (println "hello" n)) > > Which of the following solutions do you pref

Re: ANN Introducing Route One

2013-08-13 Thread Oleksandr Petrov
It actually doesn't do anything Clout does. Latest modifications actually make it 100% complementary to clout, so now you can do: (defroute about "/about")(defroute documents "/docs/:title") (compojure/defroutes main-routes (compojure/GET about-template request (handlers.root/root-page request

Re: Help with Incanter and Emacs

2013-08-13 Thread Tim Visher
And you're connecting to the project how? On Tue, Aug 13, 2013 at 2:11 PM, Akhil Wali wrote: > Well > Here's my project.clj. > > (defproject someproj "0.1.0-SNAPSHOT" > :dependencies [[org.clojure/clojure "1.5.1"] > [incanter "1.5.2"]]) > > Here's my .lein/profiles.clj as well.

Re: Help with Incanter and Emacs

2013-08-13 Thread Akhil Wali
Yes, by nrepl-jack-in. On Tuesday, August 13, 2013 11:54:24 PM UTC+5:30, Tim Visher wrote: > > And you're connecting to the project how? > > On Tue, Aug 13, 2013 at 2:11 PM, Akhil Wali > > > wrote: > > Well > > Here's my project.clj. > > > > (defproject someproj "0.1.0-SNAPSHOT" > > :dep

Re: Searching for Regular Expressions in a file

2013-08-13 Thread JvJ
I had some difficulty with the line seq because I was looking for multi-line patterns. I'll try the char-seq thing. On Monday, 12 August 2013 18:42:18 UTC-7, Joel Holdbrooks wrote: > > You could use *line-seq* which, if I'm not mistaken, is lazy. Then do > your regex search line by line lazily.

Re: Searching for Regular Expressions in a file

2013-08-13 Thread Christian Sperandio
Is the number of lines known and is it fixed? If it is then you can load the file inside a window, don't you? Le 13 août 2013 20:32, "JvJ" a écrit : > I had some difficulty with the line seq because I was looking for > multi-line patterns. I'll try the char-seq thing. > > On Monday, 12 August 20

Re: Help with Incanter and Emacs

2013-08-13 Thread Akhil Wali
Well this is embarrassing. I was having a wrong use syntax >.<. Changed the import line to this and it works. (ns default.core (:use [incanter core charts stats datasets])) Thanks for the help though!! On Tuesday, August 13, 2013 11:57:46 PM UTC+5:30, Akhil Wali wrote: > > Yes, by nrepl-jack

Re: function creation, partial or #()

2013-08-13 Thread John D. Hume
Though in some cases the performance impact could be significant, my concern is readability. My understanding of the concept of partial function application is that it's about supplying some but not all of the arguments. So when I see `partial` in code, I expect more arguments to be supplied later,

Re: Help with Incanter and Emacs

2013-08-13 Thread Tim Visher
LOL. I just realized I'd been missing that all along. It seems like the community is more and more leaning to something like this, just FYI. (ns default.core (:require (incanter [core :refer :all] [charts:refer :all] [stats :

Re: ANN Introducing Route One

2013-08-13 Thread Baishampayan Ghose
That's clearer, thanks! ~BG On Tue, Aug 13, 2013 at 11:51 PM, Oleksandr Petrov wrote: > It actually doesn't do anything Clout does. > Latest modifications actually make it 100% complementary to clout, so now > you can do: > > (defroute about "/about") > (defroute documents "/docs/:title") > > > (

Re: Help with Incanter and Emacs

2013-08-13 Thread Akhil Wali
Ah I see. :use is deprecated since 1.4. And your ns declaration works fine! Kudos! On Aug 14, 2013 12:40 AM, "Tim Visher" wrote: > LOL. I just realized I'd been missing that all along. > > It seems like the community is more and more leaning to something like > this, just FYI. > > (ns default.cor

Re: core.logic - getting good at writing non-terminating programs

2013-08-13 Thread Norman Richards
On Mon, Aug 12, 2013 at 4:03 PM, Mark wrote: > > At run level 6, I get all the permutations of [1 2 3], just as expected. > However, at 7, the program does not terminate and I'd like to understand > why. I feel like I need to constrain the relation between o-h and o better > but I'm not sure wha

Re: Do you like the Clojure syntax?

2013-08-13 Thread Russell Whitaker
Speaking of "the purpose of the poll," what is it? What purpose does an off-list poll serve that an on-list answer doesn't? I'm curious: is this for a school assignment or for an employer or...? R On Tue, Aug 13, 2013 at 10:05 AM, Răzvan Rotaru wrote: [SNIP] > > Liking something is subjective by

Clojure community office hours - Friday Aug 16

2013-08-13 Thread Alex Miller
Hello all, Recently I've been doing various Clojure community related things. In the interest of opening another avenue for interaction, I've scheduled some office hours for questions or conversations about Clojure or its surrounding processes. In scope: - Newbie questions about Clojure - Clojure

Re: [leiningen] [ANN] Leiningen 2.3.1 released

2013-08-13 Thread Phil Hagelberg
Phil Hagelberg writes: > With some help from Nelson Morris I've pushed out the 2.3.1 release of > Leiningen. This fixes the self-install issues as well as the issue > around AOT classes not being included in jar files. It also adds a new > flag (:monkeypatch-clojure-test false) you can use to dis

calling java static member using string?

2013-08-13 Thread Daniel Meneses Báez
Hi :) I really want to know if there is a way to do this: (ns ... (:import [java.util Calendar])) (defsomething ;; if it is possible using a macro I'm ok with that calendar-member [member] (symbol (str "Calendar/" member))) what I want to know if an instance of Calendar "isMonday",

Re: calling java static member using string?

2013-08-13 Thread Daniel Meneses Báez
ok I'm trying CompilerException java.lang.NoSuchFieldException: s, compiling:(NO_SOURCE_PATH:1:1) user> (defmacro is [s instant] `(= (.get ~instant Calendar/DAY_OF_WEEK) (. Calendar ~s))) #'user/is user> (is 'TUESDAY (Calendar/getInstance)) CompilerException java.lang.RuntimeE

Re: [ANN] Leiningen 2.3.1 released

2013-08-13 Thread Sean Corfield
Thank you! I've upgraded our team to 2.3.1, as well as our QA system. So far, no problems. Sean On Tue, Aug 13, 2013 at 10:37 AM, Phil Hagelberg wrote: > > Hello folks. > > With some help from Nelson Morris I've pushed out the 2.3.1 release of > Leiningen. This fixes the self-install issues as

Re: calling java static member using string?

2013-08-13 Thread Sean Corfield
Perhaps clj-time might help you? https://github.com/clj-time/clj-time (ns time.core (:require [clj-time.core :as time] [clj-time.local :as local] [clj-time.predicates :as p])) (p/monday? (time/now)) ;; false (p/tuesday? (time/now)) ;; false (p/wednesday? (time/now)) ;;

Re: core.async channel GUID

2013-08-13 Thread David Pollak
That's what I went with. Thanks! On Wed, Aug 7, 2013 at 4:47 PM, Brandon Bloom wrote: > You can emulate this relatively easily with a pair of > serialize/deserialize functions which read/write to a global atom > containing a map. > > > On Wednesday, August 7, 2013 7:15:55 PM UTC-4, David Pollak

Re: (reduce conj ["A"]) verification from source code...

2013-08-13 Thread Matching Socks
reduce's docstring says, "If coll has only 1 item, it is returned and f is not called." -- -- 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 -

Re: core.async channel GUID

2013-08-13 Thread David Pollak
And here's a blog post about it: http://blog.goodstuff.im/clojure_http_channels On Wed, Aug 7, 2013 at 4:47 PM, Brandon Bloom wrote: > You can emulate this relatively easily with a pair of > serialize/deserialize functions which read/write to a global atom > containing a map. > > > On Wednesday,

Re: ANN Introducing Route One

2013-08-13 Thread Michael Klishin
2013/8/13 Baishampayan Ghose > Curious, how does it differ from Clout? Clout is a route recognition library (URL/path => route). Route One is a route generation library (route => URL/path). -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- -- You received this m