Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Roberto Mannai
If you're having problems with cygwin, you could use Emacs/lein without it: http://sourceforge.net/apps/wordpress/codesounding/2011/09/29/installing-emacs-24-and-clojure-mode-on-windows-7-step-by-step/ On Tue, Nov 22, 2011 at 8:24 AM, Michael Jaaka wrote: > Well, in plugins i had 1.3.3 but in pro

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
Well, in plugins i had 1.3.3 but in project/dev had 1.2.1 and 1.3.3 so I deleted the 1.2.1. Then tried again to jack-in and got something like this: error in process filter: Opening input file: no such file or directory, /home/mjaaka/tmp/test-project/src/test_project/C:Documents and Settings^Gmjaa

Re: Explanation of with-resource

2011-11-21 Thread Ralph Moritz
Brilliant, thanks Meikel! Quite a complex macro, that. -- 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 po

Re: Clojure on PyPy

2011-11-21 Thread Andrzej
On 11/22/2011 02:10 PM, Timothy Baldridge wrote: So I got thinking about clojure pypy tonight, and got thinking how easy it would be to adapt my old code to run as a interpreter. So I pulled in a few files, implemented a few methods, and I have prototype running (+ 1 2) as interpreted lisp code.

Re: Clojure on PyPy

2011-11-21 Thread Timothy Baldridge
So I got thinking about clojure pypy tonight, and got thinking how easy it would be to adapt my old code to run as a interpreter. So I pulled in a few files, implemented a few methods, and I have prototype running (+ 1 2) as interpreted lisp code. I slapped it up on github...it's ugly, but it's a

Re: Proposal: libraries should have type hints

2011-11-21 Thread Sean Corfield
On Mon, Nov 21, 2011 at 12:50 PM, Alan Malloy wrote: > This is way, way faster than using reflection. And all you need in > order to remove the duplication is a macro that does the hinting for > you: Well, if Clojure/core decide contrib libraries should indeed use conditional code to avoid reflec

Re: clojure.java.io/reader vs clojure.stacktrace/print-cause-trace call

2011-11-21 Thread Sean Corfield
On Mon, Nov 21, 2011 at 3:17 AM, ru wrote: > (clojure.stacktrace/print-cause-trace e) > > gives me an error message during compilation: > > java.lang.RuntimeException: java.lang.ClassNotFoundException: > clojure.stacktrace ! You need to require the clojure.stacktrace namespace before you can use

Re: Clojure on PyPy

2011-11-21 Thread Brent Millare
On Monday, November 21, 2011 10:28:18 AM UTC-5, tbc++ wrote: > > Rpython is very restrictive. Basically it's garbage collected C++ with > a different syntax. So this means we can't import modules at runtime. > So any additional libraries must be added via C FFI. So as an example, > let's take a l

Re: Proposal: libraries should have type hints

2011-11-21 Thread Alan Malloy
On Nov 21, 12:24 pm, Sean Corfield wrote: > On Mon, Nov 21, 2011 at 8:12 AM, Tassilo Horn wrote: > > But is that really an issue?  I mean, since you cannot use such duck > > typing in Java itself (except in terms of reflection), any method > > defined for more than one class with shared, consiste

Re: Clojure on PyPy

2011-11-21 Thread Timothy Baldridge
>I just don't like the workflow of compiling everything. If I want to use clojure on the comandline i want to write "clojure-pypy mytool.cljp". Does this seam resenable? I was thinking about starting this rather soon. For me it would be a research type project (at least at first). Would anybody c

Re: Clojure on PyPy

2011-11-21 Thread Nick Zbinden
I was thinking about this too. I don't really need Clojure-on-pypy but I want to learn and understand the pypy project. I think that pypy is an extreamly cool project and I want to learn more about it and it would be fun to implment Clojure (and I would finally learn python). The problem Timothy m

Re: Proposal: libraries should have type hints

2011-11-21 Thread Sean Corfield
On Mon, Nov 21, 2011 at 8:12 AM, Tassilo Horn wrote: > But is that really an issue?  I mean, since you cannot use such duck > typing in Java itself (except in terms of reflection), any method > defined for more than one class with shared, consistent semantics is > declared in some common parent cl

Re: A few questions on how to do things in more idiomatic ways

2011-11-21 Thread gaz jones
off top of my head i would probably do something like: 1. (-> some-var (assoc :foo "bar") other-operation and-another) (see threading macros) 2. (update-in some-map [:entry] #(or % (get-new-value))) in particular, im not sure if there is a more idiomatic way On Mon,

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Phil Hagelberg
On Mon, Nov 21, 2011 at 7:03 AM, Chris Perkins wrote: > I think you have an old version of clojure-mode.  The default archive that > comes with package.el is at http://tromey.com/elpa.  It contains an old > clojure-mode. marmalade-repo contains the new version. This confusion has been a long-stan

A few questions on how to do things in more idiomatic ways

2011-11-21 Thread gchristnsn
1. Often I use the following construct: (let [some-var (initial-binding) some-var (some operations (assoc, etc.) using some-var pvevious binding) some-var (some operations using some-var pvevious binding several times)] (more operations on some-var)) This is probably something like

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Chris Perkins
On Monday, November 21, 2011 11:27:04 AM UTC-5, Michael Jaaka wrote: > > Then I entered into Clojure project, used: M-x clojure-jack-in (almost > there!!!) > And got exception: > > Unable to resolve symbol print-doc. > LOL :-) > Any suggestions? > Do you have the latest version of swank-clojure?

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
OK. I have replaced content of package.el with this recommended by http://marmalade-repo.org/ Added (add-to-list 'package-archives '("marmalade" . "http://marmalade- repo.org/packages/")) to .emacs installed clojure-mode, swank etc. Then I entered into Clojure project, used: M-x clojure-jack-in (al

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
Have tried to put in .emacs (when (load (expand-file-name "~/.emacs.d/elpa/package.el")) ) (setq package-archives '( ("marmalade" . "http://marmalade-repo.org/packages/";) ("gnu" . "http://elpa.gn

Re: Proposal: libraries should have type hints

2011-11-21 Thread Tassilo Horn
Herwig Hochleitner writes: Hi Herwig, > In principle you're right. But you have to keep in mind, that type > hints actually alter runtime behavior. > > A hinted call tries to cast its argument into the desired type, > possibly resulting in a type cast exception. An unhinted call, on the > other

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
I have added (add-to-list 'package-archives '("marmalade" . "http:// marmalade-repo.org/packages/")) to .emacs but getting Warning initialziation: An error occured while loading .emacs Symbols value as variable is void: package-archives On Nov 21, 4:03 pm, Chris Perkins wrote: > I'm far from bein

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
The list of clojure- commands decreased to clojure-enable-slime-on- existing-buffers and clojure-mode On Nov 21, 4:03 pm, Chris Perkins wrote: > I'm far from being an expert on this stuff, but I did go through all the > same frustration as you are going through, about 2 years ago, so I'll try >

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
The only available clojure-mode is 1.7.1 The package is 0.9 The package.el I have installed from "http://tromey.com/elpa/package- install.el" I can see also slime in version 20100404, slime-repl in the same and swank-clojure in 1.1.0, the swank-clojure doesn't want to install because clojure-mode-1

ClojureScript new branches - feedback please

2011-11-21 Thread David Nolen
Note that none of the following branches are promises of features. I'm merely bringing them up to get feedback from ClojureScript users: prop-lookup New property syntax so that method calls and property lookup are no longer ambiguous 33-type-fn Nicer printing of types defined via deftype and

Re: Proposal: libraries should have type hints

2011-11-21 Thread Herwig Hochleitner
In principle you're right. But you have to keep in mind, that type hints actually alter runtime behavior. A hinted call tries to cast its argument into the desired type, possibly resulting in a type cast exception. An unhinted call, on the other hand, just looks for the signature. So in essence a

Re: Clojure on PyPy

2011-11-21 Thread Timothy Baldridge
> I find this response the most interesting with respect to the OP's question. > Can you elaborate how you re-define what clojure is? Then assuming we make > no claim on ease of updating or strict adherence to what Clojure is defined > to do, in other words we are making an evolution of ClojureScri

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Chris Perkins
I'm far from being an expert on this stuff, but I did go through all the same frustration as you are going through, about 2 years ago, so I'll try to help. I think you have an old version of clojure-mode. The default archive that comes with package.el is at http://tromey.com/elpa. It contains

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Chris Perkins
"In a project" just means that the active buffer in emacs is a file under the project root. When you do clojure-jack-in, it will start from the current file's directory, and look up through parent directories until it finds a project.clj file. -- You received this message because you are sub

Proposal: libraries should have type hints

2011-11-21 Thread Ralph
I want to propose that Clojure libraries should be fully "type-hinted" -- that is, they should be compiled with the "*warn-on-reflection*" option turned on and type hints place wherever possible. I understand the argument against type-hinting end-user code until a performance problem is demonstrat

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
Already done, some report is a post above your reply. What does the "from inside a project" mean? Do I have to enter in bash to the dir root where is project.clj and run emacs? BTW. For all newbies the C-g is usefull. It aborts any command mode (like C-x C-f). On Nov 21, 3:38 pm, Chris Perkins

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Chris Perkins
On Monday, November 21, 2011 9:27:00 AM UTC-5, Michael Jaaka wrote: > > > now as tutorial on https://github.com/technomancy/clojure-mode states used: > > M-x run-lisp > > > and got Searching for program: no such file or directory, lisp > > > any help? > > > Try using the instructions from the ne

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
I have ran: lein plugin install swank-clojure 1.3.3 from command line clojure-1.2.1 have been installed (why not 1.3.0???) and swank-clojure 1.3.3 later created test-project with: lein new test-project ran: emacs tmp/test-project/src/test_project/core.clj when used: M-x clojure-jack-in got: no ma

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
Manage to install package.el I have put (let ((buffer (url-retrieve-synchronously "http://tromey.com/elpa/package-install.el";))) (save-excursion (set-buffer buffer) (goto-char (point-min)) (re-search-forward "^$" nil 'move) (eval-region (point) (point-max))

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
My Emcas is GNU Emacs 23.3.1 (2011-08-14 on fiona) On Nov 21, 2:30 pm, Michael Jaaka wrote: > Well I thing that I don't have package.el > > Doing > > ;; add to ~/.emacs.d/init.el if you aren't already using Marmalade. > (require 'package) > (add-to-list 'package-archives > '("marmala

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
Well I thing that I don't have package.el Doing ;; add to ~/.emacs.d/init.el if you aren't already using Marmalade. (require 'package) (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/";)) (package-initialize) Didn't change anything. When I open

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread David Nolen
Have you looked at this, http://dev.clojure.org/display/doc/Getting+Started+with+Emacs ? David 2011/11/21 Michael Jaaka > Hmmm... When trying to do > http://riddell.us/ClojureSwankLeiningenWithEmacsOnLinux.html > > especially > > Add the following: > > (defproject test-project "0.1.0" > :descr

Re: Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
Hmmm... When trying to do http://riddell.us/ClojureSwankLeiningenWithEmacsOnLinux.html especially Add the following: (defproject test-project "0.1.0" :description "Test Project" :dependencies [[org.clojure/clojure "1.3.0"] [org.clojure/clojure-contrib "1.2.0"]] :dev-depen

Can't build clojure cloned from github - 2 tests failed - when running from cygwin

2011-11-21 Thread Michael Jaaka
Hi! When running ant command in cygwin on content cloned from http://github.com/clojure/clojure.git I get 2 errors: [java] Testing clojure.test-clojure.java.io [java] [java] ERROR in (test-streams-defaults) (FileOutputStream.java:-2) [java] expected: (= content (do (spit (.toUR

Re: Explanation of with-resource

2011-11-21 Thread Meikel Brandmeyer (kotarak)
Hi, (defmacro with-resources [bindings close-fn & body] (let [[x v & more] bindings] `(let [~x ~v] (try ~(if-let [more (seq more)] `(with-resources ~more ~close-fn ~@body) `(do ~@body)) (finally (~close-fn ~x)) user=> (macroe

Explanation of with-resource

2011-11-21 Thread Ralph Moritz
Hi Clojurians! Please could somebody explain the code highlighted expression below to me? (Adapted from *The Joy of Clojure*, listing 8.9) (defmacro with-resource [bindings close-fn & body] > `(let ~bindings > (try >~@body >(finally > (~close-fn ~(bindings 0))

Re: Probabilistic programming in clojure

2011-11-21 Thread Nils Bertschinger
Hi Julius, good catch, I don't know how I missed that??? Just uploaded a fix ... should work now. Nils On Nov 20, 5:58 pm, Julius Seporaitis wrote: > Hello guys, > > I would like to try out this library, but ran into a problem with Clojure > 1.3, 'lein repl' throws an exception, when: > > *user

Re: Probabilistic programming in clojure

2011-11-21 Thread Nils Bertschinger
Hi Jeff, good idea to move this over to clojure 1.3. I have just included your patch. On Nov 20, 5:32 am, Jeff Rose wrote: > Cool!  I experimented a little bit with Church a while back, but > having something like this in Clojure could be really interesting.  I > don't have much experience with

clojure.java.io/reader vs clojure.stacktrace/print-cause-trace call

2011-11-21 Thread ru
Hello clojure-users, Using API documentation on a page: http://clojure.github.com/clojure/clojure.stacktrace-api.html I am doing different function calls. (clojure.java.io/reader path) works just fine. But, (clojure.stacktrace/print-cause-trace e) gives me an error message during compilation

Re: Literate Programming example

2011-11-21 Thread Thorsten Wilms
On 11/20/2011 11:18 PM, Daniel Jomphe wrote: On Sunday, November 20, 2011 5:50:31 AM UTC-5, thorwil wrote: I'm following one or the other Free Software project where an incredible amount of discussions happen regarding work-flow and features. So much thought, so many decisions on