Sample usage of google closure Dialog in clojurescript

2018-02-17 Thread C K Kashyap
Hi all, Could someone please point me to an example usage of goog.ui.* from Clojurescript? I am trying to build an electron utility app to automate some of the mundane tasks at work. I've already done it in clojure - but I think having a "pretty" ui would make it more welcoming to some. Regards, Ka

Re: Using libraries without Lein

2017-11-28 Thread C K Kashyap
Thanks Alex ... just what I was looking for - putting the jars in classpath that is! I'll try out the new tool a little later though. Regards, Kashyap On Tue, Nov 28, 2017 at 2:27 PM, Alex Miller wrote: > Sure. You need a jar for Clojure and a jar for clj-http and then just run > Java with tho

Re: lazy-seq performance

2015-01-02 Thread Sakis K
Thanks for the tips. This indeed looks like an OpenJDK big int poor performance issue. For the reference, the results of two recur-based implementations: user=> (defn fib [n] #_=> (loop [n n a 0N b 1N] #_=> (if (zero? n) a (recur (dec n) b (+ a b) #'user/fib user=> (time (rem (fib 1000

lazy-seq performance

2014-12-31 Thread Sakis K
Hi, Clojure newbie here :) I'm reading "Programming Clojure" by Halloway and Bedra. In the book there is a lazy-seq example of the Fibonacci sequence: (defn lazy-seq-fibo ([] (concat [0 1] (lazy-seq-fibo 0N 1N))) ([a b] (let [n (+ a b)] (lazy-seq

[JOBS] Clojure/Clojurescript Web Developer + CSS/HTML UI Designer

2014-08-11 Thread Alexander K. Hudek
Hi everyone, We have two clojure-related job openings. Best, Alex Clojure/Clojurescript Web Developer DiligenceEngine Inc. is a Toronto-based startup using machine learning to automate legal work. We’re looking for a developer to work on our clojure/clojurescript/om web stack. Our team is sma

Re: subtle om + core.async problems

2014-07-25 Thread Alexander K. Hudek
Could you describe your mixin a bit more? We’ve just written an om component and macro to help clean up go-blocks in cases like these. Several of our components take channels as input from parent components to allow for more sophisticated communication. We’ll post a link to this manager componen

Re: Building clojure compiler in eclipse

2014-05-26 Thread C K Kashyap
Thanks Alex ... I was able to import the whole thing into eclipse "as an ant build project". I am still running into issues but I guess its because of java version ... I have to use 1.6 i think. Regards, Kashyap On Tue, May 27, 2014 at 2:32 AM, Alex Miller wrote: > You also need the Clojure co

Building clojure compiler in eclipse

2014-05-26 Thread C K Kashyap
Hi, I am trying to build clojure using eclipse. After importing all the java sources under clojure/src/jvm into a "java project" I tried to "run" repl as a java application - Upon doing so, loadClassForName in RT.java throws "class not found" exception while trying to load "clojure.core__init.clas

Re: Experiencing extremely slow performance on raspberry pi (model b)

2014-05-12 Thread C K Kashyap
Sounds promising ... I'll give it a shot. Thanks Daniel. Regards, Kashyap On Mon, May 12, 2014 at 4:41 PM, Daniel Barlow wrote: > On 12 May 2014 10:40, C K Kashyap wrote: > > I finally got my robotic vehicle working using raspberry pi. I was > hoping to > > make it do t

Re: Experiencing extremely slow performance on raspberry pi (model b)

2014-05-12 Thread C K Kashyap
uess the standard JDK is a bit a > heavyweight for the raspberry pi. > > I wonder if clojurescript on nodejs might be an easier route? > > > On Mon, May 12, 2014 at 10:40 AM, C K Kashyap wrote: > >> Hi, >> >> I finally got my robotic vehicle working using ras

Experiencing extremely slow performance on raspberry pi (model b)

2014-05-12 Thread C K Kashyap
Hi, I finally got my robotic vehicle working using raspberry pi. I was hoping to make it do tricks using the clojure repl - however, I found that repl took well over 2 minutes to start. Is that normal or are folks seeing better performance? Regards, Kashyap -- You received this message because

Pedestal on Google App Engine (GAE)

2014-04-30 Thread C K Kashyap
Hi,I watched @rkneufeld 's webcast on pedestal recently and it was really nice.I was wondering how I could go about deploying a pedestal based app on GAE. I'd appreciate any pointers very much.Regards,Kashyap -- You received this message because you are subscribed to the Google Groups "Clojure" g

Re: braveclojure problem ( paste into emacs)

2014-04-16 Thread C K Kashyap
Try control y google usually returns good results when I search for emacs stuffs. Regards, Kashyap On Wed, Apr 16, 2014 at 4:27 PM, Roelof Wobben wrote: > Hello, > > I try to learn coljure by using this tutorial: http://www.braveclojure.com > Im now at point 7 : http://www.braveclojure.com/ba

Re: [Video] Game development in Clojure (with play-clj)

2014-04-13 Thread C K Kashyap
+1 nice video On Mon, Apr 14, 2014 at 3:45 AM, Kris Calabio wrote: > Oh great! I guess I must have missed that :P > > > On Sun, Apr 13, 2014 at 3:13 PM, James Trunk wrote: > >> There's a link to a gist of >> core.cljin the video's >> description.

Re: Advice for building backend REST services from scratch using clojure

2014-04-11 Thread C K Kashyap
Just for the record ... I am an emacs fan :) Had been a vim power user for a long time but switched to emacs after the fp bug bit me. Regards, Kashyap On Fri, Apr 11, 2014 at 2:50 PM, Colin Fleming wrote: > you can fight it as hard as you like but you will eventually end up using >> emacs, cloju

using the same middleware (wrap-multipart-params) with different parameters in one app [ring] [compojure]

2014-04-03 Thread K Livingston
I'm trying to dynamically handle the InputStream in file uploads (ring/compojure app via servlet/jetty). I started with two different versions of the wrap-multipart-params, one is basically a NoOp that just returns the file name, and the other echoes the file back. They both work fine indepen

Re: using a custom :store with wrap-multipart-params in ring middle ware

2014-04-01 Thread K Livingston
pojure.handler/site. If you remove that, or use > handler/api instead, or apply the parameter middleware yourself, your code > should work as expected. > > - James > > > On 1 April 2014 19:15, K Livingston > > wrote: > >> Sorry, I just realized there's a

Re: using a custom :store with wrap-multipart-params in ring middle ware

2014-04-01 Thread K Livingston
Sorry, I just realized there's a ring-specific mailing list - apologies for the clutter. Moved: https://groups.google.com/d/topic/ring-clojure/O5HoT-UIWfk/discussion On Tuesday, April 1, 2014 12:02:26 PM UTC-6, K Livingston wrote: > > I'm having trouble using a custom :stor

using a custom :store with wrap-multipart-params in ring middle ware

2014-04-01 Thread K Livingston
I'm having trouble using a custom :store with multipart-params. I thought I did exactly what the documentation indicates, but I'm getting the default behavior. http://ring-clojure.github.io/ring/ring.middleware.multipart-params.html :store- a function that stores a file upload. The functi

Re: [Clojurescript] Way to avoid function call indirection in deftypes?

2012-03-08 Thread Philip K
> > Nope, JavaScript has a terrible notion of truth. What if you want to add > functionality to numbers? Or strings? 0 and blank strings are false-y. > > That said I have a branch where we inline the truth test which does a give > a perf boost on many JS engines. This needs to benchmarked more t

Re: [Clojurescript] Way to avoid function call indirection in deftypes?

2012-03-08 Thread Philip K
I see the rationale now, thanks. One question though, isn't it possible to generate: if (self && self.func) { return self.func(self); } instead of if (truth(truth(self) ? self.func : self)) { return self.func(self); } -- You received this message because you are subscribed to the Google G

[Clojurescript] Way to avoid function call indirection in deftypes?

2012-03-08 Thread Philip K
Right now, when I define a deftype function f the generated js code looks something like: f = function(self, arg) { if (self.func) { return self.func(self, arg); } else { // check if self implements protocol return f._(self, arg); } } This seems like an awful lot of indir

MacOS menu bar time tracker in Clojure

2012-02-20 Thread Philip K
Hey, I just made a text file based menu bar timer tracker as a weekend project in Clojure. It allows for easy task management using your favorite text editor, easy prioritization, time tracking and easy Dropbox integration; it doesn't scale well beyond a single person, but for small projects it ma

Re: CLJS: Checked Arithmetic?

2012-01-28 Thread philip k
I'm not so sure about this, but is it possible to throw an exception when dividing by zero for example? I don't know if exceptions are the right way of dealing with this at all, but at least this would be bringing things more in line with Clojure. On Jan 27, 10:03 pm, David Nolen wrote: > In this

Re: (:require-macros ...) produces empty js file

2012-01-27 Thread philip k
an 27 18:12 ../ -rw-r--r-- 1 phil staff0 Jan 27 18:16 core.js i.e. core.js is empty. Very strange. On Jan 27, 5:16 pm, David Nolen wrote: > On Fri, Jan 27, 2012 at 1:26 AM, philip k wrote: > > Hi, I'm using cljs-watch to cross compile generic Clojure code into > &g

(:require-macros ...) produces empty js file

2012-01-27 Thread philip k
Hi, I'm using cljs-watch to cross compile generic Clojure code into both class files and js files using the latest master Clojurescript checkout; this all works wonderfully until I try to add a (:require- macros ...) directive as follows: // in xyz.base.view (ns xyz.base.view (:require ... (:

bindings & lazy-seq

2011-03-25 Thread Carlos-K
Hi, Why when you create a lazy sequence, you need to do the bindings inside the definition?, e.g., (lazy-seq (binding [*in* in#] <-- some code -->)) As opposed to make the bindings first and call the lazy-seq later, e.g., (binding [*in* in#] (lazy-seq <-- some code -->)) Thanks -

Re: DOM API for Clojure

2011-03-11 Thread K.
Could monads help me to build a pure functional Clojure interface for this while the underlying DOM manipulations would be not pure? -- 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 tha

Re: DOM API for Clojure

2011-03-11 Thread K.
> It's not the DOM API, but take a look at Zippers as an efficient way to > manipulate tree-like structures, including XML. I can see how it could be used to walk the tree but I don't see how it could be used to modify just a few branches / leafs in the tree. Calling zip/root reconstructs the whol

DOM API for Clojure

2011-03-11 Thread K.
Hello, Is there a library to manipulate (create and modify) a XML DOM tree in Clojure? If possible with the "classic" syntax (XML tags represented as Clojure vectors.) I need to keep an instance of a DOM tree in my program and modify it and recreating the whole DOM tree every time would not be ef

java.io.IOException with compile

2011-02-02 Thread K.
Hello, What's wrong with this example? $ cat testlongname/editor/controller/listeners/ swing_test_listeners.clj (ns testlongname.editor.controller.listeners.swing-test-listeners (:use clojure.contrib.monads)) (defn some-long-function-name-abdefghijklmnopqrstuvxwyz- abdefghijklmnopqrstuvxwyz-ab

Re: chunked-seq? is lying?

2010-12-31 Thread Mike K
OK, I understand the difference in behavior between the two maps. But why is chunked-seq? incorrect? user> (take 1 (map #(do (print ".") [%]) (range 100))) ([0]) user> (chunked-seq? (range 100)) false user> (chunked-seq? (map #(do (print ".") [%]) (range 100))) fal

chunked-seq? is lying?

2010-12-31 Thread Mike K
In 1.2, I don't understand why one of the sequences below is chunked, but the other is not. Also, chunked-seq? seems to be lying about the second one. user> (take 1 (map #(do (print ".") [% %2]) (range 100) (range 100))) (.[0 0]) user> (take 1 (map #(do (print ".") [%]) (range 100))) (...

Any demand for ClojureCLR support under slime / emacs?

2010-12-12 Thread Mike K
I really, really want ClojureCLR to play nice with emacs the way Clojure does. I've looked at the swank-clojure sources, but I really don't know enough about the Clojure and ClojureCLR internals to make much headway with this project. Still, I'd love to help out in any way that I can. Is anyone

with-meta vs ^{}

2010-11-22 Thread Mike K
In "Programming Clojure" Stuart Halloway says: It is important to note that the metadata reader macro is not the same as with-meta. The metadata reader macro adds metadata for the compiler, and with-meta adds metadata for your own data: (def ^{:testdata true} foo (with-meta [1 2 3] {:order :ascen

Re: string interpolation

2010-11-20 Thread Mike K
Check out the << macro from clojure.contrib.strint. http://clojure.github.com/clojure-contrib/strint-api.html -- 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 membe

Re: string interpolation

2010-11-20 Thread Mike K
Check out the << macro from clojure.contrib.strint. http://clojure.github.com/clojure-contrib/strint-api.html -- 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 membe

Re: string interpolation

2010-11-20 Thread Mike K
Check out the << macro from clojure.contrib.strint. http://clojure.github.com/clojure-contrib/strint-api.html -- 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 membe

A question regarding map destructuring

2010-11-01 Thread Mike K
This question is a bit abstruse, so please bear with me :-) Here is an example of a function with named arguments and default values from the book "The Joy of Clojure". It uses optional arguments (via &) and map destructuring. (defn slope [& {:keys [p1 p2] :or {p1 [0 0] p2 [1 1]}}] (float (

Re: Best practices for protocols

2010-10-15 Thread K.
> If your protocol functions generally look like : display that data on this > view, then why not leverage multimethods and double dispatch ? I think I choose a misleading example, sorry about that. I'm working mainly with one kind of data, but there a lot of functions. For instance one function

Re: Best practices for protocols

2010-10-15 Thread K.
> "Stop!". When I read this, my mind cries "Alert! potential java-in-clojure > code here !". Sorry I didn't want to frighten you with the words "MVC" and "Clojure" in the same sentence :-). However, I think it's just the right approach to separate the presentation from the logic. I may be wrong an

Best practices for protocols

2010-10-15 Thread K.
Hello, I'm a developping a Swing GUI in Clojure and follow the MVC patterns. The view implements a protocol for displaying data, and another one to register Swing listeners. Callbacks registered with the second protocol only access the UI through the view protocol. Each of this protocol has ~50 f

Re: Is ClojureCLR converging toward a release?

2010-10-11 Thread Mike K
Fantastic! Great job David and everyone else who contributed. Mike -- 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 wi

Re: Is ClojureCLR converging toward a release?

2010-10-11 Thread Mike K
Fantastic! Great job David and everyone else who contributed. Mike -- 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 wi

Re: Is ClojureCLR converging toward a release?

2010-10-11 Thread Mike K
Fantastic! Great job David and everyone else who contributed. Mike -- 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 wi

Re: Is ClojureCLR converging toward a release?

2010-10-04 Thread Mike K
David, Rich: any further updates on this? Mike On Sep 24, 8:24 am, dmiller wrote: >  Just waiting for that person's CA to be processed by Rich. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegr

instance? accepting only one argument

2010-09-30 Thread K.
Hello, Can somebody explains me why the instance? function accepts one argument whereas the documentation states "Usage: (instance? c x)" For instance: user=> *clojure-version* {:interim true, :major 1, :minor 2, :incremental 0, :qualifier "master"} user=> (instance? Integer) false Thanks in a

Re: prn-str and lists

2010-09-29 Thread K.
Ok, I see. The example from http://clojuredocs.org/v/1859 did mislead me and is incorrect. Thanks for your answer. -- 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

prn-str and lists

2010-09-29 Thread K.
Hello, I have some questions about how to use the prn functions. >From the documentation of the prn function: "[...] By default, pr and prn print in a way that objects can be read by the reader [...]" In this case, why does the prn-str function does not quote sequences? For instance (pr-str '(+

Re: Clojure for VS2010

2010-09-25 Thread Mike K
Wow, really cool. I'm looking forward to seeing this! Mike -- 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

Is ClojureCLR converging toward a release?

2010-09-23 Thread Mike K
It was mentioned about six weeks ago that ClojureCLR was mostly 1.2 compatible with a few outstanding issues and a couple dozen failing tests. What is the status now? Is there still an intention of an official binary release with 1.2 level functionality, or has that target been dropped? Thank

Re: why the big difference in speed?

2010-09-19 Thread Mike K
What is the definition of microbench? -- 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 post. To unsubscrib

agents, await and Swing thread

2010-09-06 Thread K.
Hello, I've got a concurrency problem and it's not really clear to me how to solve it. I have a Swing GUI doing a search in background with agents and the results are displayed one after the other, also in background. Here is, largely simplified, how I do it: (defvar- *end-search* (atom false))

Re: For David Miller: ClojureCLR binary distribution?

2010-08-15 Thread Mike K
> I thought it better to just get caught up with all the changes going > into 1.2 before dealing with packaging a set of DLLs, but I could do a > quick zip tonight rather than waiting if that is preferred. No need. It's great to hear you're getting close! Mike -- You received this message b

For David Miller: ClojureCLR binary distribution?

2010-08-15 Thread Mike K
Hi David, I saw some comments recently about a potential binary distribution of ClojureCLR. Do you have any idea as to when you might be targeting this or what level of functionality it might contain? Thanks for all your hard work on this project! I'm very eager to try it out. Mike -- You

Re: : Google Chrome extension for TryClojure (tr y-clojure.org)

2010-06-03 Thread Sina K. Heshmati
Heinz N. Gies wrote: > On Jun 1, 2010, at 22:26 , Sina K. Heshmati wrote: >>> "Heinz N. Gies" said: >>> >>> The DNS is fixed, try-clojure.org is now working too :) >> >> Not anymore! I was actually using it. I missed C-a C-k though. > >

Re: "special form" vs. "macro"

2010-06-01 Thread Sina K. Heshmati
alux wrote: > no special form at all? Cool, I'll have a look. > > Chapter 4.1 and 4.2 actually sit on my desk already since yesterday - > I just didnt read it. I hope I get a chance in the next days. If you have the time and motivation, go for it. Please note that, the wizard book had better be

Re: : Google Chrome extension for TryClojure (tr y-clojure.org)

2010-06-01 Thread Sina K. Heshmati
"Heinz N. Gies" said: > The DNS is fixed, try-clojure.org is now working too :) Not anymore! I was actually using it. I missed C-a C-k though. SinDoc -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group

Re: "special form" vs. "macro"

2010-06-01 Thread Sina K. Heshmati
"alux" said: Hey alux, > what an interesting discussion! Whoo! ;-) > > Many thanks four your comment. > >> So, if you have lazy-eval, there's no need for special-forms. > > This is obviousely correct for if / cond. > > Looking into the other special forms ( http://clojure.org/special_forms >

Re: Datatype Usage Examples

2010-05-31 Thread Sina K. Heshmati
Hi Meikel, Meikel Brandmeyer wrote: > On Mon, May 31, 2010 at 07:34:24AM +0200, Sina K. Heshmati wrote: > >> > (defn make-module >> > [] >> > (let [state (atom 0) >> > say-hello (fn [] (println "Hello")) >> >

Re: Datatype Usage Examples

2010-05-31 Thread Sina K. Heshmati
Meikel Brandmeyer wrote: > On May 31, 3:15 pm, "Sina K. Heshmati" wrote: > >> True but my main concern is security of a running application. >> It could very well be that B is just a bunch of interactions, >> in which case B can enter A's namespace. >

Re: Datatype Usage Examples

2010-05-31 Thread Sina K. Heshmati
Problem solved, see below. Meikel Brandmeyer wrote: > On May 31, 1:46 pm, "Sina K. Heshmati" wrote: > >> Here's my concern: >> >> - My program (A) is running. >> - B is running on the same VM. >> - B accesses the state of A. >> - B alters

Re: Datatype Usage Examples

2010-05-31 Thread Sina K. Heshmati
"Meikel Brandmeyer" said: > On May 31, 10:58 am, "Sina K. Heshmati" wrote: > >> foo.datatype-01 => (reset! state 13) > ^^^ > > Again: of course you can! You are in the same namespace! In Clojure > the "unit" is a namespace

RE: "special form" vs. "macro"

2010-05-31 Thread Sina K. Heshmati
"Sina K. Heshmati" said: > "alux" said: > >> I got a very basic question about the concept of "special form". What >> is correct, multiple selections allowed: >> >> [ ] A special form is what can be implemented by a macro. > >

RE: "special form" vs. "macro"

2010-05-31 Thread Sina K. Heshmati
"alux" said: > I got a very basic question about the concept of "special form". What > is correct, multiple selections allowed: > > [ ] A special form is what can be implemented by a macro. Wrong. Macros cannot remove the need for special-forms, at least not in a real interpreter. In a metaci

Re: Datatype Usage Examples

2010-05-31 Thread Sina K. Heshmati
"Meikel Brandmeyer" said: > On May 31, 9:37 am, "Sina K. Heshmati" wrote: > >> The atomic 'state' doesn't seem to be visible to the datatype methods. The >> question is why? >> >> (defprotocol prot-a >>   (op-a [self x y])

Re: Datatype Usage Examples

2010-05-31 Thread Sina K. Heshmati
Sina K. Heshmati wrote: > Meikel Brandmeyer wrote: >> Am 30.05.2010 um 16:39 schrieb Sina K. Heshmati: >> > I'll later try to see if I can export datatypes from within a closure. The atomic 'state' doesn't seem to be visible to the datatype methods. The

Re: Datatype Usage Examples

2010-05-30 Thread Sina K. Heshmati
Hi Meikel, Meikel Brandmeyer wrote: > Am 30.05.2010 um 16:39 schrieb Sina K. Heshmati: > >> [2] >> http://github.com/sindoc/algorithms/blob/master/src/test/clojure/whiteboard/y2010/hide-adt-state-using-closure.clj > > I'm almost sure, that this code does not what

Re: Datatype Usage Examples

2010-05-30 Thread Sina K. Heshmati
"Adrian Cuthbertson" said: >> That said, I'd rather make sure that my low-level data structures are being >> operated on by only one implementation. > > You could use closures to encapsulate the refs/atoms ... > > (let [car-mem (ref nil)] > (defn set-car-mem [new-car-mem] > (dosync (ref-

Re: Datatype Usage Examples

2010-05-29 Thread Sina K. Heshmati
Krukow wrote: > Sina K. Heshmati wrote: > [snip] >> The only member data _I'm_ able find are the ones that are passed to the >> default >> constructor, namely at the time that the abstraction is reified. What if I'd >> have >> to give create a mem

Re: Datatype Usage Examples

2010-05-28 Thread Sina K. Heshmati
Hi Krukow, Krukow wrote: > SinDoc wrote: >> I was wondering if someone could point me to recent usage examples of >> deftype, defrecord, and reify. Reading [1] helped a lot but it wasn't >> particularly easy to find it since it's not linked from the sidebar. > > Blog: http://blog.higher-order.net

Re: Datatype Usage Examples

2010-05-28 Thread Sina K. Heshmati
Hi Meikel, Meikel Brandmeyer wrote: > SinDoc wrote: >> I was wondering if someone could point me to recent usage examples of >> deftype, defrecord, and reify. Reading [1] helped a lot but it wasn't >> particularly easy to find it since it's not linked from the sidebar. >> >> Specifically, what I'd

Re: ClojureCLR and WPF Data Binding

2010-05-08 Thread Mike K
> Anyone else looking at this sort of thing, or even interested? I'm very interested although I'm not looking at it right now (still taking baby steps learning Clojure while waiting for ClojureCLR to mature a bit) ClojureCLR + WPF / Silverlight is ultimately where I want to go. Thanks for being a

Re: seq-contains? in practice

2010-04-29 Thread Mike K
On Apr 29, 5:10 am, Stuart Halloway wrote: > (There are a few calls to seq-contains? in the test suite for contrib,   > and I wrote all of them. If you write lots of unit tests you already   > know why such calls make sense there.) For those of us who are newbies, would you mind being more expli

Reading properties file the proper way

2010-04-28 Thread K.
Hello, What is the best way to read a property file in a path independent way? I would like to be able to read the file and this regardless of where my clojure program is called from (this must also work if my program is bundled as a jar). clojure.contrib.java-utils/read-properties is nice but it

Comparing NaNs to numbers: (<= NaN x) should be false

2010-04-04 Thread Jouni K . Seppänen
This is with Clojure 1.1.0: user=> (< Float/NaN 1.0) false user=> (<= Float/NaN 1.0) true Both comparisons should yield false. It seems that (<= x y) is implemented by negating the result of (< y x), which is fine for totally-ordered sets, but unfortunately IEEE 754 floating-point numbers do not

Re: Why I have chosen not to employ clojure

2010-03-21 Thread Mike K
> I would appreciate any feedback. According to the readme it requires bash or zsh. Any plans to support windows (without cygwin or other unix emulation)? I agree with Stuart that the user experience should be friendly on all supported platforms. Mike -- You received this message because y

What's an idiomatic translation of this CL data structure?

2010-03-09 Thread Mike K
In PAIP section 2.3, Norvig gives an example of a generative grammar: ;; common lisp (defparameter *simple-grammar* '((sentence -> (noun-phrase verb-phrase)) (noun-phrase -> (Article Noun)) (verb-phrase -> (Verb noun-phrase)) (Article -> the a) (Noun -> man ball woman table)

clojure.core/compare and persistent lists

2010-03-09 Thread K.
Hello, It seems it's not possible to use the clojure.core/compare function with persitent lists : (compare '(1 2) '(3 4)) gives the following error "clojure.lang.PersistentList cannot be cast to java.lang.Comparable" Why don't PersistentLists implement Comparable? It works without problems for

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-07 Thread Mike K
Is anyone familiar with running Maven (and possibly Polygot Maven) on Windows? Does it pretty much work as expected? The learning curve for Maven looks steeper than for Leiningen, but if it makes up for it with better documentation and being better-behaved, then it may be worth it. Mike --

Re: Leiningen, Clojure and libraries: what am I missing?

2010-03-07 Thread Mike K
On Mar 4, 4:32 pm, Glen Stampoultzis wrote: > > Getting swank-clojure going in Windows is also a pain.  To install it the > recommended way via ELPA you need to patch the ELPA source code first.  This > isn't documented at the swank-clojure site either. For others who are struggling with this iss

Re: ClojureCLR and swank-clojure: port to .NET or using IKVM?

2010-03-01 Thread Mike K
Hi Iwan, I'm very interested in this also. I inquired about it in the following thread: http://groups.google.com/group/clojure/browse_frm/thread/2954b1f005663bbf# In short, it appears nobody has attempted this. Unfortunately, I'm too much of a clojure and java newbie to be competent at doing t

ClojureCLR status?

2010-02-25 Thread Mike K
I notice there have been no checkins to ClojureCLR in the last month and a half. Is something big in the works? Is absolutely nothing in the works? :-) If I check out and build the latest sources, how will it compare in terms of functionality to the Clojure main branch? In particular, does it h

Re: Common Lisp's append

2010-02-21 Thread Mike K
Thanks, I ended up using Allegro via Lispbox here. http://www.gigamonkeys.com/lispbox/#download Mike -- 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 ar

Re: Common Lisp's append

2010-02-21 Thread Mike K
On Feb 19, 6:23 am, Chouser wrote: > In Clojure, if you could use conj on a vector but instead use > concat on a list, you'll end up with code that is both > non-idiomatic and runs slower than necessary. I found the exercise of doing the equivalent with Clojure vectors pretty challenging. Give

Common Lisp's append

2010-02-18 Thread Mike K
Hey Clojurians, I'm a Clojure and Common Lisp newbie. I heard that Norvig's PAIP was a good book to study idiomatic CL code, so I've embarked on a project to translate the examples to / work the exercises in Clojure. I hope to complete this project before the end of this century :-) Regarding "a

ClojureCLR under slime / emacs?

2010-02-13 Thread Mike K
Does anyone have ClojureCLR running under emacs via slime? Failing that, can anyone give me some pointers as to how I might hacking swank-clojure.el (or whatever) to get this to work? Mike -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post t

Re: swank-clojure installation failure via ELPA

2010-01-02 Thread Mike K
I'm up and running again. Thank you very much Shawn and Phil! Phil: For the sake of other Windows users, I suggest adding a pointer to the patched package.el in the readme until the issue is resolved. Mike -- You received this message because you are subscribed to the Google Groups "Clojure

Re: swank-clojure installation failure via ELPA

2010-01-02 Thread Mike K
On Jan 2, 12:18 pm, Shawn Hoover wrote: > I believe you're running into the same coding issue that I did with ELPA on > Windows. slime.el declares in its local variables that it has unix line > endings, but ELPA's download process is saving it with windows line endings. > > Here's the pseudopatch

Re: swank-clojure installation failure via ELPA

2010-01-02 Thread Mike K
On Jan 2, 9:13 am, Shawn Hoover wrote: > Hi Mike, > > Is there anything useful going on in *messages*? Here is the contents of *Messages*: Contacting host: tromey.com:80 Reading [text/plain]... 4k of 4k (100%) Reading... done. Reading [text/plain]... 54k of 54k (100%) Saving file c:/mbk/.emacs.d

swank-clojure installation failure via ELPA

2010-01-02 Thread Mike K
Hi all, I'm trying to get all the latest and greatest swank-clojure 1.1.0 goodness via ELPA, but no joy. I'm starting with an absolutely clean slate. I'm running a freshly installed emacs 23.1.1 on Windows 7. I have a blank .emacs file and no elpa subdirectory under .emacs.d. I install elpa an

Loading a .clj file automatically at repl startup?

2009-12-28 Thread Mike K
Is it possible to load a library such as foo.clj (with (ns foo ...) at the top of the file) into the repl automatically at startup, rather than having to (use 'foo) every time the repl starts? I'd like to avoid creating a .jar file. If possible, I'd like to do this both from the command line ("ja

How to explore clojure.contrib?

2009-12-20 Thread Mike K
Is there an API document like http://richhickey.github.com/clojure/index.html for clojure.contrib? If not, what's the best way to discover what's in a library, especially if you have no preconceived notion of what you're looking for? Thanks, Mike -- You received this message because you a

Re: A tale of cond, clauses, and the docs

2009-12-19 Thread Mike K
On Dec 19, 8:27 pm, Sean Devlin wrote: >  :else was chose because it is simply not nil, and therefor always true. I suspected something along these lines soon after I posted. I did some more experimenting and discovered that :foo will work just as well as :else. So if I understand correctly, :e

A tale of cond, clauses, and the docs

2009-12-19 Thread Mike K
What, exactly, is a "clause" in clojure? From seeing the term used in context, I inferred that it meant something along the lines of "a keyword which can optionally be used to change the semantics of a form". Apparently, it means more than that. This is valid clojure: (defn sign [x] (cond (> x

Re: Help! My slime-fu is broken!

2009-12-15 Thread Mike K
lfjd typed on a line by itself. This behavior with the line number reporting is consistent whether in sldb buffers as above or as reported in slime compilation buffers after slime- compile-and-load-file (^C^K). Moreover, if I try to view the source on any of the stack frame lines (v) I simply get an &quo

Re: Help! My slime-fu is broken!

2009-12-15 Thread Mike K
happen that don't make a lot of sense (SLIME with Common Lisp is much more > sensible). > > Beside C-c C-k, it sounds like your setup is in fact working well enough for > you write programs? Absolutely. Having no background with SLIME (in particular not understanding th

Re: Help! My slime-fu is broken!

2009-12-14 Thread Mike K
On Dec 14, 10:40 pm, David Nolen wrote: > While I personally use Emacs+SLIME to do Clojure hacking this is generally a > poor introduction to Clojure for newbies. Clojure is new enough territory > without having to fight with your text editor and the idiosyncracies of > SLIME (SLIME hasn't even be

Re: Help! My slime-fu is broken!

2009-12-14 Thread Mike K
ter-load "slime" '(progn (slime-setup '(slime-repl (add-to-list 'load-path "C:\\Program Files (x86)\\Clojure Box\\slime- cvs") (require 'slime) (slime-setup) > > Annoyingingly, emacs claims "C-c C-k is undefined" when I ask the help

Help! My slime-fu is broken!

2009-12-14 Thread Mike K
and that this is in effect the equivalent of typing the file's contents directly into the repl. There is also ^C^K which the slime menu describes as compile/load file. Annoyingingly, emacs claims "C-c C-k is undefined" when I ask the help system about that binding. In any event, I&

  1   2   >