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

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

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))

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: 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

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

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: 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

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

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

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

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

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: Debugging support for clojure?

2009-03-11 Thread Jerry K
Also, I've not looked at any of the math code in clojure contrib, but expressed as such, I wouldn't expect the idiom "(mod (expt n exp) m)" to be at all fast for reasons largely independent of the numeric implementation underneath. Computing the entire power and then reducing it modulo m is going

Re: Miller-Rabin pseudo-primality test (was: Debugging support for clojure?)

2009-03-12 Thread Jerry K
On Mar 12, 2:45 pm, Tassilo Horn wrote: > Mark Engelberg writes: > > Hi Mark, > > >> For number theory you often need things like > > >>    (mod (expt n exp) m) > > > Yes, and to make things like this fast, the trick is to perform the > > mod at each multiplication step, rather than waiting unti

Re: OutOfMemoryError with loop/recur

2009-09-19 Thread Rosen K
How about: (defn limited-reduce [f coll n] (reduce f (take n coll))) Rosen On Sep 18, 10:52 pm, Patrik Fredriksson wrote: > Hi! > > Could someone please help me understand why the following causes a > java.lang.OutOfMemoryError: Java heap space for large n:s (10 > works fine, 100 do

ClojureCLR questions

2009-12-01 Thread Mike K
Hi Clojurites! I'm reading about Clojure and ClojureCLR with great interest. Since I'm a .net developer with little Java / JVM experience, I'm particularly interested in ClojureCLR. It seems like David M. and crew are doing a fantastic job with the CLR implementation! A few quick questions: 1.

Re: ClojureCLR questions

2009-12-03 Thread Mike K
Thanks for your reply David! On Dec 2, 9:21 pm, dmiller wrote: >  Do you have some specific use cases [for .net attributes]?  That would be > stimulating. One (common?) use case is that a WCF service can't be implemented without support for attributes. I'm a big Python and IronPython fan, so I

lazy sequence question

2009-12-09 Thread Mike K
I'm working my way through "Programming Clojure" and got an unexpected result with sequences: user> (take 10 (filter even? (iterate inc 1))) (2 4 6 8 10 12 14 16 18 20) user> (take-while #(< % 10) (iterate inc 1)) (1 2 3 4 5 6 7 8 9) user> (take 10 (filter #(< % 10) (iterate inc 1))) ; Evaluation

Re: lazy sequence question

2009-12-09 Thread Mike K
On Dec 9, 10:35 pm, Mike K wrote: > The first two work but the third one hangs.  Why? user> (take 5 (filter #(< % 10) (iterate inc 1))) (1 2 3 4 5) OK, I figured out that it won't hang with taking <= 9 elements, which is the total that pass the filter. But shouldn't it g

Re: lazy sequence question

2009-12-09 Thread Mike K
> Neither filter nor take know to abandon their attempt. That's how this   > works. Ah, of course. Thanks Mark and Richard! 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 t

Re: Leiningen in Python

2009-12-11 Thread Mike K
All, I tried to use this script on Windows and it blew up real good! I'm a Clojure, Java, and Leiningen newbie, so perhaps a kind soul can help me out. 1. lein self-install "worked". It downloaded leiningen-1.0.0- standalone.jar. However, that contradicts the description at http://zef.me/2470

Re: Leiningen in Python

2009-12-12 Thread Mike K
I could not get the python script to work, so I switched to the powershell version. I now understand that the leiningen-1.0.0-SNAPSHOT.jar is a so-called "uberjar" and contains all the dependencies for leiningen. However, the python script assumes clojure is from a separate jar which is not insta

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&

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

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-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-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

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: 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

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

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

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

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

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
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

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

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

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

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

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: 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

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: 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 --

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)

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

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

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

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

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

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: 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

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

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

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: 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

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

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: 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

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

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

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 -

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

[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

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

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

(: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 ... (:

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

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

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: 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

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

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

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))) (...

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

clojure.contrib.lazy-xml/parse-trim forces parsing whole input

2009-04-08 Thread Jouni K . Seppänen
st" on its result should not be done right away. Jouni K. Seppänen --~--~-~--~~~---~--~~ 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 To un

Re: clojure.contrib.lazy-xml/parse-trim forces parsing whole input

2009-04-08 Thread Jouni K . Seppänen
On Apr 9, 7:01 am, Chouser wrote: > Thanks for the report.  I've checked in a change (rev 656) that I > think will solve the problem.  Let me know if it isn't sufficient. It seems to work fine; thanks! Jouni --~--~-~--~~~---~--~~ You received this message because

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: 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: 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-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-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-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-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-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: "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: "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: 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: 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 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: 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

[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: 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

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: 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

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.

  1   2   >