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
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 > > On Fri, Dec 4, 2020 at 7

Re: Calling Native C-code from Clojure

2020-12-05 Thread John Doe
ably 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:* Rather than go with

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

Re: Clojure Spec and Human Readable Error Messages

2020-02-15 Thread John Shaffer
#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 phrase. If you do get som

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

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

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

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 >

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

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

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 >

Re: Any way to replace function body?

2019-01-19 Thread John Newman
t 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 existing (

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

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

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
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 was going to impleme

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 pro

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!

[CfP] 2018 Scheme and Functional Programming Workshop

2018-06-25 Thread John Clements
ingham. 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 Clements, General Chair William E. Byr

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
s or clojure/spec/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:

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

2018-04-19 Thread John Newman
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 <didi...@gmail.com&

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

2018-04-19 Thread John Newman
-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 <areding...@gmail.com>

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

2018-04-18 Thread John Newman
like this recently, so thanks! V/r John On Wed, Apr 18, 2018, 9:05 PM Alex Redington <areding...@gmail.com> 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 dat

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" <john...@gmail.com> 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. > > O

Re: what does future do after fn finish ?

2018-01-31 Thread John Newman
cers are all potentially useful. If > parallelization leads to complex coordination needs, core.async can help > too. > > On Wed, Jan 31, 2018 at 5:18 PM John Newman <john...@gmail.com> wrote: > >> Agents manage a pool of threads for you. Try doing it without the future >>

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 <grzebyta@gmail.com> wrote: > Thanks a lot. I will check it tomorrow. > > J &g

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"

Re: 1.8 vs 1.9 performance

2017-12-25 Thread John Stevenson
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 John -- You

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 <john...@gmail.com> wrote: > This might be a step towards a more cl

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 <didi...@gmail.com> wrote: > I'll have a look at all these other projects, its very interesting. Unison > seems to embody the spirit or Richs talk

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

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

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

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

Re: hello world question !!!

2017-10-14 Thread John M. Switlik
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" group. To post to

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

Re: [ANN] faster-multimethods

2017-10-12 Thread John McDonald
not merge it to clojure.core 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 <palisades.la...@gmail.com>: > >> Beta release (0.1.0) of faster

[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
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, send email

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

2017-09-20 Thread John McDonald
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 <palisades.la...@gmail.com> > wrote: > >> 2nd issue: Benchmarks >>

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

2017-09-20 Thread John McDonald
, John McDonald <palisades.la...@gmail.com> 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

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

2017-09-20 Thread John McDonald
verloading the metadata mechanism after all? On Wed, Sep 20, 2017 at 11:57 AM, John McDonald <palisades.la...@gmail.com> wrote: > 2nd issue: Benchmarks > > I use both criterium and simple 'run repeatedly and divide the clock time'. > > I've had trouble getting consistent resu

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

2017-09-20 Thread John McDonald
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 Wed, Sep 20, 2017 at 11:17 AM, John McDonald

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

2017-09-20 Thread John McDonald
for machine learning, and other applications, by summing, composing, etc. other functions. On Tue, Sep 19, 2017 at 11:34 PM, Alex Miller <a...@puredanger.com> wrote: > > > On Tuesday, September 19, 2017 at 8:01:07 PM UTC-5, John Alan McDonald > wrote: >> >> I'd like t

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

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

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

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

Re: class and case

2017-05-12 Thread John Mastro
ss java.lang.String" isn'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.

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

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

2017-04-25 Thread John Gabriele
?`! 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 UTC-4

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

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)

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

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

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

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

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

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

Re: Contribute Specter to Clojure core?

2017-03-04 Thread John Newman
quot; <d...@mobileink.com> wrote: > > > > On Mar 3, 2017 6:27 PM, "John Newman" <john...@gmail.com> 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

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

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

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, James Reeves

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

2017-02-24 Thread John Gabriele
his, 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@googlegroups.com Note that posts from n

Re: Good Clojure Projects for the Classroom?

2017-02-06 Thread John Jacobsen
l 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.cityofchi

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

Re: (System/console) is nil?

2017-02-01 Thread John Szakmeister
p (it's non-nil), 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 membe

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 <jonyepsi...@gmail.com> wrote: > Hi All, > > it's a pleasure to announce a new rel

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

2017-01-09 Thread John Gabriele
emembered 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 wil

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 <john.sc...@gmail.com > >

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

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 <john.sc...@gmail.com >> > wrote: >> >> (s/def ::game1 #(satisfies? Game %)) >> (s/def ::game2 (partial satisfies? Game)) >> >> >> (s/explain ::game2 (

Re: clojure.spec bug?

2016-12-30 Thread John Schmidt
ield.org/ > > "If you're not annoying somebody, you're not really alive." > -- Margaret Atwood > > > > On 12/30/16, 6:42 AM, "John Schmidt" <clo...@googlegroups.com > on behalf of john.sc...@gmail.com > wrote: > > > > Hello fol

clojure.spec bug?

2016-12-30 Thread John Schmidt
. 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 Note that posts from new members

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

2016-12-28 Thread John Gabriele
eyword, 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 received this m

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

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
terested in the protocol 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 clojur

Deriving a protocol from a protocol...

2016-10-31 Thread John Szakmeister
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 are moderate

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 <dnolen.li...@gmail.com> 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,

Re: Possible ClojureScript compiler issue...

2016-10-18 Thread John Szakmeister
Again, 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 I hope t

Re: Possible ClojureScript compiler issue...

2016-10-18 Thread John Szakmeister
. :-( If 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 <gary.trakh...@gmail.com> wrote: > If you're parsing raw json streams/strings, I think transit claims to be a > 30x perf improvement over

Re: Possible ClojureScript compiler issue...

2016-10-18 Thread John Szakmeister
nel 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 -

Re: Possible ClojureScript compiler issue...

2016-10-15 Thread John Szakmeister
vely converting 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 altern

Possible ClojureScript compiler issue...

2016-10-15 Thread John Szakmeister
ny 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 on various motors). I'd be happy to file a ticket, if th

Re: Keywords with colon on the backside?

2016-09-23 Thread John Mastro
Timothy Baldridge <tbaldri...@gmail.com> wrote: > The syntax (I think) comes from Ruby although they call keywords "symbols". The reader syntax for Common Lisp's keywords has the leading colon too. John -- You received this message because you are subscribed t

Re: [ANN] beta.clojars.org: new Clojars infrastructure that needs testing

2016-09-21 Thread John Gabriele
On Tuesday, September 20, 2016 at 7:17:55 PM UTC-4, Daniel Compton wrote: > > Hi folks > > We’re moving the Clojars infrastructure from Linode to the very kind folks > at Rackspace. {snip} > Thanks, sounds like a lot of work. Any particular reasons for the switch? -- You received this message

Re: Clojure docstring style

2016-09-21 Thread John Gabriele
On Wednesday, September 21, 2016 at 1:10:37 PM UTC-4, John Gabriele wrote: > > On Wednesday, September 21, 2016 at 9:54:23 AM UTC-4, Eli Naeher wrote: >> >> On Wed, Sep 21, 2016, at 06:36 AM, nare...@helpshift.com wrote: >> >> Is there a convention to be followe

  1   2   3   4   5   6   7   8   9   10   >