Re: Conceptual difference between map and class

2020-04-05 Thread James Gatannah
xisting > abstraction and making them 'almost equal but slightly different'. > > kind regards, > Dieter > > On Wednesday, April 1, 2020 at 6:44:07 AM UTC+2, James Gatannah wrote: >> >> It might be worth mentioning that, ultimately, python class instances are >> sy

Re: Conceptual difference between map and class

2020-03-31 Thread James Gatannah
It might be worth mentioning that, ultimately, python class instances are syntactical sugar built around an internal __dict__. It gets twistier, since classes are also instances of the base class object. It would be tricky (though I've seen an example...maybe in Joy of Clojure? I think the

Re: Silly ns question

2019-02-26 Thread James Gatannah
And now the original '.shared.connection-test ns fails with the same error. On Sun, Feb 17, 2019 at 9:40 PM James Gatannah wrote: > > Oops, yes. I typoed the file name. > > On Sun, Feb 17, 2019 at 9:26 AM Daniel wrote: > > > > Weird. Also I thought your file name would nee

Re: Disable swagger.ui in production

2019-02-22 Thread James Gatannah
I'm going to buck a trend here. Why do you want to do this? (That's rhetorical. Don't feel like you need to answer). One of the fundamental principles behind REST is that it is discoverable. Maybe even that it's explorable. Maybe you aren't building a REST end-point. It's totally possible

Re: Silly ns question

2019-02-17 Thread James Gatannah
Oops, yes. I typoed the file name. On Sun, Feb 17, 2019 at 9:26 AM Daniel wrote: > > Weird. Also I thought your file name would need an underscore. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to

Re: Silly ns question

2019-02-16 Thread James Gatannah
I haven't messed with it extensively, but it works from the REPL. On Sat, Feb 16, 2019 at 5:35 AM Matching Socks wrote: > > Haha! (Can .shared.connection-test be require'd by another ns?) > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To

Silly ns question

2019-02-15 Thread James Gatannah
I'm using cider 0.18.0 (which is sweet) and emacs. I just created a new buffer inside a new directory, and it generated the preliminary ns form for me (also sweet). The path to the file under my source directory is "shared/connection-test.cljc". The symbol of the ns that it generated is

Re: accessing symbols in local context of a closure

2018-05-26 Thread James Gatannah
are balanced) One example would be: (defn build-incrementer [x] {:inc (fn [] (inc x)) :dec (fn [] (dec x)) :status (fn [] x)}) Is that close to what you wanted? Regards, James > > On Friday, May 25, 2018 at 9:01:22 AM UTC+3, James Gatannah wrot

Re: accessing symbols in local context of a closure

2018-05-25 Thread James Gatannah
On Thursday, May 24, 2018 at 1:22:42 PM UTC-5, Sonny To wrote: > > (defn foo[] > (let [x 1] >(fn [] > (+ x 1) > ) > ) > > (def bar (foo)) > > Is there a way to get the value of x from closure bar? > I may be describing this incorrectly. You're creating a top-level var named

Question about tightly couple spec interactions

2018-03-29 Thread James Gatannah
Background: I'm in the process of translating a fairly low-level and messy C networking library. The original involves lots of bit-twiddling and global variables. My first pass (which has been in the "real soon now" state for months now...in hind-sight, I have some regrets about starting this at

Re: Transitive spec generation

2018-03-03 Thread James Gatannah
In case anyone was wondering, it looks like this is probably a known issue: https://dev.clojure.org/jira/browse/CLJ-2079 On Wednesday, February 28, 2018 at 12:05:31 AM UTC-6, James Gatannah wrote: > > > > On Tuesday, February 27, 2018 at 12:45:26 AM UTC-6, Didier wrote: >&

Re: Transitive spec generation

2018-02-27 Thread James Gatannah
very skeptical, but could that possibly hold water? Thank you to anyone who actually took the time to read this! > > > On Monday, 26 February 2018 21:39:09 UTC-8, James Gatannah wrote: >> >> Fairly minimalist example available at >> https://gist.github.com/jimrthy

Re: Transitive spec generation

2018-02-26 Thread James Gatannah
nks, James On Sunday, February 25, 2018 at 6:45:39 PM UTC-6, James Gatannah wrote: > > I have a spec for an array of 16 bytes: > > (s/def ::extension (s/and bytes? >#(= (count %) 16)) > > Then I have a couple of other specs that are real

Transitive spec generation

2018-02-25 Thread James Gatannah
I have a spec for an array of 16 bytes: (s/def ::extension (s/and bytes? #(= (count %) 16)) Then I have a couple of other specs that are really just renaming it: (s/def ::client-extension ::extension) (s/def ::server-extension ::extension) I started doing

Re: Best Practices for Accessing Data Files That May Be Bundled?

2018-02-06 Thread James Gatannah
At first glance, it seems like you probably want http://clojuredocs.org/clojure.core/ns-resolve On Tuesday, February 6, 2018 at 2:38:06 PM UTC-6, Randy J. Ray wrote: > > First, some brief background/context: I've been playing around with > Clojure for a while, mostly just doing Project Euler

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 needing to manipulate tricky

Re: Officially support Vert.x

2017-12-31 Thread James Gatannah
Disclaimer: I once spent 3-4 weeks studying Vert.x's design philosophy and architecture. So I'm hardly an expert. On Saturday, December 30, 2017 at 9:31:47 AM UTC-6, Feuer Au wrote: > > Hmm > yes it is almost an absolute requirement since we have already invested a > lot in Java, Kotlin,

Re: Clojure for beginners

2017-12-06 Thread James Gatannah
This isn't in the same league as any of those books, or the anything recommended by anyone else. And you probably already know everything it has to teach. But it seems worth mentioning. I threw this together a couple of years ago: https://github.com/jimrthy/clojure-introduction It's really

Re: hello world question !!!

2017-10-13 Thread James Gatannah
It's been a couple of years, but (from what I remember) it works great. Immutant (or maybe it's wildfly?) has an option to deploy "exploded .WAR files." I'm very fuzzy on the details, but it seems like the basic choices were either: 1) deploy an uberwar with AOT (advantage: faster startup

Re: hello world question !!!

2017-10-13 Thread James Gatannah
This is really "just" a +1 for using Leiningen. TL;DR: Just start with `lein new app hello-world` and get an editor integrated with your REPL quickly. Come back to these sorts of things later, if/when you still think they're worthwhile. I came to clojure from the python/c++ world, with just

Re: Sum types in Clojure? Better to represent as tagged records or as variant vectors?

2017-09-28 Thread James Gatannah
I'm late to this party, and maybe this discussion has already gone on too long. If so, I'm sorry for dredging it back up. But I'm curious about where Tim was going with this, because I feel like I might be missing out on a great idea: On Tuesday, August 29, 2017 at 9:12:33 AM UTC-5, Tim

Re: how to be notified when a Future is realized?

2017-08-04 Thread James Gatannah
Just to be fair: I didn't dig into the other posts in that series to try to figure out where he was going. So I could be completely and totally off-base on this. My first reaction was "This is the point behind core.async." My second reaction was "Why not just use an atom and (add-watch)?"

Re: Unnamed Types - What Am I Doing Wrong?

2017-07-26 Thread James Gatannah
I feel your pain. I don't have an answer, but the basic point convinced me to write this: http://gatannahfiles.blogspot.com/2017/07/moving-away-from-guard-rails.html -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: Clojure resume tips?

2017-03-23 Thread James Gatannah
To get back on-target, I think you should highlight 1 or maybe 2 of your github repos and go flesh them out. I had high hopes for both click-time-fun and cljs-game, but wasn't sure what to try or where to start. Working demos are pretty magical, and, honestly, incredibly rare.

Re: Clojure resume tips?

2017-03-23 Thread James Gatannah
On Thursday, March 23, 2017 at 2:00:28 PM UTC-5, puzzler wrote: > > On Thu, Mar 23, 2017 at 11:24 AM, Luke Burton > wrote: > > Insightful post about a lot of things related to hiring, but I have to > take exception with this very last point. Recently, a friend of mine >

Re: s/valid? vs. s/explain

2016-11-16 Thread James Gatannah
Thank you, Alex. Both for the feedback about what I'm doing wrong and for a fix that looks simple and obvious. Regards, James On Sunday, November 13, 2016 at 9:57:55 AM UTC-6, James Gatannah wrote: > > One of my system boundary data structures is particularly ugly. It > involves th

Re: [ANN] Clojure Programming Cookbook

2016-11-16 Thread James Gatannah
Congrats! On Monday, November 14, 2016 at 9:09:01 PM UTC-6, Nicolas Modrzyk wrote: > > Hi Clojure people, > > So after one year and 23 days, (that would be 388 days) the IT book I was > working on with Makoto (merci!) finally got published! > > It has been a long battle with many late nights to

Re: s/valid? vs. s/explain

2016-11-14 Thread James Gatannah
Ticket filed: http://dev.clojure.org/jira/browse/CLJ-2057 Thanks! On Sun, Nov 13, 2016 at 3:36 PM, Alex Miller wrote: > Any case where valid? returns false and explain-data returns nil is a bug. > > -- > You received this message because you are subscribed to the Google >

Re: s/valid? vs. s/explain

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

Re: s/valid? vs. s/explain

2016-11-13 Thread James Gatannah
. But it's strange enough to seem worth mentioning/explaining. Thanks again, James On Sun, Nov 13, 2016 at 9:57 AM, James Gatannah <james.gatan...@gmail.com> wrote: > One of my system boundary data structures is particularly ugly. It involves > things like JNI classes wrapping n

s/valid? vs. s/explain

2016-11-13 Thread James Gatannah
One of my system boundary data structures is particularly ugly. It involves things like JNI classes wrapping native socket libraries, go loops, and higher-order functions that I can use to plug in message dispatchers. I'm in the process of translating it from schema to spec. So far, the

Re: Guidelines/Recommendations for namespaces and qualified keywords

2016-10-17 Thread James Gatannah
On Saturday, October 15, 2016 at 10:17:15 PM UTC-5, Josh Tilles wrote: > > I’ve got a couple questions for Alex Miller and/or the other Cognitect > folks. > That isn't me. I'm just chiming in from the peanut gallery. Must of my "experience" so far stems from converting my toy projects from

Re: [ANN] boot-bundle, DRY for dependencies

2016-10-17 Thread James Gatannah
Sweet! And thanks! I've been trying to find the time to learn enough boot to write this for myself. On Saturday, October 15, 2016 at 8:28:58 AM UTC-5, Borkdude wrote: > > Only a few lines of code, but it does the job: > > https://github.com/borkdude/boot-bundle > > This library lets you define

Re: Should I switch to Clojure after 3 years of learning another full stack ?

2016-10-12 Thread James Gatannah
On Thursday, October 6, 2016 at 4:39:43 PM UTC-5, Xman wrote: > > It's been many years of postponing learning programming, because I > considered the popular languages of that time not right. > It's been my experience that there are no "right languages." They all have major flaws. No matter

Strange tooling interaction bug(?)

2016-10-01 Thread James Gatannah
I recently decided to try out devcards. I got an error because my ancient java version is no longer supported. I've been meaning to upgrade that dev environment, so I went ahead and bumped it from ubuntu 14.04 to 16.04. Once that was finished, I went back to my experimental devcards project to

Re: why is it so annoying to run clojure code

2016-06-15 Thread James Gatannah
until this morning. There is a learning curve, and it's a serious change in your point of view. But it really is totally worth it. Respectfully and apologetically, James On Wednesday, June 15, 2016 at 1:02:55 AM UTC-5, James Gatannah wrote: > > I *totally* understand your (and pretty much every other r

Re: why is it so annoying to run clojure code

2016-06-15 Thread James Gatannah
I *totally* understand your (and pretty much every other responder's) frustration. You're approaching it wrong. Most python/ruby programmers get this wrong, also. It's OK. I did this wrong for *years* in lots of different languages. (I blame my C++ background for how long it's taking this to

Re: Using a dynamic var for my database connection for implicit connections+transactions

2015-08-05 Thread James Gatannah
that were originally suggested. The difference is that, even if they are (and I certainly hope not!), I can't touch them. When (and it's never if) a hacker gets control over the front-end web server, that's just the first layer of defense. Regards, James James Gatannah writes: On Thursday

Re: Using a dynamic var for my database connection for implicit connections+transactions

2015-08-05 Thread James Gatannah
On Monday, August 3, 2015 at 10:21:09 PM UTC-5, Dmitri wrote: My understanding is that the problem is actually caused by the stateless nature of the functions. You're talking about database interactions. By definition, those are not stateless. The trick is to isolate this statefulness as

Re: Using a dynamic var for my database connection for implicit connections+transactions

2015-08-02 Thread James Gatannah
On Thursday, July 30, 2015 at 7:44:31 PM UTC-5, J. Pablo Fernández wrote: Hello Clojurians, I found passing around the database connection to each function that uses it very error prone when you are using transactions as passing the wrong one could mean a query runs outside the

Re: Composing Stuart Sierra's components

2015-03-17 Thread James Gatannah
On Thursday, March 12, 2015 at 10:16:10 AM UTC-5, Stuart Sierra wrote: On Wednesday, March 11, 2015, Colin Yates wrote: Nested systems don't really work. FWIW, we've been using something that smells an awful lot like nested systems for months now. I never realized we weren't supposed to.

shutdown-agents without agents

2014-05-11 Thread James Gatannah
I apologize if this is just useless noise. It's after midnight on Sunday, I need to get to bed, and I know I'll totally forget about this if I don't make the scenario public. This is on clojure 1.5.1. CentOS 6.5 (virtual guest running on a Citrix Xen Server host, probably also running CentOS),

Re: oob schemas, re: The Language of the System

2014-01-20 Thread James Gatannah
On Sunday, January 19, 2014 12:48:36 PM UTC-6, Brian Craft wrote: That helps, thanks. It's still unclear to me that this is important enough to worry about. What application or service is hindered by string encoding a date in JSON? An example would really help. It's not compelling to

Re: Confusing ArityExceptions from macros

2013-10-23 Thread James Gatannah
Oh, nice! I've been wondering what this error means for at least a month now. Thanks, James On Thursday, October 17, 2013 1:14:21 PM UTC-5, Alex Coventry wrote: If you've ever had a confusing ArityExceptionhttp://clojure-log.n01se.net/date/2013-10-16.html#19:37 while working with macros,