Compojure-api, spec-tools, swagger,

2018-05-14 Thread Dave Tenny
I'm using compojure-api 2.0.0-alpha19, spec-tools 0.6.1, and trying to generate swagger pages with :spec coercion in compojure-api. I know this is a work in progress but I'm not an expert in any of these tools and thought I'd ask here before I write pesky and likely incorrect issues in the Meto

Re: Clojure.spec: need function equivalents of library macros?

2017-05-09 Thread Dave Tenny
ombinations. > > > On Monday, May 8, 2017 at 10:38:34 AM UTC-5, Dave Tenny wrote: >> >> Let's say I have a namespace that provides access to the database, >> say our table has these fields (as clojure specs) >> >> (s/def ::job-id nat-int?) ; 1 2 3

Re: Clojure.spec: need function equivalents of library macros?

2017-05-08 Thread Dave Tenny
Oops, some corrections to my original post. On Monday, May 8, 2017 at 11:38:34 AM UTC-4, Dave Tenny wrote: > > Let's say I have a namespace that provides access to the database, > say our table has these fields (as clojure specs) > > (s/def ::job-id nat-int?) ; 1 2 3 ...

Clojure.spec: need function equivalents of library macros?

2017-05-08 Thread Dave Tenny
Let's say I have a namespace that provides access to the database, say our table has these fields (as clojure specs) (s/def ::job-id nat-int?) ; 1 2 3 ... (s/def ::job-name string?) ; frobozz-executor (s/def ::job-status keyword?) ; :queued, :in-progress, :completed And that I have the logic

Re: clojure.spec s/keys map key with alternative definitions in same namespace

2017-02-07 Thread Dave Tenny
#(-> % ::job-type string?))) > > You're on the brink of suggesting subtypes and covariant / contravariants, > etc and that's a path spec is not going down. > > > On Tuesday, February 7, 2017 at 9:40:24 AM UTC-6, Dave Tenny wrote: >> >> Let's say

clojure.spec s/keys map key with alternative definitions in same namespace

2017-02-07 Thread Dave Tenny
Let's say I have these definitions for a "job" record I'm managing, perhaps in a database. (s/def ::job-status #{:in-progress :completed}) (s/def ::user-id (s/and integer? #(>= % 0))) (s/def ::job-id integer?) (s/def ::coercible-job-type (s/and named? #(not (empty? (name %) (s/def ::job-type

named? predicate?

2017-02-07 Thread Dave Tenny
I've occasionally wanted this and haven't found it. (defn named? "True if object is compatible with the 'name' function. There must be a clojure built-in to do this but I haven't figured it out yet." [x] (or (string? x) (keyword? x) (symbol? x))) Note that simply doing (inst

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

2017-02-04 Thread Dave Tenny
I have found eastwood to be useful for a number of things, however on keyword checking it failed terribly on our code base, though perhaps there have been updates since I last tried it. Thanks for the suggestion though. On Friday, February 3, 2017 at 7:26:01 PM UTC-5, Ben Brinckerhoff wrote: >

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

2017-02-02 Thread Dave Tenny
On Thursday, February 2, 2017 at 10:07:31 AM UTC-5, Alex Miller wrote: > > We don't encourage you to do this, but I don't have an easier solution > than this. > Yes, and from the general standpoint of map handling I understand that. >From the standpoint of functions that take options and don't p

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

2017-02-02 Thread Dave Tenny
I want to specify in clojure spec that only declared keywords are permitted in function calls. This is to catch what are usually mis-spelled or mis-cased keywors passed via option maps in function calls. In the fdefs below, the second fdef will catch an invalid call, e.g. (f 1 {:a 2 :B 3}) but

Re: Documentation for namespace aliased keywords (particularly relevant for clojure.spec use)

2017-02-02 Thread Dave Tenny
I also have to wonder why keyword namespaces aren't processed like other symbol namespaces, that is, to interpret the namespace portion before a '/' with alias consideration. No doubt there's a good answer, but it seems anachronistic that keywords need special syntax contortions to recognize nam

Documentation for namespace aliased keywords (particularly relevant for clojure.spec use)

2017-02-01 Thread Dave Tenny
Looking at the documentation for keywords under https://clojure.org/reference/reader#_literals there is no mention for the syntax for namespace aliased keywords, and this is very important it you want to manage your keywords for clojure.spec. I only know about it because google turned up some cl

Re: lein project cross-reference tools

2016-04-19 Thread Dave Tenny
f stuff > > ... and yes, I too feel a bit of despair that my suggestions is 'try > this other tool, if that doesn't work, try this entire editor, if that > doesn't work then' :-) > > On 19 April 2016 at 19:45, Dave Tenny wrote: > > Still looking f

Re: lein project cross-reference tools

2016-04-19 Thread Dave Tenny
Still looking for basic slime-like who-calls in cider. Is it there and I'm just missing it? On Tue, Apr 19, 2016 at 9:57 AM, Dave Tenny wrote: > Tags aside, a transtive closure who-calls report for a definition would > still be appreciated. > > On Tue, Apr 19, 2016 at 9:

Re: lein project cross-reference tools

2016-04-19 Thread Dave Tenny
Tags aside, a transtive closure who-calls report for a definition would still be appreciated. On Tue, Apr 19, 2016 at 9:53 AM, Dave Tenny wrote: > Hmm, okay, trying etags, certainly plenty of google hits there as opposed > to googling "cross reference". FYI, in terms of emacs

Re: lein project cross-reference tools

2016-04-19 Thread Dave Tenny
n Tue, Apr 19, 2016 at 9:33 AM, Dave Tenny wrote: > Oh, if crossclj DOES do what I'm asking, please let me know, I found the > pages I visited a bit confusing as to how I might analyze my (private) > projects. > > On Tue, Apr 19, 2016 at 9:30 AM, Dave Tenny wrote: > >&

Re: lein project cross-reference tools

2016-04-19 Thread Dave Tenny
Oh, if crossclj DOES do what I'm asking, please let me know, I found the pages I visited a bit confusing as to how I might analyze my (private) projects. On Tue, Apr 19, 2016 at 9:30 AM, Dave Tenny wrote: > I'm tired of doing 'find-grep' type operations (including

lein project cross-reference tools

2016-04-19 Thread Dave Tenny
I'm tired of doing 'find-grep' type operations (including that command in emacs). Are there any decent tools for producing cross reference reports and emacs who-calls data in some useful form? A search on the topic mostly points to 'crossclj', which doesn't seem to be what I want (I don't ne

Re: [ANN] Pipes 0.1.1 - chain processes, shell commands and threads via pipes

2015-11-13 Thread Dave Tenny
Just a bit of history from which you might derive some inspiration for your pipe metaphors in Clojure, the scheme shell. Main site: http://scsh.net/ Docs on various constructs, including process I/O operators: http://scsh.net/docu/html/man-Z-H-1.html#node_toc_start On Friday, November 13, 20

Re: Style, Efficiency, and updating nested structure

2015-11-12 Thread Dave Tenny
te-fn x v) > (step nil xs)) > :default (consx > (step v xs)] > (step v coll > > (defn merge-roles [p1 {:keys [project_roles] :as p2}] > (update-in p1 [:project_roles] #(vec (clojure.set/union (set %) (set > project_roles)

Style, Efficiency, and updating nested structure

2015-11-11 Thread Dave Tenny
A colleague and I are debating various things clojure as we were exploring alternative ways to solve a problem. Here's the description of the problem that a particular function is trying to solve, and the first implementation of it. (defn update-roles "Given a vector of maps of the form {:pr

Re: is there a community "best practice" for including your co-workers libraries?

2015-11-02 Thread Dave Tenny
ok, that must be the part I missed. On Mon, Nov 2, 2015 at 7:01 PM, Sean Corfield wrote: > Dave Tenny wrote on Monday, November 2, 2015 at 3:59 PM: > > I'm slightly confused, is there some reason Clojars <http://clojars.org/> > doesn't > work for sh

Re: is there a community "best practice" for including your co-workers libraries?

2015-11-02 Thread Dave Tenny
I'm slightly confused, is there some reason Clojars doesn't work for sharing libraries in this context? -- 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 po

Re: 'seq' performance for 'empty?' compared to 'count'. And where's !=?

2015-10-02 Thread Dave Tenny
at 'empty?' just calls 'seq'. On Thu, Oct 1, 2015 at 6:40 PM, Nathan Davis < nda...@positronic-solutions.com> wrote: > On Thursday, October 1, 2015 at 2:31:46 PM UTC-5, Dave Tenny wrote: >> >> So I understand that 'seq' is the idiomatic way to

'seq' performance for 'empty?' compared to 'count'. And where's !=?

2015-10-01 Thread Dave Tenny
So I understand that 'seq' is the idiomatic way to see if a collection/sequence is empty. Logically I'm looking for an O(1) predicate with which I can determine if a seq/collection is empty, and a well behaved one that is idempotent and side effect free (for general performance reasons). 'seq'

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

2015-09-04 Thread Dave Tenny
Caveat: my approach may have been all wrong. It's the first time I tried stuartsierra components. Frankly I'd have been happier with some CLOS objects and before and after methods, I'm still getting the hang of this clojure stuff. On Fri, Sep 4, 2015 at 7:57 AM, Dave Tenny wrot

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

2015-09-04 Thread Dave Tenny
I'm using components to encapsulate Langohr/RabbitMQ interactions in cases where Langohr auto-recovery wasn't happy with what was going on. I make sure the Lifecycle methods are idempotent, built the component stack in the correct order. To make sure that I can deal with the exceptions that r

Re: How can find something inside heavily nested data structure ?

2015-08-24 Thread Dave Tenny
Specter looks nice. I didn't see any examples in the readme or tests for working with more deeply nested data structures such as those discussed in this thread, any pointers? On Sunday, August 23, 2015 at 10:22:25 PM UTC-4, Brian Marick wrote: > > > > Andy- wrote: > > I have yet to evaluate it

Java constructor question

2015-08-23 Thread Dave Tenny
Is there a way to parameterize a bit of code that invokes a constructor without calling the java.lang.reflect.Constructor class? e.g. (defn make-it [class] (new class "abc")) ; won't work (make-it IllegalArgumentException) I was trying to parameterize the class of exception thrown in a bit

:arglists metadata on defmulti/defmethod forms

2015-08-23 Thread Dave Tenny
defmulti+detmethod doesn't seem to maintain any :arglists metadata with the Var filled by defmulti. How can I look up arglist information for multimethods like I can for regular function vars? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To p

Re: decoding clojure generated class names

2015-08-23 Thread Dave Tenny
Thanks Alex, clojure.lang.Compiler/demunge is just what I wanted. On Sat, Aug 22, 2015 at 7:28 PM, Alex Miller wrote: > There is a demunge function in clojure.lang.Compiler. It's not foolproof > as the munging is not unambiguously reversible. > > -- > You received this message because you are su

Re: Rabid wild animals in my clojure argument lists, code gets infected.

2015-08-23 Thread Dave Tenny
:-), your destructuring >>> is simply ignoring that parameter. >>> >>> However, I get the pain and solutions might be (in order of 'heavyness'): >>> - http://blog.fogus.me/2009/12/21/clojures-pre-and-post/ >>> - https://github.com/Prismatic/schema >

Re: Rabid wild animals in my clojure argument lists, code gets infected.

2015-08-23 Thread Dave Tenny
are necessarily intended to be bound to maps in this case, and I'm looking for a very fixed set of keywords in the function call. On Sun, Aug 23, 2015 at 10:17 AM, Dave Tenny wrote: > The point of my colorful title and judgmental post is that in the example, > passing :e f

Re: Rabid wild animals in my clojure argument lists, code gets infected.

2015-08-23 Thread Dave Tenny
/github.com/Prismatic/schema > - http://typedclojure.org/ > > HTH > > Dave Tenny writes: > > > I sure wish Clojure would generate "IllegalArgumentException" in the > > following sample case: > > > > (defn foo [a b & {:keys [c d]}] 1) > >

Rabid wild animals in my clojure argument lists, code gets infected.

2015-08-22 Thread Dave Tenny
I sure wish Clojure would generate "IllegalArgumentException" in the following sample case: (defn foo [a b & {:keys [c d]}] 1) (foo 1 2 :e 5) ; blithely ignores :e 5 I understand that Clojure's destructuring things are very nice, and more powerful than Common Lisp's, and I like that when I need

decoding clojure generated class names

2015-08-22 Thread Dave Tenny
I wanted to write a function like this: (defn fn-name-info "Given a function, try to deduce the function name and clojure namespace by looking at the function's java class name and decoding stuff. Return a vector of name, namespace strings, or nil if we can't find anything. For exa

Re: How can find something inside heavily nested data structure ?

2015-08-20 Thread Dave Tenny
I have found the core 'get-in' function to be useful for extracting data from big trees of clojure data structures, perhaps that will help. I'm still in search of tools that let me get a good sense of *what* to navigate when looking at such trees of data structures from API's and/or data source

apply, mapply, recur, looking for insights

2015-08-13 Thread Dave Tenny
These inconsistencies are bugging me, I just wondered if I was missing some standard language thing about argument passing or destructuring, so I'm looking for comments. At issue (for me), keyword arguments and maps that bundle them. user> (defn foo [a b & {:keys [c d]}] [a b c d]) #'us

Re: com.stuartsierra.component dynamic component addition/removal question

2015-08-11 Thread Dave Tenny
, 2015 at 11:49:10 AM UTC-4, Dave Tenny wrote: > > I want to add components to a started system, but I'm unsure of a > component-idiomatic way to do that. > > I don't want to restart the whole component stack. I'm guessing assoc'ing > a new component to the syste

com.stuartsierra.component dynamic component addition/removal question

2015-08-11 Thread Dave Tenny
I want to add components to a started system, but I'm unsure of a component-idiomatic way to do that. I don't want to restart the whole component stack. I'm guessing assoc'ing a new component to the system-map result isn't a good idea (though I've read words that sounded like it was a fine thi

Re: Supplied-p parameter in clojure similar to lisp lambda lists

2014-08-18 Thread Dave Tenny
ug 17, 2014 at 11:02 PM, dennis zhuang wrote: > I think that adding a :p option to destructuring would be great: > > (let [ {:keys [a b c] :p {a a-p}} params] > (if a-p > (println a) > (println "a is not exists."))) > > > > > > >

Re: Supplied-p parameter in clojure similar to lisp lambda lists

2014-08-17 Thread Dave Tenny
}] ...) > > You can use map primitives on a-map. But you can also supply defaults > here. > On Jun 20, 2014 2:14 PM, "Dave Tenny" > > wrote: > >> What is the commonly accepted technique for declaring/using 'supplied-p' >> type lambda list f

Compilation failure to reject arguments matching formal parameters

2014-08-15 Thread Dave Tenny
This is getting old. Any suggestions or plans to fix it? Do I need to use some other common declaration style for functions? ; CIDER 0.5.0 (Clojure 1.6.0, nREPL 0.2.3) user> (defn foo [& {:keys [bar]}] bar) #'user/foo user> (foo :baz 1) nil In my opinion the compilation of the call to foo sho

Re: Stumped: unable to resolve symbol in macro expansion

2014-07-22 Thread Dave Tenny
t; > I guess the fact that (foo x) recycled the name of the parameter used in > the function definition is what made the error message confusing? > > > On Monday, July 21, 2014 9:49:10 AM UTC-7, Dave Tenny wrote: > >> In my case, I'm trying to use a the expression '[x

Re: Stumped: unable to resolve symbol in macro expansion

2014-07-21 Thread Dave Tenny
In my case, I'm trying to use a the expression '[x] that is available to the macro in the resulting product. So I don't want the value of x at all, just a vector with the symbol x. That vector is in a variable I have in the macro named 'positional-parameters', so I substitute '~positional-paramet

Supplied-p parameter in clojure similar to lisp lambda lists

2014-06-20 Thread Dave Tenny
What is the commonly accepted technique for declaring/using 'supplied-p' type lambda list functionality in clojure? http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_3-4-1.html I have some clojure functions with a large number of keywords and various defaults, I want to kno

Re: Checking: Java 8 and Clojure

2014-06-03 Thread Dave Tenny
Thanks all, good to know. On Tuesday, June 3, 2014 12:17:52 PM UTC-4, Dave Tenny wrote: > > The clojure site says 1.6.0 is supported with java 6 and higher. > > I just wanted to double check whether people have been using it with Java > 8 and whether it's believed to be s

Checking: Java 8 and Clojure

2014-06-03 Thread Dave Tenny
The clojure site says 1.6.0 is supported with java 6 and higher. I just wanted to double check whether people have been using it with Java 8 and whether it's believed to be stable when used with Java 8 before I tell people I work with that they can use it with Java 8. Thumbs up for java 8 and c

Question: defrecord accessor efficiency without protocols

2014-05-16 Thread Dave Tenny
(defrecord Foo [bar]) (:bar (Foo. 1)) Is clojure smart enough to make the :bar lookup O(1) as a known field of Foo? Or is it still a map-like O(logN) lookup? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clo

Re: determining repl environment vs. uberjar environment?

2014-05-08 Thread Dave Tenny
nd, and the points made on (app) vs. (-main (app)) are good if you always throw and never call exit down the stack. On Thu, May 8, 2014 at 12:14 PM, Ray Miller wrote: > On 8 May 2014 16:22, Dave Tenny wrote: > > James, All well and good, but you still need to know if you're runni

Re: determining repl environment vs. uberjar environment?

2014-05-08 Thread Dave Tenny
(catch [:exit :app/connect-failed] _ (System/exit 2 > > > Alternatively, if the app function returns the status rather than excepts: > > (defn -main [& args] > (System/exit >(case (apply app args) > :app/ok 0 > :app/bad-data 1 > :app/co

Re: determining repl environment vs. uberjar environment?

2014-05-08 Thread Dave Tenny
en indicative of > some unnecessary coupling in your code. > > Under what circumstances does your application need to exit? > > - James > > > On 22 April 2014 17:59, Dave Tenny wrote: > >> I have an app I'm building. It calls System/exit. That doesn'

Re: determining repl environment vs. uberjar environment?

2014-05-08 Thread Dave Tenny
Caught an exception that wasn't thrown via pseudo-exit (if (has-repl?) (println (str e)) ;print to REPL (exit 2 (str e ;print and exit java On Tue, Apr 22, 2014 at 12:59 PM, Dave Tenny wrote: > I have an app I'm building. It calls Syste

defrecord, looking for more info on the __meta and __extmap fields and constructor arguments

2014-05-07 Thread Dave Tenny
The documentation for defrecord mentions additional arguments but doesn't give any examples of their use. I take it that the __extmap field generated for the class is for map slots that aren't defined with the defrecord fields. What is the __meta slot for and how is it typically used? -- You

Re: Converting sequence from sort into a list

2014-05-06 Thread Dave Tenny
ifically need a list? i.e., why isn't > a sequence good enough? > > Sean > > On May 3, 2014, at 6:30 AM, Dave Tenny wrote: > > After nosing around all I've come up with via clojure mechanisms is to > use (apply list (sort ...)). > > It seems to work well enough

Re: Clojure equivalent of special common lisp vars: still looking for that zen place...

2014-05-03 Thread Dave Tenny
of the binding form. Just guessing. On Sat, May 3, 2014 at 11:08 AM, Lee Spector wrote: > > On May 3, 2014, at 9:45 AM, Dave Tenny wrote: > > > > The way I'm tempted to do this in clojure is > > > > (def ^{:dynamic true} *x* (atom 1)) > > ... do stu

Re: Clojure equivalent of special common lisp vars: still looking for that zen place...

2014-05-03 Thread Dave Tenny
On Sat, May 3, 2014 at 10:53 AM, Bob Hutchison wrote: > You can also just use ‘def’ to redefine the global binding. Thanks, though in this case it's a mixed use. In some cases I want to change the root of the global binding, in others I want to rebind to a new value in some context without cha

Clojure equivalent of special common lisp vars: still looking for that zen place...

2014-05-03 Thread Dave Tenny
I'm still struggling with how to write the most readable, simple clojure code to deal with dynamically bindings. What is the graceful clojure equivalent of common lisp special variables for the following scenario. If I were writing common lisp I'd just do something like (pardon if my lisp is r

Re: Converting sequence from sort into a list

2014-05-03 Thread Dave Tenny
sList(Enumeration), though I didn't quickly find a way to convert the clojure.lang.ArraySeq from my sort() in testing to an Enumeration. Guess I'm set for now, I was just hoping to avoid consing a new list on my sort result in order to get a specific collection type. On Fri, May 2, 2014 at 10:53

Re: Converting sequence from sort into a list

2014-05-02 Thread Dave Tenny
Sort returns a seq, but not necessarily something for which list? is true. On Fri, May 2, 2014 at 11:01 AM, Plínio Balduino wrote: > Hi Dave > > Sorry if I didn't get it, but doesn't sort already return a list? > > Could explain? > > Plínio > > > >

Converting sequence from sort into a list

2014-05-02 Thread Dave Tenny
I have a sequence from a call to 'sort'. I want a list. What is the best way to do this? (apply list (sort ...))? Will it have problems on large sequence inputs? I can't use (into () (sort ...)) since that conjoins and ruins the sort order. -- You received this message because you are subsc

determining repl environment vs. uberjar environment?

2014-04-22 Thread Dave Tenny
I have an app I'm building. It calls System/exit. That doesn't works so well if I'm debugging in the REPL however. What's the preferred method of determining whether I'm in REPL mode interaction vs running as a standalone app? Also, long as I'm asking and being lazy, does the -main function r

This is "why clojure", for those who are always asking.

2014-04-20 Thread Dave Tenny
A lot of people who've used lisp dialect languages will get "why clojure". Even then, a lot of us lispers wanted more. We wanted to leverage some of the vast amounts of code that have been written in recent years, in my case, for Java. I like lisp a lot but had sworn it off for many years becau

Re: Amazonica performance: options?

2014-03-28 Thread Dave Tenny
gt; > You can also pass a list of filters to the call to narrow the result. > > > > On Friday, March 28, 2014 7:59:48 AM UTC-7, Dave Tenny wrote: >> >> I'm trying to code some amazonica based solutions in a nontrivial AWS >> environment. >> I work with ma

Amazonica performance: options?

2014-03-28 Thread Dave Tenny
I'm trying to code some amazonica based solutions in a nontrivial AWS environment. I work with many AWS accounts and it isn't unusual to see a thousand instances running on one account, and similar excesses in other types of AWS resources. So if you're going an ec2-describe-instances (or amazon

traversing amazonica (or other nested data) results

2014-03-12 Thread Dave Tenny
If I do something like a describe-instances call in amazonica, I get a typical clojure-y set of data fairly deeply nested data structures that I have yet to master with respect to traversing using basic clojure operations. Given a result that basically ends up looking like pages of interleaved

isa? problem with collection type for multiple argument dispatch

2014-03-01 Thread Dave Tenny
(isa? [String String] [Object Object]) returns true. This is nice and useful. However (isa? '(String String) '(Object Object) returns false, this is not so nice. (isa? '(String String) [Object Object]) also return false. So the moral of the story is that for multiple argument dispatch to work

cdoc, lein, profiles.clj, strange behavior

2014-02-19 Thread Dave Tenny
I'm trying to figure out some strange behavior ensuring that 'cdoc' is always available in my user namespace. I have in my ~/.lein/profiles.clj this block: {:user {:dependencies [[jdt "0.1.0-SNAPSHOT"] ;jdt.* [org.clojure/tools.trace "0.7.6"] [org.th

Closing open files when with-open was not used, possibly useful gist.

2014-02-19 Thread Dave Tenny
I'm posting this on the off chance it's useful to those of you writing REPL shell tools or I/O abstractions (e.g. java's NIO.2 DirectoryStream wrappers) that might benefit from a close-when-GC'd backstop. For example, clj-nio2 has a nice little lazy directory sequence function: (defn- lazy-dir-

data-readers, spyscope

2014-02-01 Thread Dave Tenny
Java 1.7.0.45 Lein 2.3.4 Clojure 1.5.1 I'm trying to use https://github.com/dgrnbrg/spyscope and have put the documented bits in my ~/.lein/profiles.clj but cannot get it to work. {:user {:dependencies [... [spyscope "0.1.4"] ...] :injections [(require 'spyscope.core)

Re: clojuredocs macro

2014-01-28 Thread Dave Tenny
.com/trptcolin/reply > > That in turn depends upon a cd-client library for sending requests to the > clojuredocs.org web site and doing some parsing on the responses received: > > https://github.com/dakrone/clojuredocs-client > > Andy > > > On Tue, Jan 28, 2014 at

clojuredocs macro

2014-01-28 Thread Dave Tenny
Does anybody happen to know where 'clojuredocs' is defined? I grepped the clojure and leiningen git trees but the word didn't show up. I noticed it mentioned in some leiningen tutorials and it's present in my REPL, in the user namespace. clojuredocs is a clojure.lang.Symbol in namespace u

Redefining the notion of S-EXP, and pattern matching S-EXPs in clojure

2014-01-19 Thread Dave Tenny
As I try to reconcile my ancient past in writing common lisp code with a clojure learning exercise, I wonder whether clojure philosophy redefines the notion of an s-expression or whether it just adds vectors and maps to s-expressions in without trying to define what an s-expression is. The que

Re: HttpKit, Enlive (html retrieval and parsing)

2014-01-11 Thread Dave Tenny
I was using net.cgrand.enlive-html/html-resource and org.httpkit.client/get for the page retrievals. On Saturday, January 11, 2014 6:24:48 PM UTC-5, Dave Tenny wrote: > > I'm just playing around with tool kits to retrieve and parse html from web > pages and files that I alread

HttpKit, Enlive (html retrieval and parsing)

2014-01-11 Thread Dave Tenny
I'm just playing around with tool kits to retrieve and parse html from web pages and files that I already have on disk (such as JDK API documentation). Based on too little time, it looks like [http-kit "2.1.16"] will retrieve but not parse html, and [enlive "1.1.5"] will retrieve AND parse html.

Re: Clojure deployment questions w.r.t. jars, clojure source files, compiled class files

2014-01-08 Thread Dave Tenny
ople in the past trying to use AOT. > For many the compilation phase and code execution are perceived > as a single step. When working in the REPL you do not need to be aware of > this. With AOT it's important to be aware of the difference when writing > code > in dev. > >

Re: Namespaces in waiting

2014-01-07 Thread Dave Tenny
I just stumbled across this, which looks very much like it may be what I wanted: clojure.core/loaded-libs http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/loaded-libs E.g. $ lein repl user=> (loaded-libs) bultitude.core cemerick.pomegranate cemerick.pomegranate.aether classl

Clojure deployment questions w.r.t. jars, clojure source files, compiled class files

2014-01-07 Thread Dave Tenny
So if I sample some clojure jars in my local maven .m2 directory, most of the jar files have only clojure code, and a project.clj. If I look at the org.clojure project there, it has many java class files, what appear to be corresponding clojure source files, and *no* project.clj. With only a lit

Re: Namespaces in waiting

2014-01-07 Thread Dave Tenny
m > http://clojure.github.io/tools.namespace/#clojure.tools.namespace.find to > + clojure.java.classpath to get a list of all namespaces in current > classpath... > > > On Mon, Jan 6, 2014 at 7:45 PM, Stephen C. Gilardi wrote: > >> >> On Jan 1, 2014, at 3:26 PM, Dave Te

Namespaces in waiting

2014-01-01 Thread Dave Tenny
When I use 'lein repl' in some project context and get to the REPL prompt, there's an available but as yet not ... present ... namespace, i.e. (all-ns) won't list the namespace(s) created in the lein project directory tree. Is there some API I can use to see a list these available but not activ

Re: computed docstrings

2013-12-20 Thread Dave Tenny
Good, thanks On Friday, December 20, 2013 8:08:39 PM UTC-5, guns wrote: > > On Fri 20 Dec 2013 at 05:04:13PM -0800, Dave Tenny wrote: > > > Is there any alternative I'm missing short of writing my own macro to > > allow non-string forms for docstrings? > > U

computed docstrings

2013-12-20 Thread Dave Tenny
I'm guessing the answer to this is that I'd have to write my own 'defn' equivalent that would parse a form rather than requiring a string, but here's hoping. One of the things I did in Common Lisp was to occasionally compute the docstring for a function with a little function that formatted the

Why are vectors and sets inconsistent with maps, keywords, and symbols when used as operators?

2013-12-05 Thread Dave Tenny
Maps, keywords, and symbols when used as operators allow optional second arguments for 'default-not-found' values is if to 'get'. E.g. ({:a 1} :b 'b) => b However sets don't support this behavior (though they do with 'get') and vectors don't allow the optional default-not-found in their pseudo

Re: exporting imported symbols

2013-12-01 Thread Dave Tenny
always tell where a symbol comes from. > -S > > > > On Sunday, December 1, 2013 10:10:46 AM UTC-5, Dave Tenny wrote: >> >> (ns mine >>(:use foo)) ; has public symbol bar >> >> What is the proper use/require/refer entry to export foo's b

exporting imported symbols

2013-12-01 Thread Dave Tenny
(ns mine (:use foo)) ; has public symbol bar What is the proper use/require/refer entry to export foo's bar as mine's bar without defining a new public bar in mine? -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Suggestions for state modification improvements in this bit of code?

2013-12-01 Thread Dave Tenny
I may not have totally understood the original function, but here > are a few possible implementations, each moving towards what I would think > of as being simpler: https://www.refheap.com/21379 > > It could of course be made more efficient and slightly cleaner, but maybe > it

Re: Suggestions for state modification improvements in this bit of code?

2013-11-30 Thread Dave Tenny
What, not conj!urers? On Sat, Nov 30, 2013 at 6:33 PM, Thomas wrote: > On Saturday, November 30, 2013 11:17:01 PM UTC, Dave Tenny wrote: > >> I'm still learning clojure and wrote this decidedly unfunctional bit of >> code as part of a common lisp style DESCRIBE function

Suggestions for state modification improvements in this bit of code?

2013-11-30 Thread Dave Tenny
I'm still learning clojure and wrote this decidedly unfunctional bit of code as part of a common lisp style DESCRIBE function. I was wondering what experienced clojure-ers (what's the proper reference?) might suggest to make this function less ugly. I realize making a purely functional version

Re: .cljrc

2013-11-30 Thread Dave Tenny
ample.project.clj > > > On Wednesday, November 27, 2013 4:53:02 PM UTC-8, Dave Tenny wrote: > >> Thanks, I seem to have accomplished what I need for now. It was a bit >> frustrating to figure out exactly what I could do in profiles.clj. For >> example, I can&#

Re: .cljrc

2013-11-27 Thread Dave Tenny
github.com/technomancy/leiningen/blob/stable/doc/PROFILES.md<https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Ftechnomancy%2Fleiningen%2Fblob%2Fstable%2Fdoc%2FPROFILES.md&sa=D&sntz=1&usg=AFQjCNGPecCbKEDAS5MWZP4qvsqXetVkTw> >> >> On Mon, Nov 25, 2013 at 3:34

.cljrc

2013-11-25 Thread Dave Tenny
With all my attention on trying to learn things about clojure, I've either missed or forgotten how do to a simple thing. As I learn clojure I'm writing a few definitions that represent tools I like to use in development. What is the simplest way to have those tools present in arbitrary clojure

What's new and exciting w.r.t. Clojure use in data & analytics, and cloud apps that scale out?

2013-11-20 Thread Dave Tenny
Just looking for interesting tidbits on recent spearheads with, or wins for, Clojure in the cloud with the buzzwords du jour. Part of an interest to take the pulse of Clojure in the domains for which my employer presently uses other tools. I like Java just fine (for what it is), and I have a lo

Re: New Functional Programming Job Opportunities

2013-11-19 Thread Dave Tenny
Fun reading! On Monday, November 18, 2013 2:00:02 AM UTC-5, Sean Murphy wrote: > > Here are some functional programming job opportunities that were posted > recently: > > Clojure Engineers Needed! at Factual > http://functionaljobs.com/jobs/8657-clojure-engineers-needed-at-factual > > Cheers,

Re: (= '(java.lang.String) (list java.lang.String)) => false ?

2013-11-10 Thread Dave Tenny
I should know better, thanks. On Sunday, November 10, 2013 7:06:13 AM UTC-5, Timo Mihaljov wrote: > > On 10.11.2013 14:03, Dave Tenny wrote: > > I don't understand why these things aren't equal. > > > > user=> (= (list java.lang.String) (list (class

(= '(java.lang.String) (list java.lang.String)) => false ?

2013-11-10 Thread Dave Tenny
I don't understand why these things aren't equal. user=> (= (list java.lang.String) (list (class "abc"))) true user=> (= '(java.lang.String) (list (class "abc"))) false user=> (type '(java.lang.String)) clojure.lang.PersistentList user=> (type (list java.lang.String)) clojure.lang.PersistentList

Re: abysmal multicore performance, especially on AMD processors

2013-11-06 Thread Dave Tenny
As a person who has recently been dabbling with clojure for evaluation purposes I wondered if anybody wanted to post some links about parallel clojure apps that have been clear and easy parallelism wins for the types of applications that clojure was designed for. (To contrast the lengthy discu