Re: Installation issues on slack 13.0 (ant?)

2010-03-20 Thread Steve
modern distro will make your life much easier (eg. apt-get install ant). > >   Before I procede >   o: Installation must be made easier >   o: Instructions must be made easier >   o: Methods for deployments must be made easier. > Docs can always be improved, however if you're stuck at

Re: Version of netbeans with extra Clojure and Polyglot Maven/Leiningen support ...

2010-04-18 Thread Steve
ur Netbeans patch working with Netbeans 6.9? I'd be happy to try to help out if there's anything I can do. - Steve -- 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 Not

Re: Managing the classpath

2010-07-01 Thread Steve
ortant for Clojure, however the classpath/dependency management might still be useful. - Steve -- 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 a

Re: Build tool for mixed Clojure/Java projects

2011-07-03 Thread Steve
s can depend on them. So if you've already made the leap to using maven with one project, using it for another is not a big deal. - Steve -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googl

Re: Build tool for mixed Clojure/Java projects

2011-07-04 Thread Steve
rainer (esp. when the IDEs do most of the config creation work). - Steve -- 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 pat

Re: Build tool for mixed Clojure/Java projects

2011-07-04 Thread Steve
ilt in project management facilities or a bunch of shell scripts (or ant for that matter). I think that Greenspun's tenth rule has an analogue in hand rolled build systems - most of them end up being a crappy implementation of 10% of maven's functionality (and maven is not that nice to be

Re: Build tool for mixed Clojure/Java projects

2011-07-04 Thread Steve
of different tools (mostly Java projects using Netbeans and Eclipse, running on Linux and Windows) and because we've standardised on Maven we have very few issues sharing projects. - Steve -- You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: Build tool for mixed Clojure/Java projects

2011-07-04 Thread Steve
. They can also both open/import Maven projects created outside the IDE. - Steve -- 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 moderate

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

2011-07-25 Thread Steve
at you're writing belongs on your blog rather than here. - Steve -- 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 p

Re: Ah-hah! Clojure is a Lisp

2010-12-20 Thread Steve
t to > "one place" being scattered posts to this list). And apparently these > The short version is here: http://clojure.org/state - Steve -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cl

Re: On the importance of recognizing and using maps

2009-03-09 Thread Steve Fisher
On Mar 8, 7:59 pm, Brian Carper wrote: > On Mar 8, 10:53 am, Rich Hickey wrote:> > > > In looking at some of the libraries, I am a bit concerned that maps > > are not being used when the logical entity is in fact a map. > > One time I find myself abusing vectors where maps would be better is >

Re: Help please: or function

2009-03-09 Thread Steve Fisher
On Mar 9, 10:48 am, timc wrote: > Can someone please see what's wrong with this. > > (defn getArg [arg] >         "Return a [keyword value] depending on the form of the string arg: >         1. arg is of the form +x ==> [:x true]. >         2. arg is of the form -x ==> [:x false]. >         3.

Re: naive euler43 blows heap, why?

2009-03-09 Thread Steve Fisher
On Mar 9, 10:55 am, Dirk Vleugels wrote: > (defn extract [ s i ] >    (conj [] (nth s i) (nth s (inc i)) (nth s (inc (inc i) (defn extract [s i] (subvec (vec s) i (+ i 3))) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

Clojure cheat sheet

2009-07-08 Thread Steve Tayon
developing this excellent piece of software. Steve --~--~-~--~~~---~--~~ 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 m

Re: Clojure cheat sheet

2009-07-08 Thread Steve Tayon
Mark Volkmann schrieb: > Looks good! You might get some additional ideas for categories from > http://java.ociweb.com/mark/clojure/ClojureCategorized.html. Thanks for the hint. I will look for missing commands and merge them into the sheet.

Re: Clojure cheat sheet

2009-07-08 Thread Steve Tayon
Laurent PETIT schrieb: > Hi, interesting, thanks for doing this ! > > Maybe you could add also the reader syntax for lists (), vectors [], > sets #{}, maps {} or do you think they are too trivial to be in the > cheat sheet ? Although the initialisation of lists, vectors etc. is a reader task, I w

Re: Clojure cheat sheet

2009-07-10 Thread Steve Tayon
s are welcome! Steve --~--~-~--~~~---~--~~ 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 pa

SOAP Server

2009-08-10 Thread Steve Nunez
would you suggest one be created? Perhaps the easiest thing would be to use an existing Java library? - Steve --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, sen

Re: Two minor typos in the cheatsheet

2009-10-31 Thread Steve Tayon
Thanks for your findings! Should be corrected in the new revision. Greetings, Steve --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroup

Re: Getting Started in Mac OS X Snow Leopard

2009-12-01 Thread Steve Purcell
quot;. These steps should get you a working clojure-mode. As far as hooking clojure-mode up to a working clojure installation goes, I'd suggest skipping your MacPorts installation and running "M-x clojure-install". -Steve On 1 Dec 2009, at 06:32, Charras wrote: > Hello; &g

Re: Getting Started in Mac OS X Snow Leopard

2009-12-01 Thread Steve Purcell
On 1 Dec 2009, at 22:03, David Nolen wrote: > On Tue, Dec 1, 2009 at 3:59 PM, Charras wrote: > Steve, I already try to follow does instructions. I copied the text > into the *scratch* buffer, and did control j (C-j), but nothing > happen, it just move the cursos to the next line. Do

Re: Getting Started in Mac OS X Snow Leopard

2009-12-04 Thread Steve Purcell
tion-modifier 'none) (setq default-input-method "MacOSX") With those settings, option-3 should give you '#' on your UK keyboard, and "option-e-e" would give you "é", for example. (My full emacs config tree is here: http://github.com/purcell/emacs.d) -Stev

Re: Clojure development environments

2009-12-04 Thread Steve Purcell
f much additional software or any additional supporting languages, but that has mature Clojure support almost out of the box. That's a tall order! :-) I guess a Clojure version of LispBox (http://www.gigamonkeys.com/lispbox/) would be nice to have. In the meantime, Netbeans + Enclojure is

Re: Getting Started in Mac OS X Snow Leopard

2009-12-07 Thread Steve Purcell
On 7 Dec 2009, at 11:15, Lauri Pesonen wrote: > 2009/12/4 Steve Purcell : >> >> Here's what I do (in Cocoa Emacs 23) to make 'option' work the same in Emacs >> as in other OS X apps: >> >> (setq mac-command-modifier 'meta) >> (set

Re: Help recreating OS X Leiningen 1.0 +Swank bug

2009-12-17 Thread Steve Purcell
r to use "lein swank". I'm trying to get my head around what can be done here, and will report back if I have any insights. It's been so nice to let leiningen take care of the classpath for me, having abandoned Java years ago for less encumbered languages. ("Ah, my old

Re: list of open source clojure projects to contribute?

2009-12-23 Thread Steve Purcell
Here's a good start: http://www.google.com/search?hl=en&q=site:github.com+clojure But the best plan is to start using clojure for real work, then contribute to the open source tools you find yourself using. -Steve On 23 Dec 2009, at 02:27, Kasim wrote: > I am just thinking i

Re: Clojure + Redis

2009-12-31 Thread Steve Purcell
hical store, so its array/set operations would only benefit the most shallow of data structures. -Steve On 30 Dec 2009, at 11:52, Gabi wrote: > On first look, Redis and Clojure seems to be a perfect match. They > both handle sets and maps efficiently. If one could find an easy way >

Re: Clojure/SLIME/Emacs questions

2009-12-31 Thread Steve Purcell
e-complete-symbol*-fancy t) (setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol))) -Steve On 31 Dec 2009, at 12:07, Baishampayan Ghose wrote: >> - Also in his screencasts, Lau Jensen types something like g-i-v, >> then hits some key combination and gets

Re: Clojure/SLIME/Emacs questions

2009-12-31 Thread Steve Purcell
Indeed -- that works nicely. I tried going back to a completely non-ELPA-ized setup, but it was too painful; the trick was installing technomancy's github repo of slime *in addition* to the ELPA packages, which all depend on each other. -Steve On 31 Dec 2009, at 16:44, william douglas

Re: Clojure + Redis

2010-01-01 Thread Steve Purcell
There you go: http://github.com/purcell/redis-memo I doubt the memoize functions provided therein will be directly useful to you, but you may find a few lines of helpful code there. Best of luck with your experiment. -Steve On 31 Dec 2009, at 16:20, Gabi wrote: > Yes. I think it is of m

Re: Clojure + Redis

2010-01-04 Thread Steve Purcell
Read the code I posted in this thread and put up on github after you expressed interest. That's part of what it does, using the reader/printer representation. Alternatives would include standard Java binary serialisation or 3rd party libraries (Hessian/Burlap?). -Steve On 4 Jan 2010,

Re: Clojure + Redis

2010-01-05 Thread Steve Purcell
Indeed, thanks - I realized that earlier today myself! -Steve On 5 Jan 2010, at 09:24, Gabi wrote: > I think you should do "(binding [*print-dup* true] (pr-str value).." > instead of just (pr-str value) in the encode-value function. (line 20 > in redis_memo.clj) > >

Re: Clojure + Redis

2010-01-05 Thread Steve Purcell
Or rather, more importantly, I realised I should bind *print-level* to nil... As for *print-dup*, I guess there's a danger that stored values might become unreadable if any implementation structure classes were to get renamed in a future clojure release. -Steve On 5 Jan 2010, at 09:24,

Re: Clojure on Ideone!

2010-01-18 Thread Steve Purcell
For those who didn't click through, this is a really nifty code paste site that will actually run your pasted code and display the output next to the paste. Worth a look; it's a nice piece of work. -Steve On 15 Jan 2010, at 21:23, sphere research wrote: > Hi, > > test Cl

Re: Dependency management

2010-01-23 Thread Steve Purcell
I believe some people use HttpUnit for this purpose. It's a very full-featured HTTP client. YMMV. On 23 Jan 2010, at 01:25, Richard Newman wrote: >> And as for Apache HttpComponents, it sounds like they don't grok the >> notion that breaking backwards compatibility should only occur with a >> m

Re: How can I parse this with clojure.contrib.zip-filter.xml ?

2010-01-23 Thread Steve Purcell
ket)] >[(zf/xml1-> ticket :customer zf/text) > (zf/xml-> ticket :item zf/text)])) The following is equally untested, but you can also just have xml-> call a function for each matching sub-element: (defn ticket [xml] [(zf/xml1-> xml :customer zf/text) (zf/xml-> xm

Re: Help needed regarding the use of macro

2010-01-25 Thread Steve Purcell
ssion passed for "url" has side effects? It would get executed 3 times. -Steve On 25 Jan 2010, at 11:41, Manish wrote: > Hi, > I am new to clojure. I want to use try-catch block to the (.getPage > *wc* ~url) statement of code. But I am getting this error: > java.lang.

Re: Please share your thoughts on dependency injection

2010-02-09 Thread Steve Purcell
; > Please let me know what you think. I think you could achieve the same effect much more simply using 'binding'/'with-bindings' and 'memoize'. -Steve -- You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Re: clojure-dev: #55: clojure.contrib.sql expects *err* to be a PrintWriter Ticket updated - Resolution?

2010-02-13 Thread Steve Purcell
tion*))] > (binding [*out* out-redir > *err* out-redir] > (dosync (ref-set (*current-connection* :writer-redir) *out*)) > > It would be nice to see this upstream. +1. Github user 'wilig' appears to have been working on this (or a very similar issue):

Re: clojure-dev: #55: clojure.contrib.sql expects *err* to be a PrintWriter Ticket updated - Resolution?

2010-02-14 Thread Steve Purcell
t my swank-clojure jar on Clojars if necessary; just let me know. If this all works for you, Phil, you can just merge my master branch to slurp in the above changes; I'll refrain from adding anything else to it. -Steve -- You received this message because you are subscribed to the Google Grou

Re: clojure-dev: #55: clojure.contrib.sql expects *err* to be a PrintWriter Ticket updated - Resolution?

2010-02-14 Thread Steve Purcell
On 14 Feb 2010, at 09:34, Steve Purcell wrote: > In my master branch (freshly forked from Phil's repo) I've applied Richard's > patch, plus the following recent branches from the swank-clojure network on > github (http://github.com/technomancy/swank-clojure/network)

Re: Permutations of n things

2010-02-14 Thread Steve Purcell
i) (into perm new-perms))) > > 1:160 user=> (permute [1 2 3]) > ([2 1 3] [1 2 3] [3 1 2] [1 3 2] [3 2 1] [2 3 1]) > > How can I write this in a better fashion? In particular how do I make > this lazy? Check out the source for clojure.contrib.combinatorics: http://ric

Re: processing two collections

2010-02-15 Thread Steve Purcell
On 15 Feb 2010, at 13:50, Glen Rubin wrote: > Thank you so much This is really wonderful advice...saved me > months of learning. I have rewritten my code as follows: You'll want to use "let" in place of all of those "def" declarations. -Steve -- You re

Re: processing two collections

2010-02-15 Thread Steve Purcell
On 15 Feb 2010, at 13:58, Steve Purcell wrote: > On 15 Feb 2010, at 13:50, Glen Rubin wrote: > >> Thank you so much This is really wonderful advice...saved me >> months of learning. I have rewritten my code as follows: > > > You'll want to use &qu

Re: Reflection Warning Output in SLIME

2010-03-01 Thread Steve Purcell
the code the REPL manually. Any solutions? Same here, but it *does* work if I compile the entire buffer (C-c C-k); perhaps that helps. -Steve -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googl

Re: Two potential map-util functions

2010-03-09 Thread Steve Purcell
e left/right arrows to navigate) or 2. Pull all the clones locally and take a look via gitk, gitx, magit or similar: cd clojure-contrib# your git clone gem install github# install the github ruby gem github network fetch # create & fetch remotes for all forks on github -Stev

Re: bounded memoize

2010-03-10 Thread Steve Purcell
On 9 Mar 2010, at 23:22, Michał Marczyk wrote: > In the way of early feedback -- that's looks super neat! I've got this > instant feeling that this would be a great clojure.contrib.memoize. +1 That would be wonderful. -- You received this message because you are subscribed to the Google Group

Re: indexing only some elements of a sequence...

2010-03-20 Thread Steve Purcell
Which looks the same as clojure.contrib.seq/reductions to me... -Steve On 20 Mar 2010, at 13:54, Per Vognsen wrote: > Learn to love scan: http://gist.github.com/338682 > > -Per > > On Sat, Mar 20, 2010 at 12:13 PM, Douglas Philips wrote: >> Hello all, >> I

Re: Haskell-style list functions

2010-04-11 Thread Steve Purcell
recursion, and return a lazy sequence as a result. Does this qualify as a 'smart' solution? user> (use '[clojure.contrib.seq-utils :only (reductions)]) nil user> (reductions + [1 2 3 4 5]) (1 3 6 10 15) user> -Steve -- You received this message because you are subscribed to the

Re: Common Algorithms Written in Clojure

2010-04-12 Thread Steve Purcell
gestions are welcome! > How about the Clojure examples on Rosettacode? http://rosettacode.org/wiki/Category:Clojure -Steve -- 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 Not

Re: Common Algorithms Written in Clojure

2010-04-12 Thread Steve Purcell
On 12 Apr 2010, at 13:46, Steve Purcell wrote: > On 12 Apr 2010, at 09:39, Bytesource wrote: >> For example, I tried to implement the "insertion sort" in Clojure but >> could not figure out how to "swap" values and get the recursion >> right. > >

Strange protocol behaviour

2010-05-20 Thread Steve Purcell
ure 1.2 snapshot from today. (The same thing happened with a snapshot from 2 weeks ago.) Is this a classloader issue, or something else? Any help greatly appreciated. -Steve -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to t

Re: Strange protocol behaviour

2010-05-20 Thread Steve Purcell
Before anyone spends time investigating, this has been accepted as an issue: https://www.assembla.com/spaces/clojure/support/tickets/353 My workaround for now is to use reify in place of deftype. -Steve On 20 May 2010, at 13:43, Steve Purcell wrote: > I'm loving protocols, bu

Re: finding combinations given a coll and selection of n

2010-05-22 Thread Steve Purcell
ne care > to enlighten me? Thanks in advance. Check out the clojure.contrib.combinatorics/combinations function: http://richhickey.github.com/clojure-contrib/combinatorics-api.html#clojure.contrib.combinatorics/combinations -Steve -- You received this message because you are subscribed to the Google Grou

Re: 57 varieties

2010-05-28 Thread Steve Purcell
> If it helps, I've got a working non-ELPA set-up which you can browse here: http://github.com/purcell/emacs.d It uses git versions of Slime, Clojure-mode and Swank-clojure (as git submodules). Feel free to mail me off-list with any questions. -Steve -- You received this message b

Detecting login and logout using friend

2013-06-25 Thread Steve Buikhuizen
Hi all, I'm using Friend https://github.com/cemerick/friend for auth on my webapp and I'm measuring how many people login and use the app etc. In order to do this I need to detect the login and logout events as well as the session-id cookie (I need a unique id for session) from the container.

Re: Detecting login and logout using friend

2013-06-28 Thread Steve Buikhuizen
I'll answer my own question here for future reference value. I found a much cleaner way was to create a wrapper type (deftype) for the ring session store impl. It is a simple delegating wrapper but it sees the correct cookies, regardless of the servlet container. It has the disadvantage of not

Re: Detecting login and logout using friend

2013-06-28 Thread Steve Buikhuizen
Thanks Chas, since my current solution "ain't broke" I'll leave it as is for now. However, the moment I need to change it, I'll try your suggestion and will post the code here as well. -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

REPL sessions crash Windows

2013-08-06 Thread Steve J
I am new to Clojure programming and have been running REPL sessions from the Command Prompt. At some unpredictable time, either during the session or after it is ended, Windows will crash (the computer not responding and with a frozen pattern on the screen). I have tried several things, such as

Deft: A Typeshaping Library

2013-08-12 Thread Steve Shogren
considered that typeshape. Any suggestions as to my implementation or pull requests are totally welcome. Thanks! Steve -- -- 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

Clojure Macro Tutorial

2013-08-19 Thread Steve Shogren
! Steve -- -- 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 unsubscribe from this g

Re: Detecting login and logout using friend

2013-08-30 Thread Steve Buikhuizen
I had to do this again in another project so I tried Chas' suggestion. It is much simpler than my earlier solution. For anyone else doing this in the future, here's how you can write it: (defn check-workflow-result "check if the response contains and auth-map. If so, notify the event bus"

Re: [ANN] Clojure 1.7.0-alpha5 now available

2015-01-15 Thread Steve Miner
Alpha5 works for me. I noticed that the doc-string for *unchecked-math* doesn't mention the :warn-on-boxed behavior. Suggestion: "While bound to true, compilations of +, -, *, inc, dec and the coercions will be done without overflow checks. While bound to :warn-on-boxed, a warning will

Re: [ANN] dformat 0.1.0

2015-01-15 Thread Steve Miner
Clever. The doc-strings for dformatter and dformat could use a little work. Remember, people will use (doc whatever) in the REPL so “same as above” isn’t very useful. Also, the dformatter doc implies more arguments than it actually takes. The order of arguments to dformat seems backwards to

Re: print-table bug?

2015-02-02 Thread Steve Miner
Looks like a bug in clojure.pprint/print-table. Probably should be use `pr-str` instead of `str`. user=> (str ()) "clojure.lang.PersistentList$EmptyList@1" user=> (pr-str ()) "()" > On Feb 2, 2015, at 3:10 PM, John Lawrence Aspden > wrote: > > These behave differently in 1.6 with respect t

Re: print-table bug?

2015-02-02 Thread Steve Miner
In any case, it would be nice if (str ()) returned “()”. By the way, (str {}) returns "{}" and (str []) returns "[]” as I would expect. I just filed CLJ-1653.Seems like the simple fix is to add a toString() method for PersistentList.EmptyList. -- You received this message because you are

Re: Combining reloaded workflow in web dev with dynamic var approach

2015-02-09 Thread Steve Ashton
I've had the same question. What I've come up with is to introduce a new middleware in the the dev-system, which wraps the both the creation of the app handler and calling the handler with the request map. The prod-system would still refer directly to a single instance of the app handler. Now i

Re: Help needed with Component library

2015-02-10 Thread Steve Ashton
In main.clj, it looks like you aren't keeping a reference to the started app. So when you call stop, you are actually stopping the version of the system which doesn't have the jetty server set. Try changing this: (defn -main [& args] (component/start app) (component/stop app)) to this: (de

Re: Name of a function

2015-02-14 Thread Steve Miner
Clojure doesn't give you direct access to the name of the function you're defining. However, you could use a macro to get that. Here’s one way. This macro binds the strange symbol %0 to the symbol naming the current function. ;; %0 is bound to the function's symbolic name within the function

Re: Lucky numbers

2015-02-17 Thread Steve Miner
> On Feb 17, 2015, at 4:39 PM, Colin Jones wrote: > > Sounds almost like a mirror image of `clojure.core/take-nth`, so something > like this is kind of fun: > > (defn drop-nth [n coll] > (lazy-seq > (when-let [s (seq coll)] > (concat (take (dec n) s) (drop-nth n (drop n s))

Re: Lucky Numbers again

2015-02-18 Thread Steve Miner
One more try. This time using the int-map contrib library. (Thanks to Zack Tellman.) Warning: I'm assuming that the int-set seq is automagically sorted so I can reliably turn it back into a vector without sorting. It seems to be stable at least. I wanted a vector for fast nth access. (Nth

Re: Lucky Numbers again

2015-02-19 Thread Steve Miner
I found a better data structure for calculating lucky numbers. The contrib library data.avl (from Michał Marczyk) has a persistent sorted-set that supports nth. This runs much faster than my previous attempts. (require '[clojure.data.avl :as avl]) (defn lucky-avl ([max] (lucky-avl 1 (apply a

Re: should edn recognise defrecord?

2015-02-24 Thread Steve Miner
The edn format does not include records. The transit README gives an example of how to write a transit handler for a record. See the section on extensibility. https://github.com/cognitect/transit-format#extensibility Before transit

Re: Can someone offer refactoring suggestions for my protocol example?

2015-02-24 Thread Steve Miner
It’s probably fine to do a linear search with .indexOf for small vectors, but I’ll just say as a matter of style I prefer to use a couple of maps to hold previous and next items. The maps are callable like functions, which I think reads very nicely. Using your example data for ranks: ;; helpe

Re: printf does not always generate output

2015-02-27 Thread Steve Miner
Try adding (flush) at the end. > On Feb 27, 2015, at 2:12 PM, Cecil Westerhof wrote: > > My core.clj ends with: > (println (format "Started: %s (println)" (java.util.Date.))) > (printf "Started: %s (printf)\n" (java.util.Date.)) > > I do not see the output from the printf when I run 'le

Re: partition-when

2015-03-05 Thread Steve Miner
[f coll] (lazy-seq (when-let [s (seq coll)] (let [fst (first s) run (cons fst (take-while #(not (f %)) (next s)))] (cons run (partition-when f (seq (drop (count run) s) — Steve > On Mar 5, 2015, at 12:11 PM, Andy- wrote: > > Tried myself an

map-in

2015-03-24 Thread Steve Ashton
ustomers [{:name "Alice" :address {:city "Raleigh" :state "NC"}} {:name "Bob" :address {:city "Seattle" :state "WA"}}]) (map-in customers [:address :state] #(-> % clojure.string/lower-case keyword)) => (:nc :wa)

Re: Transducers: sequence versus eduction

2015-04-03 Thread Steve Miner
forms. There must be a better reason than mechanical rewriting. Wouldn't a macro make more sense? (defmacro educe->> [coll & xfs] `(->Eduction (comp ~@xfs) ~coll)) So the rewrite could be just educe->> for ->>, without having to wrap the xforms at all. (educe->

Re: What is "best practice" regarding transducers

2015-05-08 Thread Steve Miner
was a fun experiment for me. Steve Miner stevemi...@gmail.com > On May 6, 2015, at 11:15 AM, larry google groups > wrote: > > I would like to write a detailed blog post about how developers are actually > using transducers. If you have a public project on Github that is using

Re: What is "best practice" regarding transducers

2015-05-10 Thread Steve Miner
xempty is a transducer that just returns an empty result, essentially ignoring the input. The thought was that a degenerate transducer might be useful in a complex chain if you want to stop processing. I haven’t actually used it for anything, just experimenting. > On May 10, 2015, at 3:12 PM,

Re: Opinion on take-while for stateful transducers

2015-05-11 Thread Steve Miner
#{} (complement contains?)) '(1 2 3 4 2 5 6)) ;;=> [1 2 3 4] ;; dedupe (into [] (take-while-accumulating (fn [r x] x) ::void not=) '(1 2 1 3 4 4 5 6)) ;;=> [1 2 1 3 4] ;; monotonically increasing (into [] (take-while-accumulating max 0 <=) '(1 2 3 4 4 1 5 6)) [1 2 3 4

Re: How to include ... in project.clj

2015-06-03 Thread Steve Ashton
Try: :repositories [["..." "url"]] -Steve -- 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 pat

Re: Clojure on iOS devices - Swift as a host?

2014-06-24 Thread Steve Tickle
In the upcoming IOS8, UIWebView has the same (JITed) performance as the Safari, the distinction has been removed due to using the new inter-app communication mechanism. This allows the remote application (Safari/JavascriptCore/UIWebView) to display a view into another process, thus bypassing the no

Re: Critiques of "my-flatten" which uses CPS

2014-07-17 Thread Steve Miner
Slightly off-topic from original poster's question, but if you're interested in another implementation of flatten, I suggest you take a look at the reducers library. clojure.core/flatten is elegant but a bit slow. The reducers version is very fast as part of a reduce/fold operation. The whol

Re: Is this behavior with recur and pre/post a bug?

2014-07-25 Thread Steve Miner
I will call it a bug. It's definitely surprising to the user, and therefore worthy of a ticket. On first glance, it seems that the fix isn't too hard. In core.clj where the macro fn is redefined, we just need to wrap the section that handles the post condition either with a loop* or a fn* so t

Re: Is this behavior with recur and pre/post a bug?

2014-07-25 Thread Steve Miner
Ticket CLJ-1475 with my patch. http://dev.clojure.org/jira/browse/CLJ-1475 -- 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 patien

Re: Is this behavior with recur and pre/post a bug?

2014-07-25 Thread Steve Miner
nction call and never during a recur. Any other opinions? On Jul 25, 2014, at 10:57 AM, Steve Miner wrote: > Ticket CLJ-1475 with my patch. > > http://dev.clojure.org/jira/browse/CLJ-1475 -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: Is this behavior with recur and pre/post a bug?

2014-07-26 Thread Steve Miner
I'm giving up on this bug. My approach was adding too much complexity to handle an edge case. Hacking the fn macro is not as easy as it looks. :-) I recommend the loop work-around if you run into this problem. Or refactor the recursive code into a separate function and call it from another fu

Re: Is this behavior with recur and pre/post a bug?

2014-07-26 Thread Steve Miner
I tried the latest patch from Ambrose for CLJ-1475. Looks good to me. Well done. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please b

Clojure REPL startup code

2014-09-15 Thread Steve Ford
I think. I'm kinda new to all this... Is there a different way to auto-load the tools? Maybe something not specific to lein? Steve -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@goog

"lein midje :autotest" problem - fast re-init?

2014-09-28 Thread Steve Ford
ot; error. Any suggestions besides killing and restarting "lein midje :autotest" from time to time? (To be avoided given the long delay starting it.) Thanks. Steve -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

Print broken in Cider 0.7.0 - Ring - Compojure

2014-10-29 Thread Steve Shogren
I cannot seem to see the results of "println", "print", or "clojure.tools.trace/trace" when running my site, per my setup here: http://stackoverflow.com/questions/22365741/missing-out-in-clojure-with-lein-and-ring?lq=1 The one comment suggested trying (.println System/out msg) which prints as

Re: Print broken in Cider 0.7.0 - Ring - Compojure

2014-10-29 Thread Steve Shogren
ssues/785 > > — > Cheers, > Bozhidar > > On October 29, 2014 at 2:41:02 PM, Steve Shogren (steve.a...@gmail.com > ) wrote: > > I cannot seem to see the results of "println", "print", or > "clojure.tools.trace/trace" when running my si

Re: Print broken in Cider 0.7.0 - Ring - Compojure

2014-10-30 Thread Steve Shogren
-9b16-c89f818ed326")) On Wednesday, October 29, 2014 1:12:14 PM UTC-4, Bozhidar Batsov wrote: > > I’d suggest filing the a ticket with output from *nrepl-messages* so we > can have an idea what’s going on. > You can also try the 0.8-snapshot. > > — > Cheers, > Bozh

Re: Print broken in Cider 0.7.0 - Ring - Compojure

2014-10-30 Thread Steve Shogren
0.8-snapshot. > > — > Cheers, > Bozhidar > > On October 29, 2014 at 5:43:56 PM, Steve Shogren (steve.a...@gmail.com > ) wrote: > > Supposedly that was fixed in nrepl 0.2.6, which is the version I am using. > Still nothing. > > On Wednesday, October 29, 2014 10:15:34 A

Re: better way to group consecutive numbers in a vector?

2014-11-06 Thread Steve Miner
I would try to avoid last and but-last as they work in linear time. How about something like this? (defn congeal-consecutives [coll] (when (seq coll) (let [[_ group res] (reduce (fn [[succ group res] n] (if (== succ n)

Re: testing platform , midje or specjl ?

2014-11-15 Thread Steve Ford
olutely love is midje's autotest. I love writing out my editor and having the tests run immediately in another window. No more bugs of the form, "Oh, this is just a simple, obvious change; no need to re-run tests." Is there anything like that which could be done with clojure

Better update function

2014-12-21 Thread Steve Ashton
I'm trying to figure out if there is a better / more concise / more generic way to write an update function. The data I have is a vector of maps containing vectors of maps. For example: [{:values [{:y 1 :x 4}{:y 2 :x 7}]}{:values [{:y 5 :x 8}]}] The goal is to update all the :y values or all

Re: Cognitect joins Nubank!

2020-07-23 Thread Steve Miner
Parabéns -- 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 unsubscribe from this group, send emai

Re: ? stateful-map ?

2022-12-09 Thread Steve Miner
See also https://github.com/cgrand/xforms for a transducer version of reductions. The argument f must have a nullary arity. (You could probably create your own variant if you want an explicit init value.) I think something like this should work: (require '[net.cgrand.xforms :as x]) (defn xs

  1   2   3   >