A-Star Search Implementation

2009-10-18 Thread Josh
Hi, To teach myself Clojure and A-Star search, I mocked up a quick demo program. I don't know if anyone else would be interested in seeing it, but it demos a few things, including calling Clojure from Java, building / running from a Maven environment, and of course A-Star. I'd appreciate any cri

Stuart Sierra's Component: retries & restarts in production

2015-09-02 Thread josh
TLDR: how do you use Component when the application logic involves retrying failed components? Background: I'm writing an app that consumes events from a streaming HTTP connection and writes those events to a message queue (see Code Illustration #1). It seems like that could be captured easily

Re: Stuart Sierra's Component: retries & restarts in production

2015-09-06 Thread josh
On Thursday, September 3, 2015 at 9:15:54 AM UTC-4, Andy- wrote: > > Only to answer the "retry on error" part of you question: You might like > hara/event: > http://docs.caudate.me/hara/hara-event.html > Thanks for the tip! I've been meaning to check out hara anyway. If I end up using it I'll p

Re: Stuart Sierra's Component: retries & restarts in production

2015-09-06 Thread josh
Thanks a ton for writing all of this up. I'm actually using Langohr & RabbitMQ as well, so I have the sense that you've solved problems that I might encounter down the road. On Friday, September 4, 2015 at 7:57:21 AM UTC-4, Dave Tenny wrote: > > I'm using components to encapsulate Langohr/Rabbit

Re: Refactoring namespaces

2015-09-18 Thread josh
; library). In my experience, Cursive <https://cursiveclojure.com/> has been pretty effective for refactoring (e.g., moving a file into a different directory and having all of the ns forms update appropriately). I hope that's helpful, Josh On Friday, September 18, 2015 at 12:54:03 PM UTC-4,

Re: filter1 interesting?

2009-03-16 Thread Josh Daghlian
Anyone for "detect"? (detect odd? primes) --> 3 (detect even? primes) --> 2 (detect even? (rest primes)) --> runs forever (detect even? (rest one-million-primes)) --> nil On Mar 16, 10:51 am, Laurent PETIT wrote: > Just to make me more enemies ;-), I would prefer, on the other hand, > find-firs

Re: Concerns About Pushing Clojure 1.0.0 to Maven Central Repo?

2009-05-06 Thread Josh Daghlian
hanks! --josh On May 6, 1:09 pm, Stefan Hübner wrote: > Hi all, > > Since Clojure now has a stable 1.0.0 I would like to take a step > forward and push it to Maven's Central Repo athttp://repo1.maven.org/maven2/. > This would allow people using Maven to integrate Clojure more eas

macro escapes and passing method names are function arguments

2009-06-09 Thread Josh Smith
I've been trying to understand the macro syntax in clojure. I think macro's are closer to the kind of functionality I'm looking for (as opposed to multi-methods) but I'm not sure. http://gist.github.com/126315 I wrote the above code, which simply processes Java-style Properties files (using the

Re: Mnesia like?

2009-06-15 Thread Josh Daghlian
-native as Mnesia, though. --josh On Jun 15, 12:02 pm, Wilson MacGyver wrote: > Does clojure have anything like erlang's Mnesia? or is anyone working on such > project? I know I can fall back to using JDBC+ various RDBMS, but I > was curious if there is something that works like M

Re: Save current namespace like a Smalltalk image

2009-07-08 Thread Josh Daghlian
ined so I know to shove their definitions into a file before restarting the repl. Cheers --josh On Jul 8, 9:04 am, Robert Campbell wrote: > > Perhaps instead of saving an image, it should be able to save a transcript > > of the REPL inputs? Then you could rescue code from this, or find an

Re: questions about datalog

2009-09-12 Thread Josh Smith
On Sep 12, 6:21 am, Robert Luo wrote: > Two more questions: > 3. In datalog.database , it is required that every tuple must has > exactly same field as in database define, is that possible to just > define some necessary fields, and tuples appended can have additional > optional fields? > 4. What

Re: questions about datalog

2009-09-12 Thread Josh Smith
On Sep 12, 9:53 pm, Robert Luo wrote: > Thank you Josh for your answer. Thank you for being interested in the datalog library. :) > I have read the sources of datalog, however, literal.clj and the ideas > of the query language behind it is unknown for me, thus I can not > u

Re: Load Bitmap

2009-10-03 Thread Josh Daghlian
On Oct 3, 8:27 pm, Sean Devlin wrote: > Take a look at the javax.imageio.ImageIO class.  There are some useful > static methods there for loading files.  Also, if you're going to be > doing image editing, I'd suggest reading the AWT sections in Cornell & > Horstmann. > > http://www.horstmann.com/

Re: take-nth

2009-10-27 Thread Josh Daghlian
The docs could use clarification, but it looks like take-nth is doing what's advertised. Is there ever a case (I can't think of one) where a programmer really wants to feed this function a non-positive n? That is, should take-nth crap out if (< n 1)? --josh On Oct 27, 5:26 pm, Ti

Re: Seq wrappers for arrays can morph

2009-10-30 Thread Josh Daghlian
t happen with java arrays. Sounds like a bug, or at least a change request I'd second. After possibly improperly quoting rhickey, Josh slinks away... --josh On Oct 30, 12:40 pm, John Harrop wrote: > user=> (def x (int-array 3)) > #'user/x > user=> x > [0, 0, 0] > u

Re: Seq wrappers for arrays can morph

2009-10-30 Thread Josh Daghlian
Although I suppose this isn't too surprising: user> (second y) --> ConcurrentModificationException --josh On Oct 30, 9:31 pm, Josh Daghlian wrote: > During the Boston Lisp Users meeting last November (?) I asked Rich > about whether seq's on mutable java.util.C

Re: separating ui and content in clojure

2010-03-21 Thread Josh Stratton
An atom seems appropriate after reading up on it, but documentation seems a little scarce. Reading about atoms on the clojure site gives a very small example using just a {}. I've tried piecing it together using a struct but am getting Exception in thread "main" java.lang.IllegalArgumentExceptio

Re: Help optimizing array-to-integer operation?

2010-03-24 Thread Josh Arnold
> I can't think of many > cases where a downcast is used *and* the original value is expected to > ever be larger than the target type. I can. Particularly when casting to a byte, I'm often more interested in the bit pattern than the integer value. (Admittedly, sometimes this is due to java API

Re: referencing an atom inside a function used for swapping

2010-03-25 Thread Josh Stratton
> I would just pass the atom and move the @ inside the function... But the non-atom is automatically dereferenced and sent to the respective function when I use swap! So unless there's another function to alter atoms, I'm going to have the dereferenced version there no matter what, right? > > On

Re: referencing an atom inside a function used for swapping

2010-03-26 Thread Josh Stratton
> construct the JPanel outside the atom, add all the listeners and then > add the panel to structure in the atom. > > (let [panel (JPanel. ..)] >  (add-listener-stuff panel the-atom) >  (swap! the-atom assoc :SpiffyPanel panel)) > > Side-effecting things shouldn't be done inside the swap! since it

Re: copying structures

2010-03-29 Thread Josh Stratton
> Please note that actually def'ing each value is not what you're > supposed to do :) def is reserved for global constants and dynamically > rebindable variables, and redefing an existing variable is considered > bad style. The def was for legibility (or I was going for legibility). Speaking of r

Getting started embedding Clojure into an existing codebase

2010-03-31 Thread Josh Daghlian
to do is start up swank-clojure, pass locals (like the Spring context, some timing information, etc.) into the clojure environment, and so forth. Apologies if I’m missing something obvious (although I suppose that’s what “getting started” docs are for:). Thanks. --josh -- You received this message

Re: Getting started embedding Clojure into an existing codebase

2010-04-02 Thread Josh Daghlian
the actual java process(es) is done by bespoke scripts that directly invoke java. I guess I'll probably end up spring-injecting (a thin wrapper around) swank-clojure or, if my non-emacs-enabled colleagues object, the Enclojure library (of which I had not been aware; thanks!). Cheers. --josh

Re: mutating multiple java swing components

2010-04-08 Thread Josh Stratton
> What's the function to call java code on multiple java components?  If > I have a sequence of Java swing components and I want to go through > and set the same properties for each one, I would use a for loop in > Java.  If I were using immutable structs in clojure, I'd just a map > and just chang

Re: mutating multiple java swing components

2010-04-09 Thread Josh Stratton
pTable main fixed)) mainTables fixedTables) (println mainTables) (println fixedTables) On Thu, Apr 8, 2010 at 4:30 PM, Josh Stratton wrote: >> It sounds like the doseq is the macro you're looking for, e.g. >> (doseq [c my-components] >>   (.setVisible c tru

Re: matching symbols in a dictionary

2010-04-13 Thread Josh Stratton
> You do mean keywords rather than symbols, right? A symbol would be > 'hello. A keyword is :hello. > The ruby name for the clojure keyword concept is "symbol". I used to > get the terminology backwards because of that. > > (assert (= (name :hello) "hello")) > (assert (= :hello (keyword "hello")))

Re: requesting help from any IBM JVM users out there

2010-04-14 Thread Josh Arnold
According to both the JLS [1] and the JVM Spec [2], neither '>' or '<' are legal within an identifier; The various Character.isJava***() methods return false for those characters. As for the original problem, I was able to reproduce it on some Windows IBM JVMs [3] and I verified that applying the

Re: help wanted: tests for c.c.io

2010-04-15 Thread Josh Arnold
I'll take a stab at it.Can you add me as a member of clojure- contrib space, or should I ask on Clojure Dev? I've already submitted a CA and my assembla UN is "josharnold" On Apr 14, 9:50 pm, Stuart Halloway wrote: > clojure.contrib.io is one of the most used libraries in contrib, and   > i

Re: sharing multiple jogl opengl contexts in clojure

2010-04-20 Thread Josh Stratton
I found this code some code that supposedly works for creating a context that can be shared for multiple panels http://www.javagaming.org/index.php/topic,19911.0.html I can't seem to get a pbuffer create. I believe I'm using the correct Clojure syntax for these static methods (pasted below). It

Use of io!

2013-05-29 Thread Josh Kamau
Hi ; Whats the point of using io! inside dosync if all it does is make an exception to be thrown? Please someone make me understand. Regards. Josh -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: Use of io!

2013-05-30 Thread Josh Kamau
Thanks guys. Now i understand its for "marking" functions containing io so that they blow up if they are used inside transactions. I am still learning clojure and i have decided to take some time to understand every function in the core API. Josh. On Thu, May 30, 2013 at 11:1

ref-history-count always return 0?

2013-05-30 Thread Josh Kamau
its always returning zero. How is it used? Josh -- -- 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

Re: ref-history-count always return 0?

2013-05-30 Thread Josh Kamau
Thanks guys. I have been able to get the ref-history-count greater than 0 by increasing ref-min-history to something greater than 0 and by using long (using Thread/sleep) running transactions. Now i get it Josh On Thu, May 30, 2013 at 6:01 PM, Neale Swinnerton wrote: > > On Thu, May 30

Re: Problem seting up ritz nrepl in emacs

2013-06-03 Thread Josh Kamau
Did you try emacs live ? https://github.com/overtone/emacs-live It will give you a head start. Josh On Mon, Jun 3, 2013 at 7:22 PM, Novi Border wrote: > Hi > > It does not seem to help.. > > After removing ac-nrepl, nrepl-ritz-jack-in just hangs until I switch > buffer

while loop

2013-06-13 Thread Josh Kamau
://docs.oracle.com/javase/6/docs/api/java/util/zip/ZipInputStream.html Regards. Josh -- -- 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: while loop

2013-06-13 Thread Josh Kamau
Thanks guys i have now have a bunch of solutions to try out ;) Josh On Thu, Jun 13, 2013 at 8:57 PM, Aaron Cohen wrote: > I like the StackOverflow answer for this: > > > http://stackoverflow.com/questions/5419125/using-java-api-from-clojure-reading-zip-file > > (def

Re: while loop

2013-06-13 Thread Josh Kamau
Thanks Meikel. That works exactly as i wanted. Now, how can i put all the "names" in a vector ? On Fri, Jun 14, 2013 at 9:19 AM, Meikel Brandmeyer (kotarak) wrote: > Hi, > > another way if it's not an enumeration or the like: > > (doseq [entry (repeatedly #(.getNextEntry stream)) :while entry]

Re: while loop

2013-06-13 Thread Josh Kamau
I figured it out... with a for loop. THanks Josh On Fri, Jun 14, 2013 at 9:40 AM, Josh Kamau wrote: > Thanks Meikel. That works exactly as i wanted. Now, how can i put all the > "names" in a vector ? > > > On Fri, Jun 14, 2013 at 9:19 AM, Meikel Brandmeyer (k

Re: In what OS do you code?

2013-06-15 Thread Josh Kamau
nd time, i wouldnt buy a mac. I would stick to linux. josh On Sat, Jun 15, 2013 at 11:20 AM, Mimmo Cosenza wrote: > On Jun 14, 2013, at 8:16 PM, Nico Balestra wrote: > > What company do you work for Mimmo? Can I send my CV? :) > > > yes you can. send it to me. I'm the

Re: DBM libraries

2013-06-16 Thread josh rotenberg
> Is there a maintained and widely-adopted Clojure interface to any of > the Java DBM libraries (jdbm, jdbm2, BerkeleyDB or MapDB) ? I'm not sure how widely adopted it is, but Cupboard has a high and low level Berkeley DB API: https://github.com/gcv/cupboard -- -- You received this message beca

Jenkins, clojure, ring...

2013-06-17 Thread Josh Kamau
ing server-headless" The problem is, during the next build, how will the first process be killed so that it can be run again ? Josh -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegro

Re: Any suggestions for configuration solution in Clojure or Java world?

2013-06-17 Thread josh rotenberg
I like carica for configuration: https://github.com/sonian/carica I switched a project over from the typesafe config package (with my own very thin Clojure wrapper around it) to carica and found it really nice to work with. Josh -- -- You received this message because you are subscribed to

core logic

2013-06-18 Thread Josh Kamau
Hi ; I am trying to learn clojure core.logic. I have gone through some documentation on github by David Nolen. I am now trying to solve this problem: Anyone willing to do some practice can try and share the solution. *SOLVE THIS PROBLEM.* *The Diplomats at Muthaiga Estate* The facts essentia

Re: core logic

2013-06-19 Thread Josh Kamau
Piotr i will as soon as am done. Josh On Wed, Jun 19, 2013 at 11:26 AM, 良ϖ wrote: > Hello Josh, I would be glad you share your code :) > > Piotr > > > 2013/6/18 David Nolen > >> This is a variant of the Zebra/Einstein Puzzle. You can probably Google >>

Re: [ANN] java.jdbc documentation has moved!

2013-07-09 Thread Josh Kamau
Thanks man!... I rely heavily on this library. On Tue, Jul 9, 2013 at 8:39 PM, Michael Klishin wrote: > 2013/7/9 Sean Corfield > >> This opens up contributions to the community at large so I hope to see >> plenty of activity as folks send PRs for their favorite hints, tips, >> and tricks with

Re: Why is clojure so powerful?

2013-09-05 Thread Josh Kamau
The only thing more powerful than Lisp is Lisp on JVM Josh On Thu, Sep 5, 2013 at 2:29 AM, Devin Walters wrote: > Battle-tested libraries are nice, and Java has a lot of them. Clojure > programmers can use all of them with relative ease. I recently tried > Erlang/Elixir and was dis

Re: Counterclockwise

2013-09-07 Thread Josh Kamau
Please allow me to hijack the thread and ask: Does Counterclockwise allow "slurping" and "barfing?" like in emacs ? Josh On Fri, Sep 6, 2013 at 7:59 PM, Marc Dzaebel wrote: > great, to hear, that this important window to the Clojure world is so > actively de

Re: Counterclockwise

2013-09-07 Thread Josh Kamau
Wow! thanks... i have been looking for this. Josh. On Sat, Sep 7, 2013 at 11:44 AM, Timo Mihaljov wrote: > On 07.09.2013 11:24, Josh Kamau wrote: > > Please allow me to hijack the thread and ask: > > > > Does Counterclockwise allow "slurping" and "ba

Re: Counterclockwise

2013-09-07 Thread Josh Kamau
Hi ; (This is embarassing... ;)) I am unable to use "slurp" . I am using latest stable version. does *Ctrl+) S* mean pressing Ctrl+Shift+)+S together ? "Shift" so that i pick ) and not 9 and so that S is in caps. Thanks Josh On Sat, Sep 7, 2013 at 11:57 AM, Josh Kamau w

Re: Counterclockwise

2013-09-07 Thread Josh Kamau
It doesnt work on my machine ;) I checked on eclipse keybindings and its not that binding is not available. I am using 0.12.3.STABLE001. I will keep tinkering just in case am making a stupid mistake. Josh. On Sat, Sep 7, 2013 at 2:13 PM, Timo Mihaljov wrote: > On 07.09.2013 14:02, J

Re: Counterclockwise

2013-09-07 Thread Josh Kamau
It works with 0.20.0.master-travis000126-gitcd826fde979c1b13a4cb8acce5409ae88c761b81 . Thanks. Josh. On Sat, Sep 7, 2013 at 2:22 PM, Josh Kamau wrote: > It doesnt work on my machine ;) > > I checked on eclipse keybindings and its not that binding is not available. > > I am

clojure.java.jdbc connection pool example

2013-09-13 Thread Josh Kamau
Hello there ; I am in desparate need of a clojure.jdbc with a connection pool example. I have googled and the link to github example is broken. Please help. Thanks. Josh -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Re: clojure.java.jdbc connection pool example

2013-09-13 Thread Josh Kamau
Thanks alot. Let me check them out. Josh On Fri, Sep 13, 2013 at 1:41 PM, Shantanu Kumar wrote: > Hi Josh, > > > On Friday, 13 September 2013 15:52:47 UTC+5:30, Josh Kamau wrote: >> >> Hello there ; >> >> I am in desparate need of a clojure.jdbc with a con

Re: clojure.java.jdbc connection pool example

2013-09-13 Thread Josh Kamau
Thanks. I have used C3P0 for now... I will look at tomcat7 pool though Josh On Fri, Sep 13, 2013 at 3:19 PM, gixxi < christian.meichs...@informatik.tu-chemnitz.de> wrote: > Hi Josh, > > I would opt for using Tomcat 7 Pool API - > http://tomcat.apache.org/tomcat-7.0-doc/jdbc

modifying a single item in a list: is a map the right choice?

2015-01-14 Thread Josh Stratton
Noob clojure question. I have a list of items and I want to append a subitem to one of them. They're currently unkeyed because I care about the order and it seemed more intuitive that way. (def items [{ :id 1 :subitems [] } { :id 2 :subitems [] }]) So let's say I want a new list where the secon

Re: modifying a single item in a list: is a map the right choice?

2015-01-14 Thread Josh Stratton
That's cool, but I may be reading this from a file like json, applying the change, and writing it back. Changing it to a sorted list would take linear time anyway, right? And I'd just be writing it back out immediately. Still this seems like a very clean solution. I'll have to read up on how up

simple procedure for updating a value one level down

2015-01-25 Thread Josh Stratton
I'm new to clojure and FP in general. One thing that has always been a little confusing for me is working with immutable trees. I have a vector of categories, each category containing a vector of items--each one a hashmap. In that hashmap I have a bunch of attributes including an item-id. Now,

Re: simple procedure for updating a value one level down

2015-01-26 Thread Josh Stratton
2 :somethingElse 29 }) >> [[{:text "foo", :id 1} {:text "bar", :ack 5, :id 2}] [{:age 12, >> :somethingElse 29, :id 3}]] >> >> >> On Monday, January 26, 2015 at 8:54:58 AM UTC-6, Erik Price wrote: >>> >>> Many functions that affect k

Re: simple procedure for updating a value one level down

2015-01-26 Thread Josh Stratton
t either, so other suggestions are welcome. > > On 27 January 2015 at 00:06, Josh Stratton > wrote: > > They're not keyed by id because order in both the category and its items > is > > important. I could maintain the order explicitly, but that just makes > other >

Re: Clojure needs a web framework with more momentum

2015-05-04 Thread Josh Kamau
I am currently trying to "redirect-after-post" with validation errors. I have already cooked up my way of validating maps. However, i cant find a straight forward way for pushing the errors in a 'flash' and then read them in my template (am currently using freemarker.). I have seen the flash mid

Re: Clojure needs a web framework with more momentum

2015-05-04 Thread Josh Kamau
" and they’re restored on the next request. > > On May 4, 2015, at 8:39 AM, Josh Kamau wrote: > > I am currently trying to "redirect-after-post" with validation errors. > I have already cooked up my way of validating maps. However, i cant find a > straight forward

Re: Clojure needs a web framework with more momentum

2015-05-04 Thread Josh Kamau
@Sean, i wanted totally stateless backend. On Mon, May 4, 2015 at 9:02 PM, Sean Corfield wrote: > On May 4, 2015, at 10:53 AM, Josh Kamau wrote: > > Thanks Sean. that makes sense. I didnt want that map to be stored as > one cookie because it could potentially be big... (there is

Re: Clojure needs a web framework with more momentum

2015-05-04 Thread Josh Kamau
Another challenge is: There are alot of abandoned libraries and few reach 1.0. That makes selecting the libraries to compose abit difficult. On Mon, May 4, 2015 at 9:59 PM, Gregg Reynolds wrote: > > On May 4, 2015 7:16 AM, "Eric MacAdie" wrote: > > > > I think what Clojure needs is a default. I

Re: [new] GNU emacs settings for clojure ?

2015-06-15 Thread Josh Kamau
You could also try emacs-live if you are an emacs beginner. https://github.com/overtone/emacs-live On Mon, Jun 15, 2015 at 9:32 AM, Jason Lewis wrote: > M-x package-install cider should give you a better time. > > One is never "stuck" with emacs; one is privileged to enjoy it. > > On Sun, Jun 1

Re: materials

2015-06-25 Thread Josh Kamau
http://www.braveclojure.com/ On Thu, Jun 25, 2015 at 12:10 PM, Baishampayan Ghose wrote: > http://lmgtfy.com/?q=clojure+tutorial > > Hope this helps. > > ~BG > > On Thu, Jun 25, 2015 at 7:21 AM, Baskar Kalyanasamy > wrote: > > hi everyone, > > can somebody send me materials for

[ANN] ring-transit 0.1.1 released

2014-07-27 Thread Josh Lehman
I've just thrown together a ring middleware for transit <https://github.com/cognitect/transit-format> with an api like that of ring-json <https://github.com/ring-clojure/ring-json>. You can check it out here: ring-transit <https://github.com/jalehman/ring-transit>.

Re: Is clojars down?

2014-07-29 Thread Josh Kamau
I cannot. " Oops! Google Chrome could not find cljars.org " Josh On Tue, Jul 29, 2014 at 3:44 PM, Di Xu wrote: > I can open cljars.org as normal, and can also download jars from there. > > 2014-07-29 20:42 GMT+08:00 Yves Parès : > > Hi, it seems than clojars is do

Re: Is clojars down?

2014-07-29 Thread Josh Kamau
Sorry... the url is clojars.org and its working perfectly. josh On Tue, Jul 29, 2014 at 3:46 PM, Marc Limotte wrote: > lein is working for me, and is downloading jars from clojars. Assuming > it's a network issue on your side, and if you don't need any new jars right >

Re: can't connect with Datomic transactor

2014-09-08 Thread Josh Lehman
Wilker, It seems that you haven't actually started the transactor. For developing, I'd recommend using lein-datomic <https://github.com/johnwayner/lein-datomic>. Hope that helps, -Josh On Sunday, September 7, 2014 8:06:55 PM UTC-7, Wilker wrote: > > Hi, > > I was

Re: reading to learn and acquire the skill of writing optinal Clojure code

2014-09-26 Thread Josh Kamau
tually the implementation of the nth function in clojure core. So you can go to clojure.core/nth to see how it is implemented. Josh Josh On Fri, Sep 26, 2014 at 4:28 PM, Leon Grapenthin wrote: > I highly recommend the clojure.core namespace. > > On Friday, September 26, 2014 3:41:31 AM UT

Re: A (foolish) plan to re-invent IO on top of core.async

2015-01-06 Thread Josh Kamau
There is also vertx.io with the clojure module. Josh On Tue, Jan 6, 2015 at 3:43 PM, Max Penet wrote: > Jet is already very usable and used in production by some notable > projects/clients. > I am also working on improving the backpressure story on all fronts at the > moment (m

Re: [ANN] Clojure 1.9.0-alpha5

2016-06-08 Thread Josh Tilles
Well, it’s worth noting that clojure.core/name does account for strings : (defn name "Returns the name String of a string, symbol or keyword." {:tag String :added "1.0" :static true} [x

Re: [ANN] Clojure 1.9.0-alpha5

2016-06-12 Thread Josh Tilles
On Sunday, June 12, 2016 at 10:29:56 PM UTC-4, Alan Thompson wrote: > > I would have expected the namespaces to avoid this kind of conflict. Why > don't they? > Because the conflict was only introduced five days ago, with this commit

Re: Spec of conform of spec

2016-06-18 Thread Josh Tilles
Have you considered choosing labels that are themselves qualified keywords with registered specs? That might feel like a workaround, but I think it could get you most of what you’re looking for. For example: ``` (s/def ::even-spec even?) ;= :user/even-spec (s/def ::odd-spec odd?) ;= :user/odd-spe

Re: Spec of conform of spec

2016-06-18 Thread Josh Tilles
I just realized that in my example, I probably should have used `s/get-spec` instead of `s/spec` when defining the labels. Oh well. On Saturday, June 18, 2016, Josh Tilles wrote: > Have you considered choosing labels that are themselves qualified > keywords with registered specs? That

Re: wondering why spec.test/instrument doesn't check :ret

2016-08-06 Thread Josh Tilles
I’m not sure it answers your question *directly*, but a quote from Rich in another thread seems relevant: On Monday, July 11, 2016 at 10:01:05 AM UTC-4, Rich Hickey wrote: > On Sunday, July 10, 2016 at 6:04:39 AM UTC-4, puzzler

Re: Idiom question

2016-09-28 Thread Josh Tilles
By the way, the order of arguments of as-> makes more sense when it’s used *within* one of the other threading macros. For example: (-> x foo (bar y) (baz w z) (as-> mid-x (log/debug "The intermediate value:" mid-x) (if (color-requested? mid-x) (assoc mid-x :color "periwinkle

Re: clojure.spec, conform and returned value

2016-10-11 Thread Josh Tilles
I think you’re looking for conformer ; the spec it produces will pass along the converted value instead of the original input. It could be used like: (defn str->double [s] (try (Double/valueOf s)

Guidelines/Recommendations for namespaces and qualified keywords

2016-10-15 Thread Josh Tilles
394-L402> and as keys in nested maps <https://github.com/clojure/clojure/blob/clojure-1.9.0-alpha13/src/clj/clojure/spec.clj#L205> . Thank you for your help. I really appreciate it. Best, Josh -- You received this message because you are subscribed to the Google Groups &q

Re: Java like static typing for Clojure?

2016-10-21 Thread Josh Tilles
Out of curiosity, did you try Typed Clojure? It certainly has its rough edges, but you sound willing to bear the burden of annotating code with types (at the top-level, at least) and I *think* its treatment of Java interop does what you want: unless instructed otherwise, the typechecker assumes

Re: Spec & test.check generators for complex data structures

2016-11-01 Thread Josh Tilles
I don’t have any answers, but you might find the discussion in the first several messages of this thread to be relevant. On Tuesday, November 1, 2016 at 3:14:28 PM UTC-4, Maarten Truyens wrote: > > Completely convinced of Spec,

Re: s/valid? vs. s/explain

2016-11-13 Thread Josh Tilles
Just going on memory at the moment, but I’m pretty sure `s/explain` just writes to `*out*` (and thus always returns `nil`). You probably want `s/explain-data` or `s/explain-str`. -Josh On Sun, Nov 13, 2016 at 10:58 AM James Gatannah wrote: > One of my system boundary data structures

Re: Namespace question and request for project with non-trivial use of clojure.spec

2016-12-16 Thread Josh Tilles
Although I can’t recall off the top of my head any example applications that demo non-trivial spec usage, you might be able to find some good projects using CrossClj: https://crossclj.info/ns/org.clojure/clojure/1.9.0-alpha14/project.clj.html#used. (There’s a good chance that any project that’

spec and à la carte conformance of map vals (and maybe a bug)

2016-12-19 Thread Josh Tilles
devs are otherwise happy with? Or is it in fact a *deliberate* limitation, in line with the “map specs should be of keysets only” <http://clojure.org/about/spec#_map_specs_should_be_of_keysets_only> design decision? Thank you, Josh P.S. To confirm my understanding that there is not a

Re: what tutorials exist for working at the Repl in Emacs?

2016-12-22 Thread Josh Kamau
http://www.braveclojure.com/basic-emacs/ On Fri, Dec 23, 2016 at 12:34 AM, larry google groups < lawrencecloj...@gmail.com> wrote: > I'm curious if there are good tutorials for a modern setup in Emacs. > Especially any tutorial that mentions stuff like Pomegranate, that helps at > the Repl? > > -

Re: spec and à la carte conformance of map vals (and maybe a bug)

2017-01-13 Thread Josh Tilles
ore, it seems likely that either the first or the third >is true, but I wanted to make sure I wasn’t being misunderstood first. Thank you, Josh > On Dec 19, 2016, at 5:26 PM, Alex Miller <mailto:a...@puredanger.com>> wrote: > > On Monday, December 19, 2016 at 2:42:49 PM UT

Re: clojure.core.match/match: very strange behavior

2017-01-30 Thread Josh Tilles
se you need to teach core.match how to use DateTimes <https://github.com/clojure/core.match/wiki/Pattern-Matching-Java-Objects>. I hope that helps! Josh P.S. In future questions you pose, you should probably state the version of Clojure you’re using, as well as the versions of any libraries

Re: structuring parallel code

2017-01-30 Thread Josh Tilles
If your goal is “to operate on large data structures in parallel” then you’ll probably find Clojure’s reducers library to be helpful. On Monday, January 30, 2017 at 9:38:01 PM UTC-5, Brian Craft wrote: > > ans: this scales badly. > > There must be a way i

Re: spec and à la carte conformance of map vals (and maybe a bug)

2017-02-02 Thread Josh Tilles
. -- Josh Tilles [image: Signafire logo] 79 Madison Ave, 4th Floor New York, New York 10016 Tel: (646) 685-8379 <+16466858379> signafire.com <http://www.signafire.com/> -- On Sat, Jan 14, 2017 at 8:03 PM, Sean Corfield wrote: > A

Re: Version control at the function level - a la Rich

2017-02-17 Thread Josh Tilles
I’m pretty sure you’re looking for codeq: http://blog.datomic.com/2012/10/codeq.html On Friday, February 17, 2017 at 4:39:12 PM UTC-5, Terje Dahl wrote: > > I recall Rich Hickey talking about this a few years back, but can't find > anything about it. > Am I just imaging it? > Or could someone

"Soft" failures with spec?

2017-02-17 Thread Josh Tilles
e times. 2. Use a single spec, but have rules for what ::s/problems are acceptable. So, what do you think? Has anyone tried anything along these lines? Does this sound fundamentally wrongheaded, trying to make spec do something it’s ill-suited for? Cheers, Josh Tilles 79 Madison Ave, 4th Floo

Re: with-open pattern

2017-05-04 Thread Josh Tilles
I think the “reducible streams” approach described by Paul Stadig here has potential. It might not cover all of the scenarios you’re thinking of, though. On Thursday, May 4, 2017 at 1:35:48 PM UTC-4, Brian Craft wrote: > > The with-open st

Re: Can't stop the system component

2017-06-06 Thread Josh Tilles
e stop implementations are returning nil. (The value of a (println ,,,) expression is nil.) I hope that helps, Josh P.S. You should be able to just use component/start; you shouldn’t need to use component/start-system explicitly. On Tuesday, June 6, 2017 at 10:42:22 AM UTC-4, D.Bushenko wrote: >

Re: Spec - is there any way to tell which keys are not described by a spec?

2018-01-05 Thread Josh Tilles
I think Stu Halloway’s proof-of-concept is at least close to what you want: https://gist.github.com/stuarthalloway/f4c4297d344651c99827769e1c3d34e9. (Here’s the context for that code, in case you were curious.) btw, you might want t

Re: Your choice

2018-01-15 Thread Josh Kamau
And you do all this in Clojure ? ;) On Mon, Jan 15, 2018 at 9:11 PM, wrote: > 1. We can guarantee the quality of the product. > > 2. Fast and safe delivery (INTERNATIONAL)- ( E-mail.. dave joine company > @ gmail . com ). > > 3. USA ( call/text (469) 772-0415 or (406) 201 9486 <(406)%20201-

Re: accessing symbols in local context of a closure

2018-05-25 Thread Josh Tilles
My curiosity got the better of me: (require '[clojure.spec.alpha :as spec] '[clojure.test :refer [is with-test]]) (spec/fdef local-bindings :args (spec/cat :closure fn?) :ret (spec/map-of simple-keyword? any?)) (with-test (defn local-bindings [closure] (into {} (map

Re: [ANN] Clojure 1.10.0-beta1

2018-10-10 Thread Josh Tilles
I recently stumbled across this little example by Ghadi Shayban that helped *both* prepl and tap click for me: $ clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.0-beta2"}}}' Clojure 1.10.0-beta2

I am looking for xml parsing lib

2015-08-24 Thread Josh Kamau
Hello; Which is the recommended xml parsing lib for clojure? clojure.data.xml was last updated 10months ago and is still on version 0.0.8 Thanks Josh -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: I am looking for xml parsing lib

2015-08-25 Thread Josh Kamau
;s it, though. >> >> On Mon, Aug 24, 2015 at 10:48 AM, Josh Kamau >> wrote: >> >>> Hello; >>> >>> Which is the recommended xml parsing lib for clojure? >>> >>> clojure.data.xml was last updated 10months ago and is still on v

Re: Stuart Sierra's Component: retries & restarts in production

2015-09-04 Thread Josh Tilles
I just found the other resources from the Component wiki —it may be that something linked from there addresses exactly my situation. On Wednesday, September 2, 2015 at 8:44:07 PM UTC-4, jo...@signafire.com wrote: > > TLDR: how do you use

  1   2   >