Re: ANN: Clip-test (testing) and Quiddity (custom eval) for Clojure and ClojureScript

2012-10-15 Thread Shantanu Kumar
I pushed out v0.2.0 of both clip-test and quiddity to Clojars. While it's a minor update to clip-test, quiddity got a major set of built- ins in this release. Shantanu On Aug 30, 2:00 am, Shantanu Kumar wrote: > Hi, > > I am happy to announce about two (early-stage yet functional) > libraries: >

Re: Making CLJS output smaller

2012-10-15 Thread David Nolen
On Mon, Oct 15, 2012 at 10:14 PM, Herwig Hochleitner wrote: > When investigating what the closure compiler does with cljs output, I > discovered the following: > > Google closure does not eliminate unused var reads. This means that e.g. a > deftype > > (deftype A []) > > which compiles to > > wor

Re: Evaluating an anonymous function with closure

2012-10-15 Thread Michael Gardner
On Oct 15, 2012, at 7:45 PM, Andy Fingerhut wrote: > For the case of arithmetic on compile-time constants, I believe that many C, > Java, etc. compilers already perform the arithmetic at compile time. Known as "constant folding", yes. -- You received this message because you are subscribed to

Making CLJS output smaller

2012-10-15 Thread Herwig Hochleitner
When investigating what the closure compiler does with cljs output, I discovered the following: Google closure does not eliminate unused var reads. This means that e.g. a deftype (deftype A []) which compiles to workbench.foo.A = (function (){ snip }); workbench.foo.A; // <-- beca

Re: Evaluating an anonymous function with closure

2012-10-15 Thread Jim - FooBar();
On 16/10/12 01:45, Andy Fingerhut wrote: On Oct 15, 2012, at 5:41 PM, Jim - FooBar(); wrote: On 15/10/12 22:44, Alan Malloy wrote: You add the numbers at compile time, and then time how long it takes to...do nothing to them, at runtime. You are comparing N to zero, not to some smaller factor o

Re: Evaluating an anonymous function with closure

2012-10-15 Thread Andy Fingerhut
On Oct 15, 2012, at 5:41 PM, Jim - FooBar(); wrote: > On 15/10/12 22:44, Alan Malloy wrote: >> >> You add the numbers at compile time, and then time how long it takes >> to...do nothing to them, at runtime. You are comparing N to zero, not >> to some smaller factor of N. >> > > yes but this se

Re: Evaluating an anonymous function with closure

2012-10-15 Thread Jim - FooBar();
On 15/10/12 22:44, Alan Malloy wrote: On Oct 15, 1:07 pm, "Jim - FooBar();" wrote: On 15/10/12 19:42, Ben Smith-Mannschott wrote: If the distinction I'm trying to make is not clear to you, I'd suggest having a look athttp://www.infoq.com/presentations/Clojure-Macros (It does a good job explor

Re: Inconsistent Exceptions

2012-10-15 Thread JvJ
I just found out that my clojure project is using jre7, while the other project is using jre6. That probably has something to do with it. On Monday, 15 October 2012 19:17:26 UTC-4, JvJ wrote: > > I'm having a peculiar issue with Java interop. > > I'm running a program in 2 different ways: > -Run

Inconsistent Exceptions

2012-10-15 Thread JvJ
I'm having a peculiar issue with Java interop. I'm running a program in 2 different ways: -Running the program directly -Calling the main function from Clojure Oddly, by calling main from Clojure, I get an exception that isn't there when I run normally: UnsupportedOperationException This parser

Re: ritz / nrepl.el / cljsbuild auto / cljsbuild repl-listen ... in same session?

2012-10-15 Thread Timothy Washington
Oh this is great. Thanks for the feedback. I tried the "*M-x nrepl-ritz-lein *" command. But I got this error eventhough I definitely have cljsbuild in my project. lein trampoline cljsbuild repl-listen ;; ( "*lein cljsbuild repl-listen*" also fails ) 'cljsbuild' is not a task. See 'lein help'. Sup

Re: core.match and AOT

2012-10-15 Thread David Nolen
On Mon, Oct 15, 2012 at 5:09 PM, Paudi Moriarty wrote: > It's broken since alpha10, alpha9 works fine. > > Paudi > That's useful to know, thanks :) I suspect it may have something to do with the predicate stuff I added. David -- You received this message because you are subscribed to the Googl

Re: contributor process stalled for me

2012-10-15 Thread Matthew Kennedy
All taken care of now. Matt On Monday, October 15, 2012 12:07:18 PM UTC-5, Matthew Kennedy wrote: > > Hello, I am listed as a contributor and would like to begin submitting > patches and discussing things on clojure-dev, however I haven't been able > to join the clojure-dev mailing list or log

Re: Evaluating an anonymous function with closure

2012-10-15 Thread Alan Malloy
On Oct 15, 1:07 pm, "Jim - FooBar();" wrote: > On 15/10/12 19:42, Ben Smith-Mannschott wrote: > > > If the distinction I'm trying to make is not clear to you, I'd suggest > > having a look athttp://www.infoq.com/presentations/Clojure-Macros (It > > does a good job exploring these kinds of distinct

Re: core.match and AOT

2012-10-15 Thread Paudi Moriarty
It's broken since alpha10, alpha9 works fine. Paudi On Sunday, 14 October 2012 18:19:28 UTC+1, David Nolen wrote: > > On Sat, Oct 13, 2012 at 6:43 PM, Michael > > wrote: > > core.match is alpha and has the following documentation note: > > > > "if your project depends on AOT do not use core.m

Re: ritz / nrepl.el / cljsbuild auto / cljsbuild repl-listen ... in same session?

2012-10-15 Thread Hugo Duncan
Timothy Washington writes: > I have a ritz and nrepl.el session running. I'd also like to be able to > > *i)* auto compile cljs ("lein cljsbuild auto") and > *ii)* have a browser repl ("lein trampoline cljsbuild repl-listen") in the > same session. The latest ritz has a M-x nrepl-ritz-lein comma

How to represent trees for use with zippers

2012-10-15 Thread Dave Kincaid
I stumbled across the clojure.zip library today which looks extremely useful for working with trees. The only problem is I can't figure out how to represent a tree as a vector so that the zipper will have the correct structure. For example say I want to work with this tree:

Re: Evaluating an anonymous function with closure

2012-10-15 Thread Jim - FooBar();
On 15/10/12 19:42, Ben Smith-Mannschott wrote: If the distinction I'm trying to make is not clear to you, I'd suggest having a look athttp://www.infoq.com/presentations/Clojure-Macros (It does a good job exploring these kinds of distinctions as it's vital to have an accurate mental model of how

Re: Evaluating an anonymous function with closure

2012-10-15 Thread Jonathan Fischer Friberg
I agree with Lee. Everything that works in standard clojure should also work in an eval. Jonathan On Mon, Oct 15, 2012 at 8:11 PM, Lee Spector wrote: > On Oct 15, 2012, at 12:51 PM, Alan Malloy wrote: > > > Evaluating function literals is not intended to work; that it works > > for non-closure

Re: Evaluating an anonymous function with closure

2012-10-15 Thread Lee Spector
On Oct 15, 2012, at 2:42 PM, Ben Smith-Mannschott wrote: > > I think you're confusing: > > (eval (list '(fn [x] x) 1)) > > with: > > (eval (list (fn [x] x) 1)) > > In both cases, eval is being passed a list of two items. The first > element of the list differs, however: > > In the first case

Re: Evaluating an anonymous function with closure

2012-10-15 Thread Ben Smith-Mannschott
On Mon, Oct 15, 2012 at 8:11 PM, Lee Spector wrote: > On Oct 15, 2012, at 12:51 PM, Alan Malloy wrote: > >> Evaluating function literals is not intended to work; that it works >> for non-closure functions should be treated as a coincidence. > > Really? Eval "Evaluates the form data structure (not

Re: Evaluating an anonymous function with closure

2012-10-15 Thread Lee Spector
On Oct 15, 2012, at 12:51 PM, Alan Malloy wrote: > Evaluating function literals is not intended to work; that it works > for non-closure functions should be treated as a coincidence. Really? Eval "Evaluates the form data structure (not text!) and returns the result." Why would certain things lik

files, filenames and datomic

2012-10-15 Thread Brent Millare
After seeing the release of codeq, it got me thinking about making my own database app for analyzing other types of text files, images, pdfs etc. There are a few issues though with regards to dealing with the files. Currently, I think its best to just store a reference to the file in the datomi

Help fund my trip to the conj

2012-10-15 Thread Anthony Grimes
It's that time again, folks. Some poor sucker is asking for help to get to this wonderful conference in its third year. Turns out, I found out a few days ago that Carin Meier was unable to go and wanted to donate her ticket to me! Unfortunately, I had no intentions of making it this year and had

contributor process stalled for me

2012-10-15 Thread Matthew Kennedy
Hello, I am listed as a contributor and would like to begin submitting patches and discussing things on clojure-dev, however I haven't been able to join the clojure-dev mailing list or log into dev.clojure.org. The clojure-dev mailing list shows "membership is pending" and although I have an a

Re: CDS progress report, week 1

2012-10-15 Thread Wes Freeman
I've been watching the repo. Thanks for all the effort on this, guys. Wes On Mon, Oct 15, 2012 at 12:07 PM, Michael Klishin < michael.s.klis...@gmail.com> wrote: > ## TL;DR > > The Clojure documentation project [1] started off quite actively. With > several new guides and a dozen of contributors

Re: ANN: Clojure 1.3 and 1.4 Cheat Sheet v7

2012-10-15 Thread Steffen Panning
This is just great, I'm relatively new to cojure and somehow I never saw this until now. This will speed up my coding a lot. Thanks Steffen On Monday, October 15, 2012 4:17:35 AM UTC+2, Andy Fingerhut wrote: > > My recent updates prompted me to go through my to do list of enhancement > ideas f

Re: Evaluating an anonymous function with closure

2012-10-15 Thread Alan Malloy
Evaluating function literals is not intended to work; that it works for non-closure functions should be treated as a coincidence. On Oct 15, 2:19 am, Gergely Szabó wrote: > Hello, > > could someone please explain the behavior that is shown in the gist below? > > https://gist.github.com/3891587 >

Re: Evaluating an anonymous function with closure

2012-10-15 Thread Alan Malloy
Evaluating function literals is not intended to work; that it works for non-closure functions should be treated as a coincidence. On Oct 15, 2:19 am, Gergely Szabó wrote: > Hello, > > could someone please explain the behavior that is shown in the gist below? > > https://gist.github.com/3891587 >

CDS progress report, week 1

2012-10-15 Thread Michael Klishin
## TL;DR The Clojure documentation project [1] started off quite actively. With several new guides and a dozen of contributors, the resource is already quite useful to newcomers to the language. We believe this is directly related to our straightforward contribution process. ## CDS Progress Repo

Re: Simple way to get image from url

2012-10-15 Thread Dave Ray
Something like this perhaps: (with-open [in (clojure.java.io/input-stream "http://google.com/favicon.ico";)] (clojure.java.io/copy in (clojure.java.io/file "favicon.ico"))) Dave On Mon, Oct 15, 2012 at 6:23 AM, AtKaaZ wrote: > => (use 'clj-http.client) > nil > => (= (:body (clj-http.client/ge

Evaluating an anonymous function with closure

2012-10-15 Thread Gergely Szabó
Hello, could someone please explain the behavior that is shown in the gist below? https://gist.github.com/3891587 Regards, Gergely -- 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 t

Re: Simple way to get image from url

2012-10-15 Thread AtKaaZ
=> *(use 'clj-http.client)* nil => *(= (:body (clj-http.client/get "http://google.com/favicon.ico"; {:as :steam})) (slurp "http://google.com/favicon.ico";))* true or if you want to save it locally as a file(thanks Apage43): => *(with-open [bodystream (:body (clj-http.client/get " http://google.com

Re: Simple way to get image from url

2012-10-15 Thread Yakovlev Roman
it gets whole session so i guess our data in :body and then what to do with that array I need something like a curl: curl http://example.com/img.jpg > img.jpg get file via url and put it to local directory... понедельник, 15 октября 2012 г., 13:08:45 UTC+4 пользователь dennis написал: > > I think

Re: Correct usage of data-readers

2012-10-15 Thread Justin Kramer
Hi Dave, The "conflicting" reader issue is fixed in the Clojure 1.5 master branch. Using data readers in a lib is perfectly acceptable as long as you namespace qualify your tags, as the docs mandate: "Reader tags without namespace qualifiers are reserved for Clojure". See (doc *data-readers*).

Re: Simple way to get image from url

2012-10-15 Thread Yakovlev Roman
slurp works with text only as i know On Monday, October 15, 2012 2:29:41 PM UTC+4, Andreas Liljeqvist wrote: > > Haven't got access to my tools, but couldn't you just slurp it? > > (slurp "http://somesite/picture.jpg";) > > On Mon, Oct 15, 2012 at 11:08 AM, dennis zhuang > > > wrote: > >> I thin

Re: ANN: ClojureScript release 0.0-1503

2012-10-15 Thread Murphy McMahon
Yes, thanks so much. Awesome progress being made. M On Mon, Oct 15, 2012 at 4:35 AM, Wei Hsu wrote: > Thanks for the hard work guys! > > > On Sunday, October 14, 2012 3:06:24 PM UTC-7, Stuart Sierra wrote: >> >> Available in the Maven Central Repositories: >> >> >> http://search.maven.org/#artifa

Correct usage of data-readers

2012-10-15 Thread Dave Sann
Hi all, Are there any solid docs/ideas for effective usage of data-readers and data_readers.clj? Currently, as I understand it data_readers.clj is placed in the root src folder for a project. This worked nicely, however, I do get an error with lein giving "conflicting readers" if I have data_

Re: Simple way to get image from url

2012-10-15 Thread Andreas Liljeqvist
Haven't got access to my tools, but couldn't you just slurp it? (slurp "http://somesite/picture.jpg";) On Mon, Oct 15, 2012 at 11:08 AM, dennis zhuang wrote: > I think you can use clj-http: > https://github.com/dakrone/clj-http > > (client/get "http://site.com/favicon.ico"; {:as :byte-array}) >

Simple way to get image from url

2012-10-15 Thread Yakovlev Roman
Hi I am pretty new to java world so as i found there is no simple way to get image file from url like : http://example.com/image.jpg. What i need just to get file from url and store it to db. So we need to use buffer, stream and stuff to get file. I found this code but i guess there is a way to g

Re: ANN: ClojureScript release 0.0-1503

2012-10-15 Thread Wei Hsu
Thanks for the hard work guys! On Sunday, October 14, 2012 3:06:24 PM UTC-7, Stuart Sierra wrote: > > Available in the Maven Central Repositories: > > > http://search.maven.org/#artifactdetails%7Corg.clojure%7Cclojurescript%7C0.0-1503%7Cjar > > Complete change log: > > http://build.clojure.org/job