Re: om: state management considerations

2014-04-02 Thread rlewczuk
Hi, Thank you for all answers, as I did my homework (reading overview sent by Jeff and applying Luca's suggestions), things have improved quite a bit. Yet there are still some things I'm not fully grasping, so I have more questions :) First one is about object created by (om/build ...) - in

Re: REPL: viewing data structures containing infinite lists

2014-04-02 Thread Ragnar Dahlén
If you're using cider (https://github.com/clojure-emacs/cider), there's a convenience function for controlling the value of *print-length*, including giving it a default value for new nrepl instances: https://github.com/clojure-emacs/cider#limiting-printed-output-in-the-repl /Ragnar On

Re: Porting parsley paredit.clj to Clojurescript: Crazy, or inevitable?

2014-04-02 Thread Christophe Grand
Hi Kovas, On Wed, Apr 2, 2014 at 3:26 AM, kovas boguta kovas.bog...@gmail.com wrote: Looking through the source for parsley paredit.clj, I'm halfway convinced that maybe its not so hard to port these to clojurescript. Anyone have input in either direction? We (Laurent and me) are planning

Re: REPL: viewing data structures containing infinite lists

2014-04-02 Thread Phillip Lord
Andy mentioned files, but yes, in a pipe this is true. Still, it's not true on the REPL; I can't think of an obvious use case there, and if there is one then having the programmer work around something like *interactive-print-length* would be reasonable. Note that we are talking about an

Re: REPL: viewing data structures containing infinite lists

2014-04-02 Thread Phillip Lord
kovas boguta kovas.bog...@gmail.com writes: Chalk this up as another cautionary tale about global singletons. It's dynamic, so it can be bound for a repl thread! What we need is a parameterizable write-edn function, mirroring the already extant read-edn. The function should guarantee it will

Re: REPL: viewing data structures containing infinite lists

2014-04-02 Thread Phillip Lord
Maik Schünemann maikschuenem...@gmail.com writes: There is real no sensible default value rather than the current. I would say that there is no sensible default value *including* the current. Certainly at REPL usage, the current value is probably the least sensible. My sensible default is

Basic string modification question

2014-04-02 Thread Andy Smith
Hi, I see there are a lot of functions strings, but nothing that allows me to create a new string with a character replaced at a given index? Am I meant to use subs and join to do this? It seems a bit long-winded? I wonder why there isnt a helper function out of the box to do this (or is

Re: Basic string modification question

2014-04-02 Thread Max Penet
There are many ways to do this, these 2 come to mind: (doto (StringBuilder. abc) (.setCharAt 2 \d)) (apply str (assoc (vec abc) 2 d)) The former is probably a lot faster (uglier too)... On Wednesday, April 2, 2014 12:10:48 PM UTC+2, Andy Smith wrote: Hi, I see there are a lot of

Re: Basic string modification question

2014-04-02 Thread Andy Smith
the first isnt pure clojure wo I would probably try to avoid this... e.g. what if I want to port to clojureCLR? The second 'looks' quite a roundabout way of simply manipulating a string? How would the following compare for performance? (defn replace-substring [s r start len] (str (subs s 0

Re: Basic string modification question

2014-04-02 Thread Max Penet
about 1. if that's meant to be portable, yes, not the best indeed, but if you look at c.c.string/* or even c.c/str, most of the functions use stringbuilder I think. about 2. probably slower than subs, these are just alternatives to what you suggested On Wednesday, April 2, 2014 1:06:40 PM

Re: Basic string modification question

2014-04-02 Thread guns
On Wed 2 Apr 2014 at 04:06:40AM -0700, Andy Smith wrote: If there is nothing better then I wonder why there isn't something like this in the clojure standard libraries (must be a good reason I suppose)? Its a fairly standard function for a string library isnt it? It would be a terrible

Integration with Mutable Object-Oriented Eventing Hell

2014-04-02 Thread Christian Eitner
Hello everybody, Given an enormous network of inter-referenced, mutable objects which have to change in-place driven by events (= the OO system). Which strategy would you recommend to plug into such a system with Clojure, building an island of immutable functional programming saneness? How to

Re: om: state management considerations

2014-04-02 Thread David Nolen
On Wed, Apr 2, 2014 at 3:42 AM, rlewczuk rafal.lewc...@gmail.com wrote: First one is about object created by (om/build ...) - in all tutorials these objects are always created on the fly in (render ...) functions. So if some component disappears from view for some time, it loses its state.

self-evaluation of record instances

2014-04-02 Thread Greg D
Greetings, The nuance below took a long time to identify and reduce from a test failure. Should it be considered a bug? $ lein repl nREPL server started on port 52758 on host 127.0.0.1 REPL-y 0.3.0 Clojure 1.6.0 snipped user= (defrecord Fields0 []) ; record with 0 fields user.Fields0

Re: Basic string modification question

2014-04-02 Thread Andy Smith
I guess my point is that if the java function is so good, then why doesnt the clojure library thinly wrap it, so that your code remains portable clojure? On Wednesday, 2 April 2014 12:50:00 UTC+1, guns wrote: On Wed 2 Apr 2014 at 04:06:40AM -0700, Andy Smith wrote: If there is nothing

REPL Reloaded

2014-04-02 Thread david
I'd like to introduce stch.ns. What is stch.ns? In short, it's a namespace utility for reloading modified files that's designed to be used in a REPL. Now you may be thinking we already have tools.namespace, so what's the big deal. Here are some differences: 1. Aliased namespaces are

Re: Basic string modification question

2014-04-02 Thread A. Webb
Using subs (no need for join) is the way I would go, just define (defn replace-at [s n c] (str (subs s 0 n) c (subs s (inc n (replace-at hello 1 a) ;= hallo and carry on. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: REPL Reloaded

2014-04-02 Thread david
BTW, I'm currently looking for work as a Clojure developer. If you like what you see, please hit me up. David -- 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

Re: Basic string modification question

2014-04-02 Thread Jozef Wagner
No. IMO this is not a common operation and should not be in core. If you need do it a lot, you should not use java string in the first place. What should be included in core is a transient string, with support for assoc!. Jozef On Wed, Apr 2, 2014 at 7:49 PM, Andy Smith

ANN Validateur 2.0.0 is released

2014-04-02 Thread Michael Klishin
Validateur [1] is a small validation library for Clojure and ClojureScript. Release notes: http://blog.clojurewerkz.org/blog/2014/04/02/validateur-2-dot-0-0-is-released/ 1. http://clojurevalidations.info -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- You received

ANN Propertied 1.2.0

2014-04-02 Thread Michael Klishin
Propertied [1] is a tiny library for working with property files and java.util.Properties. Release notes: http://blog.clojurewerkz.org/blog/2014/04/02/propertied-1-dot-2-0-is-released/ 1. https://github.com/michaelklishin/propertied -- MK http://github.com/michaelklishin

ANN: ClojureScript 0.0-2202

2014-04-02 Thread David Nolen
ClojureScript, the Clojure compiler that emits JavaScript source code. README and source code: https://github.com/clojure/clojurescript New release version: 0.0-2202 Leiningen dependency information: [org.clojure/clojurescript 0.0-2202] This release is similar to 0.0-2199, it just

ANN Langohr 2.8 is released

2014-04-02 Thread Michael Klishin
Langohr [1] is a small, feature complete Clojure RabbitMQ client. Release notes: http://blog.clojurewerkz.org/blog/2014/04/02/langohr-2-dot-8-1-is-released/ 1. http://clojurerabbitmq.info -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- You received this message

remove first?

2014-04-02 Thread Christopher Howard
Is there some like remove, but only removing the first item found? Not exactly an incredibly hard problem, but with all this clojure stuff about collections and sequences, I'm not quite sure what the appropriate way is to implement it. -- You received this message because you are subscribed to

Re: remove first?

2014-04-02 Thread Timothy Baldridge
I don't know of anything built-in, but this should do the trick: (defn remove-first [f [head tail]] (if (f head) tail (cons head (lazy-seq (remove-first f tail) Timothy On Wed, Apr 2, 2014 at 1:44 PM, Christopher Howard cmhowa...@alaska.eduwrote: Is there some like remove,

Meta-eX - The Music of Code

2014-04-02 Thread Samuel Aaron
Howdy there Clojuristaritorians! For those of you that enjoy seeing applications of code in none-business contexts, you might be excited to see Clojure being mentioned in Imperica - a Digital Arts Culture Magazine: http://www.imperica.com/en/in-conversation-with/meta-ex-the-music-of-code

Re: remove first?

2014-04-02 Thread Christopher Howard
On Wed, 2 Apr 2014 14:07:47 -0600 Timothy Baldridge tbaldri...@gmail.com wrote: I don't know of anything built-in, but this should do the trick: (defn remove-first [f [head tail]] (if (f head) tail (cons head (lazy-seq (remove-first f tail) Timothy Thanks. This

[ANN] - lein-repack 0.1.0 - Repack your project for deployment and distribution

2014-04-02 Thread zcaudate
lein-repack Repack your project for deployment and distribution https://github.com/zcaudate/lein-repack#motivationMotivation lein-repack was written to solve a problem I had with utilities and general purpose libraries. In my experience, clojure libraries are much better when they are

Re: remove first?

2014-04-02 Thread A. Webb
On Wednesday, April 2, 2014 3:39:47 PM UTC-5, Christopher Howard wrote: On Wed, 2 Apr 2014 14:07:47 -0600 Timothy Baldridge tbald...@gmail.com javascript: wrote: I don't know of anything built-in, but this should do the trick: (defn remove-first [f [head tail]] (if (f head)

Re: rant / cljs in cljs ? :-)

2014-04-02 Thread lypanov
I hate REPLs. I also hate large compile times. For me the hardest part of the ~5s compile time is not waiting, it's the watching of the progress of the auto build and waiting until exactly that moment before pressing reload in the browser. That being said, I find run this currently selected

Re: remove first?

2014-04-02 Thread Chris Lappe
Wouldn't just calling rest on your collection do what you want? On Wed, Apr 2, 2014 at 1:07 PM, Timothy Baldridge tbaldri...@gmail.comwrote: I don't know of anything built-in, but this should do the trick: (defn remove-first [f [head tail]] (if (f head) tail (cons head

Re: remove first?

2014-04-02 Thread Ben Wolfson
On Wed, Apr 2, 2014 at 1:36 PM, Chris Lappe chris.la...@gmail.com wrote: Wouldn't just calling rest on your collection do what you want? (remove-first #(= % 3) [1 2 3 4 3 5]) should return [1 2 4 3 5]. -- Ben Wolfson Human kind has used its intelligence to vary the flavour of drinks, which

Re: How to troubleshoot FileNotFoundException: Could not locate clojure/tools/namespace/parse...?

2014-04-02 Thread Sean Corfield
On Apr 2, 2014, at 4:49 AM, Jakub Holy jakub.h...@iterate.no wrote: The problem is that the stack trace contains no indication that it is clj-ns-browser that is causing the problem. I would like to know if there are any tricks to troubleshoot these problems other than binary search through

Re: remove first?

2014-04-02 Thread Alan Forrester
(remove pred coll) removes all of the items in coll satisfying pred. rest just removes the first element of coll, not the first satisfying pred. Alan On 2 April 2014 21:36, Chris Lappe chris.la...@gmail.com wrote: Wouldn't just calling rest on your collection do what you want? On Wed, Apr

Re: Compile time binding for macros

2014-04-02 Thread Jason Felice
Better is subjective, but you could use macrolet from https://github.com/clojure/tools.macro . On Wed, Apr 2, 2014 at 9:14 PM, Gal Dolber g...@dolber.com wrote: Is there a better way to achieve this? https://gist.github.com/galdolber/9946533 Thanks! -- You received this message because