Re: Calling Native C-code from Clojure

2020-12-05 Thread John Doe
Cool! Thanks again Chris. On Saturday, December 5, 2020 at 4:09:39 PM UTC+1 ch...@techascent.com wrote: > You are most welcome :-). For numerical computation, libjulia-clj > <https://github.com/cnuernber/libjulia-clj> may interest you :-). > > On Sat, Dec 5, 2020 at 8:06

Re: Calling Native C-code from Clojure

2020-12-05 Thread John Doe
rt of the reason I wrote dtype-next > <https://github.com/cnuernber/dtype-next> which has the ability to > efficiently write/read from either java heap or native heap storage. > dtype-next has no dependency on either JNA or JNR. > > Hope this helps, > > Chris > >

Re: Calling Native C-code from Clojure

2020-12-05 Thread John Doe
ink jnr is probably easier to use. > > lvh > > On Fri, Dec 4, 2020 at 8:53 AM John Doe wrote: > >> Hello Everyone, >> >> *Motivation:* I want to invoke C-code functions from Clojure: writing >> Java functions in Clojure. >> >> *Plan of Attack:* Rath

Calling Native C-code from Clojure

2020-12-04 Thread John Doe
Hello Everyone, *Motivation:* I want to invoke C-code functions from Clojure: writing Java functions in Clojure. *Plan of Attack:* Rather than go with the JNI approach I want to interface with C-Library via JNR-FFI (https://github.com/jnr/jnr-ffi) Based on some example of using JNR-FFI https:/

Re: Clojure Spec and Human Readable Error Messages

2020-02-15 Thread John Shaffer
e204/spec-forms#spec-forms Probably needs some polish, but I wanted to push this out so I can start using it in my projects. ‐‐‐ Original Message ‐‐‐ On Tuesday, February 4, 2020 12:33 AM, David Simmons < shortlypor...@gmail.com> wrote: Many thanks John. I'll check out phras

Re: Clojure Spec and Human Readable Error Messages

2020-02-03 Thread John Shaffer
The phrase library can create human-readable error messages: https://github.com/alexanderkiel/phrase I've been working on something for a more natural (to me) approach, with the ability to define error messages in-line with the predicate. E.g., (s/defop max-length [n] (sf/validator #(>= n (

Re: [ANN] proxy-plus: Faster and more usable replacement for "proxy"

2020-01-13 Thread John Newman
Bravo 👏 Are there any differences in behavior to be aware of? AOT, Graal, consuming proxy+ classes from vanilla clojure classes? On Mon, Jan 13, 2020, 11:47 AM Nathan Marz wrote: > proxy+ is a replacement for Clojure's proxy that's faster and more usable. > proxy has a strange implementatio

Re: Benefits to partial functions.

2019-10-20 Thread John D. Hume
It's been a long time since I looked at this, but as of a few years ago, the biggest noticeable performance detriment of comp or partial was likely to come if you pass enough args to hit a "& args" overload, which requires creating a fresh object array at each call, when the underlying function bei

Re: Custom test assertions in ClojureScript

2019-09-28 Thread John Shahid
Thanks Thomas, That was very helpful. I tried your suggestion and it works in JVM ClojureScript. That method does not work on bootstrapped ClojureScript though. As far as I understand this is a result of bootstrapped ClojureScript evaluating the .clj(c) file in the same JavaScript environment

Custom test assertions in ClojureScript

2019-09-26 Thread John Shahid
Hi all, I am trying to implement custom assertions in ClojureScript. I tried to use defmethod but got the following error: > clojure -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version > "1.10.520"}}}' -m cljs.main --repl --repl-env node > cljs.user=> (require '[cljs.test]) > nil > cljs.use

Re: [ANN] cpython bindings for clojure

2019-06-05 Thread John Newman
👏 On Wed, Jun 5, 2019 at 12:59 PM Jonah Benton wrote: > Wow, that is incredibly cool. Eager to check it out. > > > On Wed, Jun 5, 2019, 12:41 PM Chris Nuernberger > wrote: > >> Good morning Clojurians, >> >> About 2 months ago during a talk about the tech.ml systems the point was >> made th

Re: The magic of Lisps

2019-04-28 Thread John Newman
I like Eric Normand's take here: https://lispcast.com/magical-leverage-languages/ On Sun, Apr 28, 2019 at 9:46 AM wrote: > I agree Erik, macros and the dsl idea are edge cases imho. Having written > clojure for 4 years now (and with 30 as a professional developer) I’ve only > written a few macro

Re: Java interop question

2019-02-05 Thread John Shahid
Thiago Araújo writes: > Hi, > > I'm a newcomer to java interop. I'm trying to run the following code > without success: > > (javafx.scene.layout.HBox. (javafx.scene.control.Label. "Foo")) > > I get: > > IllegalArgumentException No matching ctor found for class > javafx.scene.layout.HBox

Re: Any way to replace function body?

2019-01-19 Thread John Newman
revent var replacement warnings I believe, similar to s/instrument, but I haven't figured out how to do it yet in a cross-platform way. PRs welcome. V/r John On Saturday, January 19, 2019 at 9:58:29 AM UTC-5, Janko Muzykant wrote: > > Hi, > > Is there an way to replace body of

Understanding tap

2018-12-19 Thread John Newman
Not sure why two wouldn't compose. You should probably wrap values in namespaced maps and dispatch with multimethods for your add-tap handlers. You could probably do pub sub pretty easy over that. But I'd like to see more examples with tap too. What alternative design were you thinking of? --

[ANN] dispacio

2018-12-13 Thread John Newman
dispacio is an experimental, simple, predicate stack dispatch system. Predicates are tested in the order they are defined and the first truthy match wins. Features being worked on: - similar interface to `defmethod` - `isa?` hierarchies, similar to `defmethod` - `prefer` a la `prefer-method` - d

Re: [ANN] 'Elements of Clojure' is complete

2018-12-03 Thread John Schmidt
I have been holding off bying this until it was done, but now it's time to get comfy and dive in, exciting! Thanks for all the inspiring talks and great Clojure libraries throughout the years, they've made me a better programmer in general and a better Clojure programmer in particular. On Mond

Re: Efficient Predicate Dispatch [was ANN: Logos v0.6]

2018-11-19 Thread John Newman
Update the example to leverage isa? hierarchies and allow prefer-poly, a la prefer-method: https://stackoverflow.com/questions/53329709/dispatching-function-calls-on-different-formats-of-maps/53354967#53354967 V/r John On Saturday, November 17, 2018 at 5:09:09 PM UTC-5, John Newman wrote

Re: Efficient Predicate Dispatch [was ANN: Logos v0.6]

2018-11-17 Thread John Newman
we might as well just check them in the order they're provided from the user and let the first one win, right? V/r John On Thursday, April 14, 2011 at 11:25:48 AM UTC-4, David Nolen wrote: > > When things begin to get recursive you may be on the right track :D > > Initially I

Re: [ANN] 1.10.0-beta5

2018-11-06 Thread John Schmidt
Wow, that's a nice example, makes it clear that it brings something new to the table! On Tuesday, November 6, 2018 at 4:50:55 PM UTC+1, Alex Miller wrote: > > > On Tuesday, November 6, 2018 at 9:25:31 AM UTC-6, John Schmidt wrote: >> >> Nice to see continued progress on

Re: [ANN] 1.10.0-beta5

2018-11-06 Thread John Schmidt
Nice to see continued progress on Clojure 1.10! It is not clear to me what metadata extension provides that is not already possible with direct definitions or external extensions. Some additional background or a small motivating example would be much appreciated in clearing up the confusion! O

[CfP] 2018 Scheme and Functional Programming Workshop

2018-06-25 Thread John Clements
ort at the University of Alabama at Birmingham. Publication of a paper at this workshop is not intended to replace conference or journal publication, and does not preclude re-publication of a more complete or finished version of the paper at some later conference or in a journal. Sincerely, John C

Re: Plain clojure 1.9 fails with Could not locate ... clojure/spec/alpha.clj on classpath. in Kubuntu 18.04

2018-05-21 Thread John Mastro
c/alpha.clj on classpath. Use the Linux installation script as described on the "geting started" page[1]. This will also install Clojure's dependencies for you. The installation script accepts a `--prefix` argument if you don't want to install it globally. [1]: https://clojure.o

Re: [ANN] clj-new -- creating new Clojure projects using the clj CLI

2018-04-19 Thread John Newman
ps://github.com/juxt/pack.alpha/blob/master/src/mach/pack/alpha/inject.clj Who knows, maybe if some of these aliases get super popular and standardized, we can convince Alex to fold some of them into the tools over time :) V/r John John On Thu, Apr 19, 2018 at 3:18 AM, Didier wrote: > Ah, aw

Re: [ANN] Schism, a set of CRDTs for Clojure and ClojureScript

2018-04-19 Thread John Newman
nds schism-map M to node B, both A and B update M, B sends M back to A, A converges M1 and M2: If M1 and M2 have destructive conflicts, does the most "recent" change win? Or does the local copy win? Thanks, V/r John John On Thu, Apr 19, 2018 at 8:55 AM, Alex Redington wrote: >

Re: [ANN] Schism, a set of CRDTs for Clojure and ClojureScript

2018-04-18 Thread John Newman
just like this recently, so thanks! V/r John On Wed, Apr 18, 2018, 9:05 PM Alex Redington wrote: > Good evening! > > I submit for your evaluation and reasoned feedback a library I've been > working on to provide a set of convergent replicated data types to Clojure > and

Re: How to validate date (YYYYMMDD) using clojure

2018-03-12 Thread John Jacobsen
Have a look at clj-time: https://github.com/clj-time/clj-time In particular the clj-time.format namespace. Cheers! John -- 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

Re: what does future do after fn finish ?

2018-01-31 Thread John Newman
Ah, he's using one agent, I see. On Jan 31, 2018 9:15 PM, "John Newman" wrote: > Multiple sen-doffs to one agent will serialize it's calls, but spawning > agents on each new task will spawn threads on a bounded thread pool, I > believe. > > On Jan 31,

Re: what does future do after fn finish ?

2018-01-31 Thread John Newman
If > parallelization leads to complex coordination needs, core.async can help > too. > > On Wed, Jan 31, 2018 at 5:18 PM John Newman wrote: > >> Agents manage a pool of threads for you. Try doing it without the future >> call and see if that works (unless you're

Re: what does future do after fn finish ?

2018-01-31 Thread John Newman
Agents manage a pool of threads for you. Try doing it without the future call and see if that works (unless you're trying to do something else). John On Wed, Jan 31, 2018 at 7:31 PM, Jacek Grzebyta wrote: > Thanks a lot. I will check it tomorrow. > > J > > On 1 Feb 2018

Re: Simulations in Clojure/Clojurescript

2018-01-27 Thread John Newman
You might want to look into Chris Granger's work on component entity systems in clojurescript: http://www.chris-granger.com/2012/12/11/anatomy-of-a-knockout/ Light Table went on to have a similar component-entity layout internally. On Jan 10, 2018 6:12 PM, "Michael Nardell" wrote: > Greetings :

Re: 1.8 vs 1.9 performance

2017-12-25 Thread John Stevenson
about comparable performance or upgrade issues, however, I don't recall any issues with libraries and Clojure 1.9 We will be upgrading to the final 1.9 release in the new year, which simply means running our performance tests in a non-production environment for a week or so. ​ Thanks Joh

Re: Immutable names of things?

2017-12-11 Thread John Newman
What if the code segments were hashed by zipper coordinates instead of line-column location? I like this idea of structurally navigating the code as an AST of EDN :) John On Mon, Dec 11, 2017 at 7:55 PM, John Newman wrote: > This might be a step towards a more clojury way: h

Re: Immutable names of things?

2017-12-11 Thread John Newman
This might be a step towards a more clojury way: http://blog.datomic.com/2012/10/codeq.html John On Mon, Dec 11, 2017 at 7:53 PM, Didier wrote: > I'll have a look at all these other projects, its very interesting. Unison > seems to embody the spirit or Richs talk about never changi

Re: [core.spec] Stricter map validations?

2017-11-16 Thread John Newman
Great conversation! I'm still catching up on Spec, but it seems like there's a correlation here to type systems. Type systems can introduce a certain kind of technical debt - type debt? It seems that leaving maps open here is also attempting to avoid that sort of type debt - parochial maps that

Re: Doc strings for complex cases?

2017-11-09 Thread John Newman
Way back when - when Rich was fielding suggestions for how to do doc strings - I made the offhand comment that every arity could have it's own doc string. He didn't like the idea back then. Doubtful he will now. I'm glad he went the route he did. I believe the discussion took place on this mail l

Re: hello world question !!!

2017-10-31 Thread John M. Switlik
Thanks. I have been using clojure, as an example, on discussions on Quora. In essence, extrapolating from Lisp, pre-web, to clojure. Now, is that a huge leap? I don't expect so. I saw the approximation of something built on Lisp re-done (or attempted, anyway) via objective-C. The trade offs were ob

Re: hello world question !!!

2017-10-30 Thread John M. Switlik
Forgot a link. https://www.quora.com/What-did-Alan-Kay-mean-by-Lisp-is-the-greatest-single-programming-language-ever-designed/answer/John-M-Switlik -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: hello world question !!!

2017-10-30 Thread John M. Switlik
Hey, clojure world, your work got this old Lisp guy excited. Keep up the good work. It has been three weeks so far since I first saw the paper showing clojure as being (well, they said marginally, but I think more) better (in a quality sense) than most. What I have seen in terms of usage, and poten

Re: hello world question !!!

2017-10-14 Thread John M. Switlik
rtunity to step through the thing (that is, the hugely complicated world of the muddy cloud) and see how things evolved. Those little interpreters are up there as a lure in the meantime. Cheers, John -- You received this message because you are subscribed to the Google Groups "Clojure" gro

Re: hello world question !!!

2017-10-13 Thread John M. Switlik
Damien, This is just an aside. Thanks for the question. I have not even tried Clojure, yet. So, this is good for me to follow. BTW, I have done Java (since the '90s) and so know of the 'coffee' stains everywhere. Yet, given the Lisp basis, I want to see how to make Clojure easier for the cau

Re: [ANN] faster-multimethods

2017-10-12 Thread John McDonald
e multimethods? I think it's a valuable > work, you can create a patch to make clojure better. > See https://clojure.org/community/contributing > > > 2017-10-13 8:13 GMT+08:00 John Alan McDonald : > >> Beta release (0.1.0) of faster-multimethods, which brings multimethod

[ANN] faster-multimethods

2017-10-12 Thread John Alan McDonald
Beta release (0.1.0) of faster-multimethods, which brings multimethod lookup overhead to roughly the same cost as protocols, with only modest changes to the Clojure 1.8.0 implementation. It is mostly backwards compatible with Clojure 1.8.0. I would very much appreciate feedback on the semantic

Re: Clojure examples

2017-10-10 Thread John M. Switlik
And so, starting today with Google App Engine. -- 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

Re: Clojure examples

2017-10-08 Thread John M. Switlik
Context: STEM with quality gets the heads out of silicon. Clojure will be the central enabler. Just like we have diversity in human affairs, so too ought computing be multi (disciplinary, hetero, …). https://www.quora.com/What-could-boost-Clojure-adoption/answer/John-M-Switlik Funny thing. I

Clojure examples

2017-10-07 Thread John M. Switlik
Machine in a hurry. Is there already an example like this using Clojure? I would like to do my functional extensions this way (frontend and backend). John -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, s

Re: redefining multimethods at the repl

2017-09-20 Thread John Alan McDonald
It seems to me that defmulti should create a new instance of MultiFn, initialized with the method tables from the existing MultiFn, if any. Then alter-var-root to update the Var holding the MultiFn. A possible problem is that a new dispatch function might be inconsistent with the existing keys a

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
t; that carries data that counts in equality checks seems a bit overboard to > me, since a record implementing IFn does this for very little trouble. > > On Wed, Sep 20, 2017 at 12:58 PM John McDonald > wrote: > >> I've done something like this in the past. >> >

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
hash-map. It's not > too hard to implement if you know the precise arg count you need to > support, and I'd be interested to see how the performance compares. > > On Wed, Sep 20, 2017 at 11:57 AM John McDonald > wrote: > >> 2nd issue: Benchmarks >> >>

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
ASM: I haven't done anything with ASM before. Any advice would be greatly appreciated. What I have in mind is using the org.ow2.asm, not the internal clojure.asm. I am imagining I can take a function's class and add 'implements IObj', a 'meta' field, and the necessary methods, and pass through e

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
t 12:05 PM, John McDonald wrote: > 3rd issue: metadata and function equality: > > I've never really understood the motivation for "Two objects that differ > only in metadata are equal." > Is there a good reference for that? > > For my purposes, it would probably

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
shouldn't be overloading the metadata mechanism after all? On Wed, Sep 20, 2017 at 11:57 AM, John McDonald wrote: > 2nd issue: Benchmarks > > I use both criterium and simple 'run repeatedly and divide the clock time'. > > I've had trouble getting consi

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
lisades/lakes/funx/l2norm/msec.clj These both use general benchmarking code from https://github.com/palisades-lakes/benchtools The experimental metadata function wrapper is in: https://github.com/palisades-lakes/dynamic-functions/blob/dynesty/src/main/java/palisades/lakes/dynafun/java/MetaFn.java On W

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
ctions for machine learning, and other applications, by summing, composing, etc. other functions. On Tue, Sep 19, 2017 at 11:34 PM, Alex Miller wrote: > > > On Tuesday, September 19, 2017 at 8:01:07 PM UTC-5, John Alan McDonald > wrote: >> >> I'd like to be able to do som

functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-19 Thread John Alan McDonald
I'd like to be able to do something like: (defn square ^double [^double x] (* x x)) (def meta-square (with-meta square {:domain Double/TYPE :codomain Double/TYPE :range {:from 0.0 :to Double/POSITIVE_INFINITY :also Double/NaN}}) https://clojure.org/reference/metadata says "Symbols and collection

Re: Question about transitivity in MultiFn.prefers() --- possible bug

2017-08-14 Thread John Alan McDonald
A related but slightly different issue: is prefer-method supposed to be transitive? That is, (prefer-method f a b) and (prefer-method f b c) implies (prefer-method f a c)? Here is a unit test that checks for transitivity (which fails in Clojure 1.8.0): (test/deftest transitive (derive ::tra

MultiFn.prefers() ignores the multimethod's internal hierarchy

2017-08-12 Thread John Alan McDonald
prefers(x,y) visits ancestors by calling parents.invoke() recursively. This visits the parents in the global hierarchy, not the multimethod's hierarchy. Is this the intended behavior? Why would that be? On the assumption that prefer-method should behave the same for a local vs the global-hierar

Question about transitivity in MultiFn.prefers() --- possible bug

2017-08-12 Thread John Alan McDonald
prefers(x,y) checks the ancestors of x, and returns true if any of them are preferred to y --- which makes sense to me. However, it also check the ancestors of y, and returns true if x is preferred to any of them, which I don't understand. Is that the intended behavior? Seems like it should be

Re: class and case

2017-05-12 Thread John Mastro
;t valid Clojure syntax for an expression. Just "java.lang.String" evaluates to the class with that name, but the test expressions aren't evaluated. I think the most common approach for this scenario is to use condp: (condp instance? "x" java.lang.String "STR

Re: What to read after 3 dozen "introduction to transducers" blog posts

2017-05-10 Thread John Gabriele
On Wednesday, May 10, 2017 at 3:16:42 AM UTC-4, Luke Burton wrote: > > > > On May 6, 2017, at 10:56 AM, Matching Socks > wrote: > > > > This one. > https://tech.grammarly.com/blog/building-etl-pipelines-with-clojure > > > > "To be honest, this is a somewhat advanced usage of the transducers

Re: What sorcery is this? (`reduced`, `reduced?`)

2017-04-25 Thread John Gabriele
duced?`! Regarding `(source reduced)`, that points me toward clojure.lang.Reduced. And `(source reduced?)` points me toward clojure.lang.RT/isReduced. I found the corresponding source code in src/jvm/clojure/Reduced.java src/jvm/clojure/RT.java -- John On Tuesday, April 25, 2017 at 5:11:59 PM

What sorcery is this? (`reduced`, `reduced?`)

2017-04-25 Thread John Gabriele
Just recently stumbled upon `reduced` and `reduced?`. It seems rather magical... how does the outer `reduce` (or `reductions`) know to stop? That is, how does the function which is being called (`reduced`) affect the function that's calling it (below, `reductions`)? : ~~~clojure (defn main []

Re: Startup time of standalone .jar executable

2017-03-21 Thread John Gabriele
On Tuesday, March 21, 2017 at 11:24:20 AM UTC-4, Michael Lindon wrote: > > I wrote a collaborator some clojure code which I distributed to them as a > standalone jar file which they are executing with > > java -jar mystandalone.jar > > The problem is that this executable is called a great many ti

Re: java interop, `(.instanceMember Classname)`

2017-03-21 Thread John Gabriele
On Tuesday, March 21, 2017 at 12:35:05 PM UTC-4, John Gabriele wrote: > > On Monday, March 20, 2017 at 4:59:33 PM UTC-4, Colin Fleming wrote: >> >> Object doesn't have a getName() method. >> >> This doc is confusing - as Phill comments above, this is calling the

Re: java interop, `(.instanceMember Classname)`

2017-03-21 Thread John Gabriele
On Monday, March 20, 2017 at 4:59:33 PM UTC-4, Colin Fleming wrote: > > Object doesn't have a getName() method. > > This doc is confusing - as Phill comments above, this is calling the > getName() method on an instance of Class. In Clojure, a bare classname > (String, ArrayList or whatever) resol

Re: java interop, `(.instanceMember Classname)`

2017-03-21 Thread John Gabriele
On Monday, March 20, 2017 at 7:47:46 PM UTC-4, Alex Miller wrote: > > If someone could file an issue on the clojure-site repo, I would be happy > to improve the example. Thanks. Filed: , though I don't have alternative wording/prose for it.

Re: java interop, `(.instanceMember Classname)`

2017-03-20 Thread John Gabriele
On Monday, March 20, 2017 at 4:14:46 AM UTC-4, Matching Socks wrote: > > Methods having the same name might be distinguished by their argument > lists. > Thanks, but it sounds like you're describing method overloading, as in (.someMethod someObj arg1) ; vs (.someMethod someObj arg1 arg2)

java interop, `(.instanceMember Classname)`

2017-03-20 Thread John Gabriele
In the [Java Interop Docs](https://clojure.org/reference/java_interop), what does the example (.instanceMember Classname args*) mean? (Looks like the example given at the top for that one is `(.getName String)`, but I don't see any `getName` method in the javadoc for java.lang.String.) It

Re: Contribute Specter to Clojure core?

2017-03-05 Thread John Newman
The "language" Specter introduces "specific"ally navigates the "domain" of Clojure data structures. Regexes also provide a DSL that navigate or operate over the string/text domain and that's often considered a large, generic, unstructured domain. What matters is the semantic surface area the librar

Re: Contribute Specter to Clojure core?

2017-03-05 Thread John Newman
Okay, let's call it a Context Specific Vocabulary (CSV) ;) Every function is at least a mini DSL, IMO. And as promising as Spec sounds, I still haven't trained up on it because of the size of the new vocabulary (or DSL or whatever you want to call it) it introduces. Adding semantics is expensive f

Re: What makes Clojure Clojure?

2017-03-04 Thread John Newman
Yeah, only Rich can really answer that question, right? :) But for me, Clojure is increasingly becoming cljc. When a library advertises compatibility in both clj and cljs, it just looks shinier to me. Feels like a trend for Clojure libraries in general. And if agents and STM were on cljs, I'd proba

Re: Contribute Specter to Clojure core?

2017-03-04 Thread John Newman
gt; > > On Mar 3, 2017 6:27 PM, "John Newman" wrote: > > I think the path navigator DSL feels slightly un-Clojurey. But other than > that, I think Specter is pure magic and Nathan is right that editing deeply > nested data structures in Clojure is a point of deficiency,

Re: Contribute Specter to Clojure core?

2017-03-03 Thread John Newman
I think the path navigator DSL feels slightly un-Clojurey. But other than that, I think Specter is pure magic and Nathan is right that editing deeply nested data structures in Clojure is a point of deficiency, especially for people coming from mutable languages/data structures. To that extent, I th

Re: How can I re-order rows in a table (hiccup)?

2017-02-26 Thread John Gabriele
Gotcha. No, you got it; should be sorting my data first. Thanks! On Friday, February 24, 2017 at 6:00:59 PM UTC-5, Gary Trakhman wrote: > > Generally it's easier to sort the data before it gets put into hiccup > table formatting. Is there any reason not to? > > On Feb 24,

Re: How can I re-order rows in a table (hiccup)?

2017-02-26 Thread John Gabriele
Ooof. Looking at your soln, I see that I was so focused on re-ordering those `[:tr ..]`'s that I didn't realize I should first sort the source data I start with *before* converting it to hiccup data structures. Thanks! -- John On Friday, February 24, 2017 at 6:11:19 PM UTC-5, Ja

How can I re-order rows in a table (hiccup)?

2017-02-24 Thread John Gabriele
an, {sigh, deep breath} this, which doesn't work: <https://gist.github.com/uvtc/ca819f08fe7ead81e13055f001a994e3>. Thanks! -- John -- 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: Good Clojure Projects for the Classroom?

2017-02-06 Thread John Jacobsen
all or large depending on the skill level and the time available. You'd want to introduce them to a few libraries, like clj-http for REST API calls and Cheshire for JSON parsing. Maybe even Incanter or similar for data analysis (rabbit hole warning). Best of luck, John J. [1] https://data

Re: Clojure.spec, maps, restrict valid keywords, easier way?

2017-02-03 Thread John Schmidt
I suggest something like (defn fetch-encrypted [] (fetch-important-data {:encrypt true})) + unit tests On Friday, February 3, 2017 at 2:56:34 AM UTC+1, Michael Gardner wrote: > > What would be the Right Way to deal with typos like (fetch-important-data > {:encypt true}), where the :encrypt key i

Re: (System/console) is nil?

2017-02-01 Thread John Szakmeister
but not at the REPL (probably because things are being redirected for the REPL). -John -- 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

Re: [ANN] Gorilla REPL v0.4.0

2017-01-31 Thread John Szakmeister
It looks like the v0.4.0 and v0.3.6 tags point to the same thing in the gorilla-repl repo, so the v0.4.0 tag isn't picking up the new commits. -John On Mon, Jan 30, 2017 at 1:58 PM, Jony Hudson wrote: > Hi All, > > it's a pleasure to announce a new release of Gorilla REPL :

Re: associative destructuring on a list? (using :keys)

2017-01-09 Thread John Gabriele
remembered seeing an explanation of it somewhere. Turns out I'd forgotten reading about that bit of magic in the "Clojure Programming" book (p.35). -- John On Friday, January 6, 2017 at 7:36:51 PM UTC-5, Francis Avila wrote: > A list/seq (not a vector) which is destructured as a map

associative destructuring on a list? (using :keys)

2017-01-06 Thread John Gabriele
I've used associative destructing in the usual fashion: some-app.core=> (def m {:a 1 :b 2}) #'some-app.core/m some-app.core=> (let [{:keys [a b]} m] (str a "-" b)) "1-2" but what is going on here: some-app.core=> (def li '(:a 1 :b 2)) #'some-app.core/li ;; Wat?

Re: clojure.spec bug?

2017-01-02 Thread John Schmidt
No worries! Big thanks for digging into this, I saw your update on the JIRA as well and it certainly seems like you've found the likely culprit. On Monday, January 2, 2017 at 4:47:53 PM UTC+1, miner wrote: > > > On Jan 1, 2017, at 7:13 PM, John Schmidt > wrote: > >

Re: [ANN] clj-cbor - Concise Binary Object Representation

2017-01-02 Thread John Schmidt
Looks neat! What would you say are the pros and cons of CBOR compared to Fressian , which seems to have similar goals? On Thursday, December 29, 2016 at 5:34:36 AM UTC+1, Gregory Look wrote: > > mvxcvi/clj-cbor is a nati

Re: Recursive specs & forward declarations

2017-01-02 Thread John Schmidt
(there are no preds!). Because the maps are > using required keys, it has to try to create them. > > > On Sunday, January 1, 2017 at 9:04:20 PM UTC-6, John Schmidt wrote: >> >> I just ran in to a similar issue: >> >> - >> >

Re: Recursive specs & forward declarations

2017-01-01 Thread John Schmidt
I just ran in to a similar issue: - (require '[clojure.spec :as s]) (s/def ::a (s/keys :req [::b])) (s/fdef ::a-fn :args (s/cat :arg ::a) :ret ::a) (s/def ::b (s/keys :req [::a-fn])) ;; All of these fail even with s/*recursion-limit* bound to 1. (s/exercise ::

Re: clojure.spec bug?

2017-01-01 Thread John Schmidt
16:00 AM UTC-6, miner wrote: >> >> >> On Dec 30, 2016, at 9:42 AM, John Schmidt > > wrote: >> >> (s/def ::game1 #(satisfies? Game %)) >> (s/def ::game2 (partial satisfies? Game)) >> >> >> (s/explain ::game2 (spec-test.foo/->Foo

Re: clojure.spec bug?

2016-12-30 Thread John Schmidt
ttp://corfield.org/ > > "If you're not annoying somebody, you're not really alive." > -- Margaret Atwood > > > > On 12/30/16, 6:42 AM, "John Schmidt" on behalf of john.sc...@gmail.com > wrote: > > > > Hello folks! > > &g

clojure.spec bug?

2016-12-30 Thread John Schmidt
he `extend-type` is important. If I inline the Game protocol implementation in the defrecord, it works. Any ideas? Thanks, John -- 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 No

Re: [moderated] I don't understand what (:t :t) means

2016-12-28 Thread John Gabriele
st a keyword, like `:foo` or `:bar`. (In case you were thinking of Scheme, where `#t` is the boolean true.) * you can always check what type something is by doing `(class that-thing)` (though, in this case, as you've already seen, `(:t :t)` results in `nil`). -- John -- You rece

Re: Clojure For Scripting

2016-12-08 Thread John Gabriele
On Thursday, December 8, 2016 at 3:46:25 PM UTC-5, Asim Jalis wrote: > > I wrote a blog post on how to quickly get started with Clojure. > > How To Use Clojure For Scripting > http://asimjalis.github.io/blog/2016/12/07/clojure-for-scripting.html > You might also look at [inlein](http://inlein.org/

Re: Clojure infrastructure update

2016-11-19 Thread John Jacobsen
Great news, Alex. One question not on your list: are there any plans to put JIRA behind HTTPS? I went to change my password recently and noticed my username/password would be sent in the clear. > > Thanks for all the work you do for the community. John J. -- You received this m

Re: Deriving a protocol from a protocol...

2016-10-31 Thread John Szakmeister
l aspects though. This might be a case where it's better for us to do this part in Java. Thanks for the information. -John -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.co

Deriving a protocol from a protocol...

2016-10-31 Thread John Szakmeister
but I thought I'd ask and see if there is some other approach I may be missing. Thanks! -John -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members ar

Re: Possible ClojureScript compiler issue...

2016-10-19 Thread John Szakmeister
Fantastic! Thank you! -John On Tue, Oct 18, 2016 at 11:49 PM, David Nolen wrote: > This issue is fixed in master now thanks to Thomas Heller. The performance > hit is negligible. > > Thank you for the report. > > David > > On Tue, Oct 18, 2016 at 3:45 PM, John Szakme

Re: Possible ClojureScript compiler issue...

2016-10-18 Thread John Szakmeister
gain, much of what I see out there is the js->clj is the way to convert data, and having this problem lurking seems like setting folks up for failure. I'm pretty persistent when it comes to troubleshooting this stuff, but I could see others being awfully frustrated by the result. So

Re: Possible ClojureScript compiler issue...

2016-10-18 Thread John Szakmeister
there was a way to so "ignore the transit extensions", that would change things though. -John On Tue, Oct 18, 2016 at 7:36 AM, Gary Trakhman wrote: > If you're parsing raw json streams/strings, I think transit claims to be a > 30x perf improvement over js/

Re: Possible ClojureScript compiler issue...

2016-10-18 Thread John Szakmeister
idea. I hope some version of your patch is incorporated. -John -- 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

Re: Possible ClojureScript compiler issue...

2016-10-15 Thread John Szakmeister
ing JSON into Clojure values. Changing the (admittedly > questionable) behavior of `js->clj` will only lead to more breakage. I'll definitely look at alternatives. It'd be nice if js->clj had documentation on this shortcoming though, and perhaps pointers to better alternatives. Tha

Possible ClojureScript compiler issue...

2016-10-15 Thread John Szakmeister
one seen an issue like this before? Does anyone have any ideas what is going on? We have these short keys in our data, and it'd be pretty painful to make them something else (especially since the names are meaningful to those in the know, despite them being cryptic--they refer to bit settings o

  1   2   3   4   5   6   7   8   9   10   >