Re: how to get good at clojure?

2012-05-11 Thread Daniel Gagnon
On Mon, May 7, 2012 at 8:48 PM, toan wrote: > Hi folks, > > I've been trying to learn clojure for a while. I've read the clojure > section of "seven languages..." and currently trying to get through > "joy of clojure." I've been practicing with the prompt a bit and > trying to learn emacs that ca

Re: Using the Clojure Logo

2012-03-29 Thread Daniel Gagnon
> > As far as I know the Clojure logo is not currently trademarked. > You can have a trademark without registering anything (registration is somewhere between $200 and $300 in the US, I forgot the exact amount), it's just harder to demonstrate without a registration than copyright. -- You receiv

Re: Using the Clojure Logo

2012-03-29 Thread Daniel Gagnon
> > First of all, one only has to police unauthorized use of the > trademark. One can authorize its use under particular circumstances, > and then those uses don't need to be policed to avoid losing the > trademark. > > That's at the heart of trademark law. A trademark is a form of "Proof of origin

Re: Using the Clojure Logo

2012-03-28 Thread Daniel Gagnon
On Wed, Mar 28, 2012 at 1:40 PM, Chip Collier wrote: > I was also intending on using the logo in such a way to communicate that > a site I'm building is "powered by clojure" or something to that effect > with a link to clojure.org. Is that frowned upon? > > Chip Unfortunately, trademark laws ar

Re: Has anyone solved the zebra/einstein puzzle using core.logic?

2012-03-23 Thread Daniel Gagnon
> > > p.s: If someone thinks that the zebra puzzle is too complicated as a first > example please don't hesitate to say so...I recently purchased "the > reasoned schemer" (hasn't arrived yet) which hopefully explains things at a > good pace. > > It's actually pretty simple. Take a look at the Prolo

Re: Clojure code optimizer

2012-03-21 Thread Daniel Gagnon
> > This isn't a big issue, as recursive functions aren't much advised in > Clojure. However, ideal solution would be to detect tail calls and rewrite > block in loop/recur combo. This would allow Clojure to fully reuse TCO > without waiting for JVM to implement it (which will probably never happen

Re: A New Core.logic Primer

2012-03-15 Thread Daniel Gagnon
On Thu, Mar 15, 2012 at 3:08 PM, Sean Corfield wrote: > On Thu, Mar 15, 2012 at 10:49 AM, David Nolen > wrote: > >> > It's a convention from The Reasoned Schemer. It's just an easy way to > >> > differentiate goals from regular functions. > > What's the rationale in TRS for that? (and "conde") Li

Re: A New Core.logic Primer

2012-03-15 Thread Daniel Gagnon
Could this tutorial explain the foremost question people have when seeing core.logic: why is o appened to the names of all those functions? -- 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 N

Re: A New Core.logic Primer

2012-03-14 Thread Daniel Gagnon
> > >> Dan, you probably read that recently about Datalog, while you were > reviewing Datomic. Ain't that right? :) > > I didn't check out Datomic yet. I'll do that soon. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send emai

Re: A New Core.logic Primer

2012-03-14 Thread Daniel Gagnon
On Wed, Mar 14, 2012 at 3:00 PM, David Nolen wrote: > Thanks to Edmund Jackson we have a new primer for core.logic: > https://github.com/clojure/core.logic/wiki/A-Core.logic-Primer > > Feedback appreciated! > > David > It's pretty good and I think it's very accessible. If you compare to Learn Pr

Re: [ANN] clojure-py 0.1.0 Clojure on Python

2012-03-12 Thread Daniel Gagnon
On Wed, Mar 7, 2012 at 10:42 PM, Timothy Baldridge wrote: > The Clojure-Py team is happy to announce the release of Clojure-Py 0.1.0. > > https://github.com/halgari/clojure-py > > Clojure-Py is an implementation of Clojure running atop the Python VM. > As it currently stands, we have translated ov

Re: [ANN] clojure-py 0.1.0 Clojure on Python

2012-03-12 Thread Daniel Gagnon
> > Actually Python fractions would work perfectly. And the decimal class > in Python should be included as well. > > Thanks for pointing these libraries out to me! > > Timothy > > No problem. I really like how symbiotic with Python you are making this. -- You received this message because you

Re: [ANN] clojure-py 0.1.0 Clojure on Python

2012-03-11 Thread Daniel Gagnon
On Thu, Mar 8, 2012 at 10:53 AM, Timothy Baldridge wrote: > > What's the plan for ratios and characters? I assume they're still on > > the TODO list? (Maybe Issue 17 covers the ratios?) > > Yeah, I need to run a few more tests, but I'm thinking of somehow > layering libgmp ontop of Python in ord

Re: Clojure in Python

2012-03-02 Thread Daniel Gagnon
> > Well first of all, the real main drive, is that I don't know Java libs > nearly as well as Python libs. Secondly, there's a lot of cruft (imo) > in Clojure that doesn't need to exist in a dynamic VM. For instance, > there's no reason to new up something with (Foo. 1 2). In python > objects are

Could be my favourite improvement in 1.4

2011-12-19 Thread Daniel Gagnon
Allow colon as whitespace in map literals That's a very subtle subtle change but with this it will be easier to experiment with JSON or Python data I want to just grab and paste. That attention to little detail is very appreciated. -- You received thi

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-28 Thread Daniel Gagnon
> > I like CoffeeScript. But CoffeeScript is largely syntactic sugar. Hardly > anything in the way of new semantics. And it encourages traditional stateful > OOP and classical inheritance. > > Underscore.js does what it can, but it's goals are largely trumped by > CoffeeScript. > > David > > Coffee

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-28 Thread Daniel Gagnon
> > Javascript is simply painful to use functionally. The verbosity of > anonymous functions, the lack of crucial HOFs like map/filter/reduce, the > lack of functional data structures, the lack of macros (not strictly a > "functional" feature, but especially useful with functional code)... You can

Java 7 is out!

2011-07-28 Thread Daniel Gagnon
So, what does it means for Clojure? Faster execution? Some new interesting stuff in the standard Java library? And I remember there was something about forkjoin that would be good for Clojure, what about that? -- You received this message because you are subscribed to the Google Groups "Clojure

Silly algorithm

2011-06-17 Thread Daniel Gagnon
I found on Twitter the implementation of the latest stupid algorithm: sleep sort. The idea behind sleep sort is that you sleep in parallel for a number of second equal to the value of each cell and emit them as you finish sleeping. The algorithm is said to run in O(lol^n) The canonical implementat

Google Refine

2011-05-19 Thread Daniel Gagnon
Google just launched and interesting power tool to clean up messy data which you might want to look at: http://code.google.com/p/google-refine/wiki/Screencasts Sounds pretty nifty isn't it? What they do not mention in the screencast (or anywhere else for that matter), is that it comes with cloju

Re: can I force the JIT to be called immediately for certain pieces of code after it starts executing with out waiting for the JVM realize it is necessary....

2011-01-01 Thread Daniel Gagnon
> > > Even if the JVM put the code through the compiler right away, the > resulting code wouldn't be very good because it will have not had time > to profile code to apply the more powerful optimizations. It would be > throwing all of that code away once it has had time to profile the > code, so an

Re: Being "not Lisp" is a feature?

2010-11-22 Thread Daniel Gagnon
On Tue, Nov 16, 2010 at 3:59 PM, wrote: > Daniel Gagnon wrote .. > > I spoke to the guys on reddit. They said it is tongue-in-cheek. > > > They have no knowledge of functional programming > > ??? > > > but strongly feel it isn't suited to their field

Re: Being "not Lisp" is a feature?

2010-11-16 Thread Daniel Gagnon
I spoke to the guys on reddit. They said it is tongue-in-cheek. They have no knowledge of functional programming but strongly feel it isn't suited to their field. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clo

Re: Clojure ensure

2010-09-15 Thread Daniel Gagnon
On Wed, Sep 15, 2010 at 10:44 AM, Stuart Halloway wrote: > Encounter time. I am sitting next to Rich as I write this. > Guaranteed or implementation detail? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojur

Re: Clojure ensure

2010-09-14 Thread Daniel Gagnon
The first one is correct. On Tue, Sep 14, 2010 at 3:22 PM, peter veentjer wrote: > I have got a question about the Clojure ensure and how it actually > works and the documentation doesn't provide enough information. > > I see a few different solutions: > > 1) An optimistic approach: Once a ref is

Re: Lisp/Scheme Style Guide

2010-09-05 Thread Daniel Gagnon
> > I think it would be great if an official "clojure-fmt" tool existed. > I have no interest in forcing people to use it who don't want to. But > I think it would set a great baseline for IDEs and would be helpful to > the people and teams who like having coding standards. I would be one > of a

Re: Can Clojure compile a source-file? How does it do it?

2010-09-05 Thread Daniel Gagnon
On Sun, Sep 5, 2010 at 5:11 PM, Stuart Sierra wrote: > Clojure compiles sources to Java ".class" files. To create a .class > file that can be run at the command line, you need a namespace with a > (:gen-class) directive and a function named "-main". Here's an > example: > I think the question wa

Re: Lisp/Scheme Style Guide

2010-09-05 Thread Daniel Gagnon
> >a) Python doesn't really have this problem > Python doesn't have this problem because the canonical style is define by PEP 8 and Pythonistas love simplicity through conventions. PEP 8: http://www.python.org/dev/peps/pep-0008/ I think it's actually a great feature of the language, I almost

Re: What is reference?

2010-08-16 Thread Daniel Gagnon
On Mon, Aug 16, 2010 at 11:54 AM, HB wrote: > Excellent explanation, thanks Nicolas :) > Are Refs unique to Clojure or they exist in all Lisps? > > They are a big part of why Clojure was created in the first place. -- You received this message because you are subscribed to the Google Groups "Cl

Re: AOT compilation and calling Clojure from Java

2010-08-15 Thread Daniel Gagnon
> > > Any suggestions? > > Can you run: javap YourClass.class and give us the result? -- 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 - plea

Re: Basic Lisp Compiler: How to tell which functions to compile?

2010-08-09 Thread Daniel Gagnon
As far as I know, the book "Lisp In Small Pieces" should be a tremendous help for anyone who builds a Lisp interpreter or compiler. You might want to check it out. On Mon, Aug 9, 2010 at 2:21 PM, CuppoJava wrote: > Thanks for the reply Jarkko. That helps quite a lot. I have some hacks > in place

Re: Keywords also have a literal syntax

2010-08-03 Thread Daniel Gagnon
On Wed, Aug 4, 2010 at 1:33 AM, vishy wrote: > What does it mean? Does it mean that :hello itself is a value,so we > call it literal syntax.Also, this form of vector [1 2 3] is also > literal syntax. > A vector evaluates all of its arguments. If I write [1 2 (+ 1 2)], I'll get the same vector

Re: Running on .Net

2010-08-03 Thread Daniel Gagnon
What I'd like is easy instructions for going from zero to repl so I can try it out. -- 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 b

Re: Records can't be treated as functions anymore

2010-08-03 Thread Daniel Gagnon
> > > Hi BG, > It is a common mistake to think that callability, corresponding to the > clojure.lang.IFn interface, is part of the persistent map contract > (I've done it myself, as did many others a Conj labs :). It is not. It > is actually just a feature of clojure.lang.PersistentHashMap (and the

Re: Leiningen 1.2.0 released!

2010-07-21 Thread Daniel Gagnon
On Tue, Jul 20, 2010 at 9:51 AM, Phil Hagelberg wrote: > On Mon, Jul 19, 2010 at 3:00 PM, Daniel Gagnon > wrote: > > By the way, what's left to do for the Windows support to stop being > > experimental? > > Mostly we need volunteers to port the changes from the ba

Re: Leiningen 1.2.0 released!

2010-07-19 Thread Daniel Gagnon
Impressive list of new features! By the way, what's left to do for the Windows support to stop being experimental? -- 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

Re: Clojure noob: refactoring factorial code

2010-07-15 Thread Daniel Gagnon
There's no reason to recur at all: (defn factorial [n] (reduce * (range 1 (inc n On Thu, Jul 15, 2010 at 9:49 AM, Frederick Polgardy wrote: > You don't need to recur to another function, just recur to a loop: > > (defn factorial [n] > (loop [x n acc 1] >(if (zero? x) acc (recur (dec x)

Re: Idiomatic Clojure namespace names

2010-07-07 Thread Daniel Gagnon
> > > Why would you ever type that more than once? Just use :as. > > Because you use it in more than one file / project. -- 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

Re: Link to API document in the cheat sheet

2010-07-04 Thread Daniel Gagnon
And uses '() for an empty list while () is more idiomatic. On Sun, Jul 4, 2010 at 1:48 PM, ataggart wrote: > The cheatsheet is out of date (e.g., still has 'lazy-cons, old meaning > of 'next). > > > On Jul 2, 2:11 pm, ngocdaothanh wrote: > > Hi, > > > > This is my nth attempt to learn Clojure.

Re: Managing the classpath

2010-07-01 Thread Daniel Gagnon
That's really convenient to know! I just symlinked clojure.jar to /usr/share/java where all the java jars are on k/ubuntu and now I just have to have those two lines in my .bashrc file: export CLASSPATH=.:/usr/share/java/* alias clj="rlwrap java clojure.main" On Thu, Jul 1, 2010 at 10:29 AM, Laur

Re: Record bug?

2010-06-29 Thread Daniel Gagnon
ements IFn (for using an instance as a > function). > > On Tue, Jun 29, 2010 at 9:16 PM, Daniel Gagnon > wrote: > > Under the latest snapshot of the equiv branch (07f05862c2), if I create a > > record: > > (defrecord MyRecord [foo bar baz]) > > and then create a r

Record bug?

2010-06-29 Thread Daniel Gagnon
Under the latest snapshot of the equiv branch (07f05862c2), if I create a record: (defrecord MyRecord [foo bar baz]) and then create a record out of it: (def x (MyRecord. 1 2 3)) I can use a keyword as a function to get the data: (:foo x) 1 But if I use the record as a function like I would f

Re: Clojure's n00b attraction problem

2010-06-28 Thread Daniel Gagnon
On Tue, Jun 29, 2010 at 12:39 AM, Brent Millare wrote: > While I agree his wording wasn't really the best, I think it can also > be interpreted differently depending on what kind of n00b he is > talking about. Your wording isn't much better or maybe it's the idea underneath that doesn't sit righ

Re: Clojure's n00b attraction problem

2010-06-28 Thread Daniel Gagnon
> > If folks find the Java stack intimidating, maybe Clojure isn't for > them? Lots of language run on the JVM and they all require some basic > knowledge of classpaths, build tools and existing IDEs such as > Ecliper, NetBeans, IntelliJ etc. If folks are new to all that, I don't > think it's Cloju

Re: Clojure's n00b attraction problem

2010-06-28 Thread Daniel Gagnon
> > 1. you don't have to worry about PYTHONPATH for a while with a > standard install, although the day will come > 2. you have to understand the difference between class files and jars > (PATH vs PATH/*) > > No, you never have to.It's taken care of by virtualenv. -- You received this message bec

Re: Clojure's n00b attraction problem

2010-06-28 Thread Daniel Gagnon
> > Wrong/Misinformed ideas: > - Clojure 1.1 is not out of date. While it may seem to an outsider that you > need to be on 1.2 you would be very wrong. 1.2 certainly brings great things > to the table but they are built upon having a good understanding of what > currently exists in 1.1. Staying off

Re: Clojure's n00b attraction problem

2010-06-28 Thread Daniel Gagnon
> > > Is this what you're reallying advocating Clojure to become- Basic 2.0? > > Brian > > Clojure the language is nice and very teachable. But the environment around it is an ogre (it has layers). No one argued anything about changing clojure-the-language to be more newb-friendly, only clojure-se

Re: the joys of lisp

2010-06-28 Thread Daniel Gagnon
> > > I actually agree with you that the typical block of lisp code is less > readable than the typical block of python. It bugs me when lisp > advocates present s-expr syntax as the "right" way instead of the > engineering tradeoff that it is. This is mostly due to Python's "There is only one ob

Re: Clojure's n00b attraction problem

2010-06-28 Thread Daniel Gagnon
> > I'm not so sure. Certainly things like the poignant guide made getting > started with Ruby easier, but I'd argue that the success of Ruby has a > lot more to do with how simple the core language it is and how easy it > makes it to get simple things done. I'd argue it's both. Yes the language

Re: Clojure's n00b attraction problem

2010-06-28 Thread Daniel Gagnon
> > > And that makes them impossible to use for Clojure? Not as nice, I'll > admit- but welcome to the bleeding edge. > > They don't automatically deal with CLASSPATH and all that kind of issues either. Clojure lacks clear instructions that you can follow to the letter to get you started. Once yo

Re: Clojure's n00b attraction problem

2010-06-28 Thread Daniel Gagnon
> > > What editors do they use? > > Komodo, TextMate, IDLE, Eric, Wing, etc. > And is there a reason that the same editors can't be used for Clojure? > > They don't have clojure language packs. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To pos

Re: Clojure's n00b attraction problem

2010-06-28 Thread Daniel Gagnon
What we need is this (but for clojure): http://learnyouahaskell.com/ I believe that the success of ruby is due in great part to *Why's Poignant Guide to Ruby* and *Learn You a Haskell* is doing the same for Haskell. It's fun to read, it holds your hand in setting up everything you have to and it m

Re: Clojure's n00b attraction problem

2010-06-28 Thread Daniel Gagnon
> > > This is the question I had on the blog post- what is meant by a "newbie"? > Specifically, what sort of newbie is Clojure wanting to attract? One of the > "complaints" the original poster had was that you had a choice of editors. > Of the pool of potential Clojure users, how many of them are

Re: Clojure's n00b attraction problem

2010-06-28 Thread Daniel Gagnon
On Mon, Jun 28, 2010 at 2:26 PM, cageface wrote: > As I said in the HN thread, I think you're right that getting started > with a productive clojure environment is harder than it has to be. > > However, as I also said in the thread, I think the *real* obstacles > for a noobie are the concepts in

Re: the joys of lisp

2010-06-28 Thread Daniel Gagnon
> > So in order to make this work in Python the *entire* standard library > had to be modified to support it? That's worse than I thought. > > Only the objects that made sense with the use of with. > > The python approach is superior if you believe, as Guido apparently > does, that the useful set

Re: the joys of lisp

2010-06-28 Thread Daniel Gagnon
On Sun, Jun 27, 2010 at 2:58 PM, cageface wrote: > When I read about new "features" in other languages that would be > simple macros in Lisp I just have to smile: > http://docs.python.org/dev/reference/compound_stmts.html#with > > That feature would *not* be a simple macro. It isn't simply a call

Re: Duplicate key bug in hash-maps

2010-06-25 Thread Daniel Gagnon
> > > Apparently, duplicate keys in sets are only disallowed in set > literals. Arguably, that must be a mistake on the users part, but > it sure seems to clash with the behavior of sets elsewhere. > > Why would you ever want to write a duplicate in a set literal? -- You received this message bec

Re: State of Clojure web development

2010-06-24 Thread Daniel Gagnon
I don't use Clojure for web development and I thought sharing why could be useful too. For web development, my favourite tool is Django. It comes as a fullstack framework which means I have everything I need out of the box. Templates, caching, ORM, a kick-ass autogen

Re: I am unclear on how I can call an Ifn stored in a map usefully

2010-06-22 Thread Daniel Gagnon
> >user=>(def current* (merge (uhoh* :event)(why* :event))) >#'user/current* > > here's my problem: > >user=> current* >{:stuff "ELI", :date #user$fn__2...@4fa3551c>, :name "EOW"} > > I was hoping this kind of a call would yield: > > {:stuff "ELI", :date "Tue 22 Jun 2010 17:

Re: Enhanced Primitive Support

2010-06-22 Thread Daniel Gagnon
> > Lets just make things easy for the > average guy.., > If we base the decision on the average guy not writing high performance numeric apps, then we should also base it on the fact that he does not need more than a long in 99% of cases either as Rich points out. And longs are a much simpler con

Re: Enhanced Primitive Support

2010-06-17 Thread Daniel Gagnon
> > The problem is that it distinctly *not* easy to write fast numeric code in > Clojure. It requires expert Clojure knowledge. On the other hand, the mental > burden for someone who wants BigInts in the new system is very low - you'll > get a trivial to track exception. > > Also, when done, it do