Re: how do I debug a cryptic XML error?

2022-02-15 Thread Laws
e >> DelegatingMethodAccessorImpl.java: 43 >> >>jdk.internal.reflect.NativeMethodAccessorImpl.invoke >> NativeMethodAccessorImpl.java: 77 >> >> jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 >> NativeMethodAccessorImpl.java >&

Re: how do I debug a cryptic XML error?

2022-02-15 Thread Laws
gt; > jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 > NativeMethodAccessorImpl.java > > com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse > SAXParserImpl.java: 317 > > *java.lang.IllegalArgumentException*: > > > I'm wondering, how do I figure out what is wrong here?

how do I debug a cryptic XML error?

2022-02-15 Thread Laws
serImpl.parse SAXParserImpl.java: 317 *java.lang.IllegalArgumentException*: I'm wondering, how do I figure out what is wrong here? I'm going to assume the government is offering reasonably standard XML, so where would the problem arise? How do I figure out a way around this? The CPE dict

Re: What Emacs framework do you prefer?

2021-08-10 Thread Laws
t. I just installed Emacs and I'm wondering what kind of > starter-kit or framework do people prefer nowadays? Does anyone want to > either recommend a framework or share an init file that has some > customizations for Clojure? -- You received this message because you are subscribed to

Re: What Emacs framework do you prefer?

2021-08-10 Thread Zack Teo
Book > > Pro that I > > just bought. I just installed Emacs and I'm wondering what kind > > of > > starter-kit or framework do people prefer nowadays? Does anyone > > want to > > either recommend a framework or share an init file that has some > > cus

Re: What Emacs framework do you prefer?

2021-08-10 Thread Jiacai Liu
decided my next project will be pure Clojure. I'm setting everything up on a new MacBook Pro that I just bought. I just installed Emacs and I'm wondering what kind of starter-kit or framework do people prefer nowadays? Does anyone want to either recommend a framework or share an init file that has

Re: What Emacs framework do you prefer?

2021-08-10 Thread Oleksandr Shulgin
On Tue, Aug 10, 2021 at 4:50 AM Laws wrote: > Does anyone want to either recommend a framework or share an init file > that has some customizations for Clojure? https://cider.mx/ Cheers, -- Alex -- You received this message because you are subscribed to the Google Groups "Clojure" group.

What Emacs framework do you prefer?

2021-08-09 Thread Laws
I've been away from Clojure for 3 years but I've decided my next project will be pure Clojure. I'm setting everything up on a new MacBook Pro that I just bought. I just installed Emacs and I'm wondering what kind of starter-kit or framework do people prefer nowadays? Does anyone want to either

RE: How can I do something like (= (class ds) next.jdbc.connection)??

2019-10-22 Thread Sean Corfield
can use in an if statement, when I'm adding in a runtime check? Maybe take a step back and explain the problem you are trying to solve here? It sounds like you’re trying to jump into some really low-level stuff that you almost certainly do not need to do. You asked “What is the correct way to do

Re: How can I do something like (= (class ds) next.jdbc.connection) ??

2019-10-22 Thread Laws
us who learn Clojure without knowing Java have a harder time picking this up. Part of my question was "How do I know this?" Or in your case, how did you know this? The reason I included the link to the Github page is I was hoping to find out what on that page I was supposed to look

Re: How can I do something like (= (class ds) next.jdbc.connection) ??

2019-10-17 Thread Sean Corfield
where you can ask real time questions in the #beginners channel and next.jdbc-specific questions in the #sql channel. On Thu, Oct 17, 2019 at 6:03 PM Laws wrote: > If I do this: > > (class ds) > > I see: > > next.jdbc.connection$url_PLUS_etc$reify__555 > > Is there

How can I do something like (= (class ds) next.jdbc.connection) ??

2019-10-17 Thread Laws
If I do this: (class ds) I see: next.jdbc.connection$url_PLUS_etc$reify__555 Is there anyway I can match against this? I'd like a runtime check to know that the code really does have a database connection. Imagine code like this: (if (= next.jdbc.connection (class ds)) (println &quo

Re: Code style: how do you order map keys?

2019-09-20 Thread Matching Socks
Clarity is important. Considering the conundrum of sorting namespace aliases, vs using the fully-qualified name as the implicit sort key despite the apparent alias; and the burden of shuffling everything after a refactoring; any sorted order will sooner or later be "broken", so you might as

Code style: how do you order map keys?

2019-09-18 Thread Yuri Govorushchenko
, password, port, user`. Do you try to maintain the same order of map keys (including keys in specs) across the files? If yes, what rules do you follow? Thank you. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, s

Nice blog entry on not trying to do much with `:prep-tasks` in `lein`

2019-06-07 Thread Alan Thompson
Makes a good point that other tools should be used for non-clojure build steps. https://grishaev.me/en/lein/ -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new

Re: What do Clojure developers use for recurring functions, other than at-at

2018-12-19 Thread Rowan Hargreaves
+1 for at-at. I've used it recently and it works well. It uses ScheduledThreadPoolExecutor etc under the hood, and it's only 350 lines of readable code if you want to dig in. I have found its interface easy to use. As well as scheduling at specific times (the at function) or at regular

Re: What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread Laurens Van Houtven
) assuming you're >> using AWS yourself anyway. If you don't care about batching maybe even just >> attach a Lambda to the write-to-S3 bucket itself instead of checking every >> 15m? >> >> If you want to do it in-process, my tool of choice is ztellman's >> manif

Re: What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread Adam Clements
it for years because it just works and even though it's used in production nobody has found any issues or needed it to do anything it doesn't already do. I think the same is probably true of at-at. Adam On Mon, 17 Dec 2018, 9:46 pm James Reeves, that does sound like the right way to go. I'll do

Re: What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread lawrence . krubner
ng every > 15m? > > If you want to do it in-process, my tool of choice is ztellman's manifold: > https://github.com/ztellman/manifold/blob/d67a8c1b9f1268c094895d70dbbf146521f5774b/src/manifold/time.clj > > On Mon, Dec 17, 2018 at 1:54 PM > > wrote: > >> I'm comi

Re: What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread lawrence . krubner
James Reeves, that does sound like the right way to go. I'll do that. On Monday, December 17, 2018 at 3:31:01 PM UTC-5, James Reeves wrote: > > > I'd use an executor: > > (ns example.main > (:import [java.util.concurrent Executors TimeUnit])) > > (def sc

Re: What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread James Reeves
so I assume it is abandoned. I > have two questions about this: > > 1.) how else do Clojure programmers usually call recurring functionality? > > 2.) I am ignorant about the JVM, so I'm afraid I have to ask, at a > fundamental level, how does at-at work? I know that if a functio

Re: What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread Tim Visher
On Mon, Dec 17, 2018 at 2:54 PM wrote: > But at-at has not been updated in 6 years, so I assume it is abandoned. I > have two questions about this: > A common bit of wisdom here in the Clojure community is that time since last update is not always (or even often) a sign of abandonment but

Re: What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread Laurens Van Houtven
? If you want to do it in-process, my tool of choice is ztellman's manifold: https://github.com/ztellman/manifold/blob/d67a8c1b9f1268c094895d70dbbf146521f5774b/src/manifold/time.clj On Mon, Dec 17, 2018 at 1:54 PM wrote: > I'm coming back to Clojure development after a year away. This is a f

What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread lawrence . krubner
that fetches files from an AWS S3 bucket, every 15 minutes. I had previously used the at-at library for this: https://github.com/overtone/at-at But at-at has not been updated in 6 years, so I assume it is abandoned. I have two questions about this: 1.) how else do Clojure programmers usually

Re: Question: How do you organize large clojure projects?

2018-11-26 Thread 'somewhat-functional-programmer' via Clojure
Thank you, it does help. I almost went the monorepo route but for some reason thought I'd have one project.clj file with one giant list of dependencies. Having a monorepo but with different dependency sets makes a ton of sense and I think would have been much easier to manage. ‐‐‐

Question: How do you organize large clojure projects?

2018-11-14 Thread Patrik Sundberg
I've been happy using a monorepo with boot, and a build.boot with many building blocks that can be mixed and matched for many deployables (uberjars in my case). In my build.boot I define my internal blocks, but also defs for external deps like eg postgres and grpc. That way I have one place for

Question: How do you organize large clojure projects?

2018-11-14 Thread 'somewhat-functional-programmer' via Clojure
dependencies -- even if a function made sense in a different namespace by name -- if it needed deps that I already had in another project, I moved the function to that project. For example, in the Java GIS world, if you do anything with swing components, you can easily pull in 100s of MBs

Re: How do I use spec and deftype together?

2018-07-05 Thread markus . agwin
Just in case someone stumbles over this post, I found a simple solution which works for me: (do (require '[clojure.spec.alpha :as s]) (import '(clojure.lang ISeq)) (defprotocol Foo (foo [this])) (defrecord Bar [bar] Foo (foo [this] (.bar this))) (deftype Baz [bar] Foo (foo

RE: How do I use spec and deftype together?

2018-07-04 Thread Sean Corfield
So is it best practice to implement map in the deftype to make it spec-able? Are there examples somewhere that show how to do this in a canonical way? If you want a `deftype` that is spec-able as a map, why not just use `defrecord`? Manually implementing the various map-related interfaces

Re: How do I use spec and deftype together?

2018-07-04 Thread markus . agwin
So is it best practice to implement map in the deftype to make it spec-able? Are there examples somewhere that show how to do this in a canonical way? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: How do I use spec and deftype together?

2018-07-04 Thread markus . agwin
So is it best practice to implement map in the deftype to make it spec-able? Are there examples somewhere that show how to do this in a canonical way? On Wednesday, July 4, 2018 at 12:51:29 PM UTC+2, Leon Grapenthin wrote: > > Spec doesn't check object fields. The defrecord case works b

Re: How do I use spec and deftype together?

2018-07-04 Thread Leon Grapenthin
did not find an answer. > > An example, where defrecord works fine but deftype fails: > > (do > (require '[clojure.spec.alpha :as s]) > (defprotocol Foo (foo [this])) > (defrecord Bar [bar] Foo (foo [this] (.bar this))) > (deftype Baz [bar] Foo (foo [this] (.bar this)

How do I use spec and deftype together?

2018-07-04 Thread markus . agwin
The same question was asked on https://clojurians-log.clojureverse.org/clojure-spec/2018-01-19 but I did not find an answer. An example, where defrecord works fine but deftype fails: (do (require '[clojure.spec.alpha :as s]) (defprotocol Foo (foo [this])) (defrecord Bar [bar] Foo (foo

Re: What does the ref *loaded-libs* do?

2018-02-05 Thread Stephen Gilardi
It is there to support the “:reload” and “:reload-all” features of “require” and to help separate the concern of loading libs from the concern of tracking namespaces. --Steve > On Jan 29, 2018, at 6:36 PM, Raymond Huang <12ay.hu...@gmail.com> wrote: > > I was poking around `tools.namespace`

What does the ref *loaded-libs* do?

2018-02-05 Thread squeegee
It is there to support the “:reload” and “:reload-all” features of “require” and to help separate the concern of loading libs from the concern of tracking namespaces. --Steve -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: what does future do after fn finish ?

2018-02-03 Thread Jacek Grzebyta
ng your code into a list > data structure containing symbols, and before compiling to byte code - it > doesn't do anything directly. > > On Fri, Feb 2, 2018 at 3:55 PM Jacek Grzebyta <grzebyta@gmail.com> > wrote: > >> OK I found what makes the memory leak. >> >>

Re: what does future do after fn finish ?

2018-02-02 Thread Justin Smith
-> is just a list transform performed after reading your code into a list data structure containing symbols, and before compiling to byte code - it doesn't do anything directly. On Fri, Feb 2, 2018 at 3:55 PM Jacek Grzebyta <grzebyta@gmail.com> wrote: > OK I found what makes the

Re: what does future do after fn finish ?

2018-02-02 Thread Jacek Grzebyta
with -> which makes new thread as well. I was surprised that -> makes trouble but after thinking that might be expected. Especially that internally the wrapper doesn't do simple mapping - it uses some iterator, etc. Anyway the machinery is fragile. It seems I need to rewrite code and repla

Re: what does future do after fn finish ?

2018-02-02 Thread Jacek Grzebyta
On 2 February 2018 at 08:34, Niels van Klaveren wrote: > +1 for Claypoole, it removed the needs of using agents or futures in 95% > of the cases in my code. > > Thanks a lot. I modify the code using claypoole. I imagine with-shutdown will close the pool properly

Re: what does future do after fn finish ?

2018-02-02 Thread Niels van Klaveren
s folks. I see now! It should be a list of agents not list of >>> futures within agent. Also any task sent to a agent is processed >>> within a thread anyway so I do not need to add future... >>> >>> On 1 February 2018 at 02:17, John Newman <joh...@gmail

[job] S.F Bay Area: Enjoy using Clojure to do a bit of everyhing?

2018-02-01 Thread Arthur Ulfeldt
Yummly, Redwood City, CA I'm looking for folks who genuinly enjoy using Clojure to do a great variety of things like Backend mobile APIs, Web services, Infrastructre/AWS automation, security scanning, and all sorts of other things. It's really a lot of fun. If you're intersted please email

Re: what does future do after fn finish ?

2018-02-01 Thread Alan Thompson
rote: > >> Thanks folks. I see now! It should be a list of agents not list of >> futures within agent. Also any task sent to a agent is processed >> within a thread anyway so I do not need to add future... >> >> On 1 February 2018 at 02:17, John Newman <john...@gm

Re: what does future do after fn finish ?

2018-02-01 Thread Justin Smith
yta@gmail.com> wrote: > Thanks folks. I see now! It should be a list of agents not list of futures > within agent. Also any task sent to a agent is processed within a > thread anyway so I do not need to add future... > > On 1 February 2018 at 02:17, John Newman <john...@gmail.c

Re: what does future do after fn finish ?

2018-02-01 Thread Jacek Grzebyta
Thanks folks. I see now! It should be a list of agents not list of futures within agent. Also any task sent to a agent is processed within a thread anyway so I do not need to add future... On 1 February 2018 at 02:17, John Newman <john...@gmail.com> wrote: > Ah, he's using one age

Re: what does future do after fn finish ?

2018-01-31 Thread John Newman
n Jan 31, 2018 8:32 PM, "Justin Smith" <noisesm...@gmail.com> wrote: > >> Doing all the actions via one agent means that the actions are serialized >> though - you end up with no performance improvement over doing them all in >> a doseq in one future - the right

Re: what does future do after fn finish ?

2018-01-31 Thread John Newman
ns that the actions are serialized > though - you end up with no performance improvement over doing them all in > a doseq in one future - the right way to do this tends to be trickier than > it looks at first glance, and depends on your requirements. agents, the > claypoole library, and redu

Re: what does future do after fn finish ?

2018-01-31 Thread Justin Smith
Doing all the actions via one agent means that the actions are serialized though - you end up with no performance improvement over doing them all in a doseq in one future - the right way to do this tends to be trickier than it looks at first glance, and depends on your requirements. agents

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: what does future do after fn finish ?

2018-01-31 Thread Jacek Grzebyta
and after >>>> that: >>>> >>>> (reduce + (map #(deref %) @data-loading-tasks)) >>>> >>> >> As a control, tasks return number of written records. >> >> >> >>> >>>> For some reason I see the happy c

Re: what does future do after fn finish ?

2018-01-31 Thread Justin Smith
and after >>> that: >>> >>> (reduce + (map #(deref %) @data-loading-tasks)) >>> >> > As a control, tasks return number of written records. > > > >> >>> For some reason I see the happy collecting (see attached screenshot of >>

Re: what does future do after fn finish ?

2018-01-31 Thread Jacek Grzebyta
ched screenshot of >> jconsole). >> > > "happy" = "heap"? > Both. As you can see on attached screenshot the heap usage grows easy until aver. ~2 1/4 G than keep that for a few minutes. In that moment I stopped. After that starts grow till ~4G with tendency to

Re: what does future do after fn finish ?

2018-01-31 Thread Justin Smith
reduce + (map #(deref %) @data-loading-tasks)) >> >> For some reason I see the happy collecting (see attached screenshot of >> jconsole). >> > > "happy" = "heap"? > > >> After seeing the source code of future I suppose that the memory (

Re: what does future do after fn finish ?

2018-01-31 Thread James Reeves
he source code of future I suppose that the memory (data are > kept as #{} set) is not released. The task returns only integer so I do not > think that might cause the problem. > Can you provide more detail? You keep alluding to things that you don't provide code for, such as the set

what does future do after fn finish ?

2018-01-31 Thread Jacek Grzebyta
-for and after that: (reduce + (map #(deref %) @data-loading-tasks)) For some reason I see the happy collecting (see attached screenshot of jconsole). After seeing the source code of future I suppose that the memory (data are kept as #{} set) is not released. The task returns only integer so I do

What does the ref *loaded-libs* do?

2018-01-29 Thread Raymond Huang
I was poking around `tools.namespace` and I found it interesting that the implementation of `remove-lib` is: ```(defn remove-lib "Remove lib's namespace and remove lib from the set of loaded libs." [lib] (remove-ns lib) (dosync (alter @#'clojure.core/*loaded-libs* disj lib))) ``` I’m

Re: Port graphs: What would Rich Hickey do?

2018-01-10 Thread Ben Kovitz
On Monday, January 8, 2018 at 12:14:59 AM UTC-5, James Gatannah wrote: > FWIW, I think https://leanpub.com/specter looks extremely interesting. > (Or it may be awful...I haven't had a chance to read it yet, much less work > through the exercises). > Actually, I worked through that ebook last

Re: Port graphs: What would Rich Hickey do?

2018-01-07 Thread James Gatannah
On Thursday, January 4, 2018 at 5:51:27 PM UTC-6, Ben Kovitz wrote: > > > Well! So far, Specter appears to have taken the "path map" idea that I'd > been toying with to its ultimate logical conclusion—far better than I could > ever do it. Nathan Marz even says that nee

Re: Port graphs: What would Rich Hickey do?

2018-01-04 Thread Ben Kovitz
e taken the "path map" idea that I'd been toying with to its ultimate logical conclusion—far better than I could ever do it. Nathan Marz even says that needing to manipulate tricky graphs "forced" him to come up with Specter. If I understand it correctly, Specter would even a

Re: Port graphs: What would Rich Hickey do?

2018-01-04 Thread Christopher Small
Yes; Datomic really is great. There's plenty of wonderful stuff I haven't even mentioned, like database as a value, persistent history, snapshots at a timepoint, transaction metadata, smart peer replication etc. It's kind of the best thing since sliced bread. But if you don't need all that jazz

Re: Port graphs: What would Rich Hickey do?

2018-01-04 Thread Gary Verhaegen
n. > > > I could even use ubergraph to represent the simplicial graph, and thereby > get access to all code that follows the loom protocols. > >> I have seen this approach of encoding graphs into other graphs work out >> pretty well in other contexts. > > > Do you r

Re: Port graphs: What would Rich Hickey do?

2018-01-04 Thread Ben Kovitz
translation. I could even use ubergraph to represent the simplicial graph, and thereby get access to all code that follows the loom protocols. I have seen this approach of encoding graphs into other graphs work out > pretty well in other contexts. Do you remember any of those other

Re: Port graphs: What would Rich Hickey do?

2018-01-04 Thread Ben Kovitz
On Tuesday, January 2, 2018 at 3:11:45 PM UTC-5, Christopher Small wrote: > http://docs.datomic.com/entities.html > > http://docs.datomic.com/pull.html > Thanks—this is really good stuff! Not that I expected anything less, but it's a happy surprise that it applies so well to graphs. Now

Re: Port graphs: What would Rich Hickey do?

2018-01-04 Thread Gary Verhaegen
t; value is the edges incident to it. And when you chain data patterns in > > Datalog queries, that's a lot like navigating through a graph. > > That's very much in line with what I was thinking you might want to do in > this setting. > > You should also take a look at the entity api.

Re: Port graphs: What would Rich Hickey do?

2018-01-02 Thread Christopher Small
ery much in line with what I was thinking you might want to do in this setting. You should also take a look at the entity api. It let's you traverse the graph via these entity objects which behave more or less like a dictionary of the av pairs associated with a particular entity in the datab

Re: Port graphs: What would Rich Hickey do?

2018-01-02 Thread Ben Kovitz
Christopher Small, Your suggestion to look into Datomic definitely turned up a new idea. I went through the Datalog tutorial at http://www.learndatalogtoday.org (which is excellent, by the way), and noticed that the attribute names in the datoms are a lot like the port labels in port graphs. A

Re: Port graphs: What would Rich Hickey do?

2018-01-01 Thread Ben Kovitz
proach sounds to me like one of the best ideas ever (long predating computers, even). Thanks! I'll have a closer look. This might even be what Rich Hickey would do! :) Do you need to be able to attach data to specific edges instances? > Yes. Every edge needs to be able to have an arbitra

Re: Port graphs: What would Rich Hickey do?

2018-01-01 Thread Christopher Small
Do you need to be able to attach data to specific edges instances? Or would it be sufficient to be able to have different types of edges, and be able to associate data with those abstract edge types? If the latter, you might want to look at Datomic (also authored by Rich Hickey), DataScript

Re: Port graphs: What would Rich Hickey do?

2018-01-01 Thread Raoul Duke
€0.02 i like option #3, i think it would be possibly nice for edges to be named based on the ports they connect. -- 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

Port graphs: What would Rich Hickey do?

2018-01-01 Thread Ben Kovitz
I'm making a little library for myself to represent a kind of graph. I want to make it simple, the way Rich Hickey designed much of Clojure. My designs so far have lacked that kind of plainness and ease of use. I keep wondering, "What would Rich Hickey do?" Even if you're not Rich Hic

Re: Datomic evals clojure subset in datalog - how can I do this?

2017-09-03 Thread Karsten Schmidt
#expressions Hth! On 1 September 2017 at 14:50, Dustin Getz <dustin.g...@gmail.com> wrote: > Datomic allows clojure.core fns to be embedded inside datalog queries, > except eval (http://docs.datomic.com/query.html) > > 1. Do we know how secure is this - what if the datalog comes from untr

Datomic evals clojure subset in datalog - how can I do this?

2017-09-01 Thread Dustin Getz
Datomic allows clojure.core fns to be embedded inside datalog queries, except eval (http://docs.datomic.com/query.html) 1. Do we know how secure is this - what if the datalog comes from untrusted user input? 2. What is the best way to implement restricted-eval like this on jvm, compared

Re: How do I just use AOT compiled class files over clj(c) source with a leiningen uberjar?

2017-04-03 Thread lvh
derscores in the >> Clojure file name. >> >> This appears to be due to this source file: https://github.com/cloju >> re/clojure/blob/master/src/clj/clojure/core_instant18.clj ; and the lack >> of matching class file can be explained because it is in the clojure.core >>

Re: How do I just use AOT compiled class files over clj(c) source with a leiningen uberjar?

2017-04-03 Thread Alex Miller
this though. > Zach and I actually talked about this again at Clojure/west this week and I think he's going to do some work on it. I can't really comment as I don't know what is being requested. -- You received this message because you are subscribed to the Google Groups "Clojure&

Re: How do I just use AOT compiled class files over clj(c) source with a leiningen uberjar?

2017-04-03 Thread Alex Miller
ile name. > > This appears to be due to this source file: > https://github.com/clojure/clojure/blob/master/src/clj/clojure/core_instant18.clj > > ; and the lack of matching class file can be explained because it is in the > clojure.core namespace. > > Do I misunderstand how

Re: How do I just use AOT compiled class files over clj(c) source with a leiningen uberjar?

2017-04-01 Thread lvh
Hi Daniel, Thanks, I didn't know about Zach's talk. FWIW: that instant18 clj does not occur in the _uberjar_ (before proguard gets its grubby mitts on it). lvh On Sat, Apr 1, 2017 at 2:24 PM, Daniel Compton < daniel.compton.li...@gmail.com> wrote: > -keep class clojure.core_instant18__init

Re: How do I just use AOT compiled class files over clj(c) source with a leiningen uberjar?

2017-04-01 Thread Daniel Compton
re_instant18.clj > ; and the lack of matching class file can be explained because it is in the > clojure.core namespace. > > Do I misunderstand how :aot :all works? Are clj files always going to > exist in the resulting uberjar if I want Clojure to work? > > > lvh > > -- > You received t

How do I just use AOT compiled class files over clj(c) source with a leiningen uberjar?

2017-04-01 Thread lvh ‌
/clj/clojure/core_instant18.clj ; and the lack of matching class file can be explained because it is in the clojure.core namespace. Do I misunderstand how :aot :all works? Are clj files always going to exist in the resulting uberjar if I want Clojure to work? lvh -- You received this message

How do I spec a nullary function?

2017-03-23 Thread Alex Miller
(s/fdef :args (s/cat) ... -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this

How do I spec a nullary function?

2017-03-23 Thread Didier
I'm trying to fdef a function of no arguments, how would I go about it? I only want a spec for the return value basically? -- 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

Re: Elegant way to do lazy infinite list with custom step

2016-12-14 Thread Ghadi Shayban
If you really want to have _exactly_ what Haskell does (derives the range from an example) -- yes, you could do a macro. Clojure's new spec facility (in 1.9-alphas) makes the macro arguments checked at load time too, which is extra nice: (set! *print-length* 5) ;; avoid printing infinite

Re: Elegant way to do lazy infinite list with custom step

2016-12-13 Thread Timothy Baldridge
Ah! I knew there was a way to do it via iterate, but it was 9:30pm at the time and I was tired. Nice example though. On Tue, Dec 13, 2016 at 10:03 PM, Ghadi Shayban <gshay...@gmail.com> wrote: > A common way to do it in Clojure is `iterate`, no macros necessary. As of > Clojure 1.7

Re: Elegant way to do lazy infinite list with custom step

2016-12-13 Thread Ghadi Shayban
A common way to do it in Clojure is `iterate`, no macros necessary. As of Clojure 1.7 this doesn't allocate a list at all if you reduce/fold over it: (iterate #(+ % 2) 4) On Tuesday, December 13, 2016 at 11:27:28 PM UTC-5, tbc++ wrote: > > I'm not aware of such a construct, but it's t

Re: Elegant way to do lazy infinite list with custom step

2016-12-13 Thread Alex Miller
(range 4 Long/MAX_VALUE 2) On Tuesday, December 13, 2016 at 10:14:00 PM UTC-6, bill nom nom wrote: > > In Haskell, I can get an infinite lazy list that is incremented by two by, > starting at 4 > [4,6..] > > which yields the result > [4,6,8,10...] > > the more general form > [x,y..] produces [x,

Re: Elegant way to do lazy infinite list with custom step

2016-12-13 Thread Timothy Baldridge
I'm not aware of such a construct, but it's trivial enough to write something like this using `range` or perhaps write a function that will yield a lazy seq: (defn inf-list ([x y] (cons x (cons y (inf-list x y 2 ([x y c] (cons (+ x (* c (- y x))) (lazy-seq (inf-list x y (inc

Elegant way to do lazy infinite list with custom step

2016-12-13 Thread bill nom nom
In Haskell, I can get an infinite lazy list that is incremented by two by, starting at 4 [4,6..] which yields the result [4,6,8,10...] the more general form [x,y..] produces [x, x + (y-x), x + 2 * (y-x), x + 3 * (y-x)...] Is there a way to make a macro of this in clojure, or is there something

Re: what does (seq) in zipmap do?

2016-11-30 Thread Alex Miller
, 2016 at 9:42:48 PM UTC-6, larry google groups wrote: > > I apologize for this question, because I think it has been asked before, > and yet I can not find the answer. > > In the definition of zipmap, what do these 2 lines do? > > ks (seq keys) > vs (seq vals) > &g

Re: what does (seq) in zipmap do?

2016-11-29 Thread Andy Fingerhut
calls to seq for every iteration through the loop. Andy On Tue, Nov 29, 2016 at 7:42 PM, larry google groups < lawrencecloj...@gmail.com> wrote: > I apologize for this question, because I think it has been asked before, > and yet I can not find the answer. > > In the definition of

what does (seq) in zipmap do?

2016-11-29 Thread larry google groups
I apologize for this question, because I think it has been asked before, and yet I can not find the answer. In the definition of zipmap, what do these 2 lines do? ks (seq keys) vs (seq vals) In particular, what is (seq) doing? Is this to ensure that ks is false if "keys" is emp

Re: How do I call a function in the catch block of try/catch?

2016-11-25 Thread larry google groups
Sorry, I am an idiot. I had added a try/catch to the first "convert" when I was debugging. Ignore all this. On Friday, November 25, 2016 at 6:41:57 PM UTC-5, larry google groups wrote: > > I know some of you will tell me that I shouldn't use try/catch for control > flow. That is fine. I

Re: How do I call a function in the catch block of try/catch?

2016-11-25 Thread larry google groups
When the Exception is thrown, I get: java.lang.Thread.run Thread.java: 745 java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java: 615

How do I call a function in the catch block of try/catch?

2016-11-25 Thread larry google groups
I know some of you will tell me that I shouldn't use try/catch for control flow. That is fine. I might redo this. But for now, I'd like to simply know why this doesn't work. I have this function: (defn start [] (let [filenames-as-seq-of-strings (.list (io/file "/home/ec2-user/uploads/"))]

Re: How do I set up database in the context of a web application ?

2016-11-02 Thread Alan Thompson
You can find a nice overview in the Clojure Cookbook . On Wed, Nov 2, 2016 at 2:58 PM, 'George' via Clojure < clojure@googlegroups.com> wrote: > I'd like to use datomic, but my

How do I set up database in the context of a web application ?

2016-11-02 Thread 'George' via Clojure
I'd like to use datomic, but my question applies to any database. When I used a framework in another language it was easy, the config file and ORM did setup the connection. I only installed an adapter and wrote the URI of the database.. Now as I want to use a minimal framework or to totally get

Re: Is there a standard name for this transducer? Or a more idiomatic way to do it?

2016-09-14 Thread Kevin Downey
looks like a variation of partition-by On 09/14/2016 07:16 PM, Marshall handheld Flax wrote: > This looks like a standard thing you might want to do with a transducer: > accept a stream of inputs and statefully group them into a stream of > varying-length vectors. A typical exam

Is there a standard name for this transducer? Or a more idiomatic way to do it?

2016-09-14 Thread Marshall handheld Flax
This looks like a standard thing you might want to do with a transducer: accept a stream of inputs and statefully group them into a stream of varying-length vectors. A typical example might be to accept a series of bowling throws and emit them grouped into bowling frames. So you have

Re: How to do functional programming

2016-08-08 Thread John Newman
> variables are referenced within the body of a function as long as the > values associated with those global variables are constants throughout the > lifetime of the program. > > In practice, very few languages (outside of Haskell) actually try to be > completely pure and a

Re: How to do functional programming

2016-08-08 Thread Gary Johnson
s, volatiles) that you can use if you really do want to write an algorithm that involves some mutable state. Unless there is a performance bottleneck (as in numerical computing) or no other sensible way to model the domain (as in some web applications), making use of these features for mutable s

Re: How to do functional programming

2016-08-07 Thread Piyush Katariya
www.slideshare.net/*piyush*katariya/*thinking*-*functionally* -- 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

Do you use any Clojars data feeds?

2016-08-04 Thread Toby Crawley
Clojars provides a few static data feeds[1]: - a list of poms in the repo (all-poms.txt.gz) - a list of all releases in the repo (all-jars.clj.gz) - an expanded list of releases, including more metadata from the poms (feed.clj.gz) We're evaluating our bandwidth usage in anticipation of moving

Re: clojure.spec merge is excellent, but do you consider dissoc spec for keys?

2016-07-19 Thread Alex Miller
) ) > > merge is excellent, as I could reuse exiting spec. But how I dissoc id > from exiting spec. > > Only way is now to do is define again in application layer. > > (s/def ::person-ui-spec (s/keys ::req-un [::channel ::fname ::lname]))

  1   2   3   4   5   6   7   8   9   10   >