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

2016-10-11 Thread Matt Mitchell
My first Clojure "app" was a CLI utility that pulled data from a SQL 
database, mapped records into another form, and pushed them into a search 
engine app. It took me about 3 weeks to do that with no lisp experience at 
all, and I was super rusty on Java at that point. It was "hard", but I 
really only remember that as a very enjoyable learning experience. I don't 
think Clojure is any more difficult than language X, Y or Z really. From 
what I've seen from other developers, it's mostly a matter of getting over 
the parens/syntax (seriously). Once that's over, it's like any other 
language - it'll all click - "variables", conditionals, functions, state 
etc.. Just get started, don't hesitate. Peel back the layers one at a time 
and enjoy the learning experience. After a while, you might even find 
yourself preferring Clojure (those parens are there for a really good 
reason), and then eventually, every other language will look inferior (just 
kidding, maybe).

More to your question though - Clojure can definitely be used to build 
websites. A minimalist toolset would be (think Sinatra or Express) Ring and 
Bidi or Compojure. Throw in some common Ring middleware (static assets, 
sessions, file-type info) and you're getting somewhere. If you want 
something like Rails, I'm sure others here could recommend something.

- Matt

On Thursday, October 6, 2016 at 5:39:43 PM UTC-4, Xman wrote:
>
> It's been many years of postponing learning programming, because I 
> considered the popular languages of that time not right.
> It took me nearly 3 years to learn and build a website using another stack 
> (I wont advertise here), 
> and without having much previous knowledge in programming.  I have not 
> deployed the website yet. 
> I would like to know if Clojure is a great option to make websites ?
>
> I found out that there are new features on the web that Clojure is better 
> for, but I don't use those features in the present. 
> When I choose to learn a language I decide by myself, and after listening 
> to a video talk, it gives me reasons to think that its better.
> I want to learn the language and "frameworks" (or how to create the 
> architecture) much quicker than previous attempt.
>
> I'd like to know if its possible to do that in less than 6 months or if I 
> should stay with the framework I know ?
>

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] prismatic/schema 1.0 adds automatic test data generation

2015-09-02 Thread Matt Mitchell
I just created a scratch project using schema-1.0.0. Requiring schema.core 
works fine, but coerce throws an exception. Here's the repl session:

user=> (require '[schema.core])

 

nil 

user=> (require '[schema.coerce]) 


 

CompilerException java.lang.RuntimeException: No such var: s/spec, compiling
:(schema/coerce.clj:31:28)



- Matt

On Tuesday, September 1, 2015 at 2:02:30 PM UTC-4, Jason Wolfe wrote:
>
> We're excited to finally bring Schema out of alpha, while introducing some 
> new exciting features around testing: test.check integration and data 
> completion.  Check out the blog post for details about these new 
> applications.
>
> http://blog.getprismatic.com/schema-1-0-released/
>
> We've also rewritten the internals of schema for this release, to make it 
> easier and faster to add new schema types and applications.  We expect 
> ordinary users of Schema should see no breaking changes, but custom schema 
> types or tooling will likely need to be updated.  Please see the changelog 
> for details.
>
> https://github.com/Prismatic/schema/blob/master/CHANGELOG.md
>
> Comments and suggestions welcome!
>

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] prismatic/schema 1.0 adds automatic test data generation

2015-09-01 Thread Matt Mitchell
Awesome and good work! Can't wait to try it out.

- Matt

On Tuesday, September 1, 2015 at 2:02:30 PM UTC-4, Jason Wolfe wrote:
>
> We're excited to finally bring Schema out of alpha, while introducing some 
> new exciting features around testing: test.check integration and data 
> completion.  Check out the blog post for details about these new 
> applications.
>
> http://blog.getprismatic.com/schema-1-0-released/
>
> We've also rewritten the internals of schema for this release, to make it 
> easier and faster to add new schema types and applications.  We expect 
> ordinary users of Schema should see no breaking changes, but custom schema 
> types or tooling will likely need to be updated.  Please see the changelog 
> for details.
>
> https://github.com/Prismatic/schema/blob/master/CHANGELOG.md
>
> Comments and suggestions welcome!
>

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Clojure 1.7.0-beta2

2015-04-24 Thread Matt Mitchell
Awesome. Just tested it on our API and working well. Looking forward to a 
more in depth testing session!

- Matt

On Friday, April 24, 2015 at 2:27:40 PM UTC-4, Alex Miller wrote:

 Clojure 1.7.0-beta2 is now available.

 Try it via
 - Download: 
 https://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-beta2/
 - Leiningen: [org.clojure/clojure 1.7.0-beta2]

 Regression fixes since 1.7.0-beta1:

 1) CLJ-1711 - structmap iterator broken
 2) CLJ-1709 - range wrong for step != 1
 3) CLJ-1713 - range chunks are not serializable
 4) CLJ-1698 - fix reader conditional bugs

 Additional enhancements to new features since 1.7.0-beta1:

 1) CLJ-1703 - Pretty print #error and new public function Throwable-map
 2) CLJ-1700 - Reader conditionals now allowed in the REPL
 3) CLJ-1699 - Allow data_readers.cljc as well as data_readers.clj
   
 For a full list of changes since 1.6.0, see:
 https://github.com/clojure/clojure/blob/master/changes.md

 Please give it a try and let us know if things are working (or not)!

 - Alex



-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Clojure Applied: From Practice to Practitioner

2015-04-13 Thread Matt Mitchell
Just picked it up! Thanks Alex. Sounds like the sort of thing I've been 
wanting more info on for a while now. Looking forward to the reading!

- Matt

On Wednesday, April 8, 2015 at 9:27:58 AM UTC-4, Alex Miller wrote:

 Hey all,

 I'm very happy to announce that Clojure Applied is now available in beta:

 https://pragprog.com/book/vmclojeco/clojure-applied

 I've been working on this with Ben Vandgrift for a long time, hoping to 
 fill the underserved niche of *intermediate* Clojure material. Our goal 
 is to step in after you've read any of the fine introductory books and 
 provide the next level of guidance needed to successfully apply Clojure to 
 real problems.

 The chapters are:

 1. Model Your Domain - an overview of modeling domain entities, modeling 
 relationships, validating them, and creating domain operations.
 2. Collect And Organize Your Data - choosing the right collection, 
 updating collections, accessing collections, and building custom 
 collections.
 3. Processing Sequential Data - using sequence functions and transducers 
 to transform your data.
 4. State, Identity, and Change - modeling change and state with Clojure's 
 state constructs.
 5. Use Your Cores - waiting in the background, queues and workers, 
 parallelism with reducers, and thinking in processes with core.async.
 6. Creating Components - organizing your code with namespaces, designing 
 component APIs, connecting components with core.async channels, and 
 implementing components with state.
 7. Compose Your Application - assembling components, configuration, and 
 entry points.
 8. Testing Clojure - example- and property-based testing with 
 clojure.test, expectations, and test.check. 
 9. Playing With Others - details TBD
 10. Getting Out The Door - publishing your code and deploying your 
 application.

 Chapters 1-6 and 10 are available now in beta form. We expect to release a 
 new chapter every 2-3 weeks until completion. The printed book should be 
 available this fall.

 Alex


-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Debugging in CIDER

2015-03-30 Thread Matt Mitchell
Awesome.

+1 for a new release too, lots of other good stuff in there too.

- Matt

On Saturday, March 28, 2015 at 1:46:33 PM UTC-4, Bozhidar Batsov wrote:

 Hey everyone,

 Just wanted to let you know that the most requested feature for CIDER (a 
 debugger, in case you're wondering) has just landed in the master branch (
 https://github.com/clojure-emacs/cider/pull/1019#issuecomment-87240470).

 The new CIDER debugger is inspired by edebug (Emacs's own debugger) and 
 based on https://github.com/razum2um/clj-debugger

 It's not super fancy and there's clearly room for improvement in both 
 clj-debugger and CIDER itself, but it's a pretty good first step. Please, 
 take the new debugger out for a spin and let us know what do you think 
 about it. You might also report any problems you've encountered. :-)

 If all is well, CIDER 0.9 will probably be released in a week or so.

 P.S. Thanks, Artur (https://github.com/Malabarba), for all the hard work 
 on the debugger! You've once again showed the power of the OSS! There's 
 nothing we can't build together!


-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[job] Clojure opportunity at Lucidworks

2015-02-06 Thread Matt Mitchell
Hello fellow Clojurians!

Lucidworks http://lucidworks.com is looking for a Clojure dev with 
experience in web API services; security exp. is a big bonus. We are 
considering remote devs but only in the US at this time. See the job posting 
http://lucidworks.com/company/careers/security-engineer/, and please ping 
me directly (not here) if you have specific questions - *matt.mitchell at 
lucidworks.com*

Really hope to hear from some of you!

- Matt Mitchell

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: using Stuarts component library correctly

2014-08-10 Thread Matt Mitchell
Here's some relevant info about tools.namespace and 
protocols: https://github.com/clojure/tools.namespace#warnings-for-protocols

- Matt

On Saturday, August 9, 2014 6:04:03 PM UTC-4, Sven Richter wrote:

 Hi,

 First I would like to thank everybody for your answers and hints.

 I setup a small project you can find here: 
 https://github.com/sveri/component_test
 You can run it with lein repl and then calling (go).

 I have three questions/problems for this one:
 1. Did I separate the handler and the server correctly (I was trying to 
 follow your advices)?

 2. In scheduler.clj I defined a protocol (additionally to the lifecycle 
 protocol) and a record implementing that protocol. I create a new instance 
 of that record and pass it down to the handler and there to the routes. 
 Now, when I open a webpage and go to http://localhost:3000/sched 
 everything works fine.
 Next I edit the add-job function in scheduler.cljs to print something 
 different like this:
 (add-job [this]
 (println new sys out))
 Just a small change is enough. If you go to the webpage again and try to 
 reload it an exception will be thrown:
 Sat Aug 09 23:52:28 CEST 2014 [worker-3] ERROR - GET /sched
 java.lang.IllegalArgumentException: No implementation of method: :add-job 
 of protocol: #'component-test.scheduler/ISched found for class: 
 component_test.schedul
 er.Sched
 at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:544)
 at 
 component_test.scheduler$eval6553$fn__6554$G__6544__6559.invoke(scheduler.clj:6)
 at component_test.routes$sched_in.invoke(routes.clj:8)
 at component_test.routes$home_routes$fn__3312.invoke(routes.clj:19)
 at compojure.core$make_route$fn__2331.invoke(core.clj:99)
 at compojure.core$if_route$fn__2315.invoke(core.clj:45)
 ...

 I dont really understand why that happens and any hints regarding what I 
 am doing wrong would be great. And this leads to my last question.

 3. After having an exception I will usually try to reset the system with: 
 (reset), but in this case (and many different other cases) I will just get 
 another error:
 component-test.user= (reset)
 :reloading (component-test.scheduler component-test.routes 
 component-test.server component-test.handler component-test.core 
 component-test.user component-test.c
 ore-test)
 ;; Starting HTTP-Kit server on port 3000

 BindException Address already in use: bind  sun.nio.ch.Net.bind0 
 (Net.java:-2)

 And now all I can do is exit the repl and start it again to get my code 
 running.

 This is exactly what I dont want to do all the time and the problem I 
 thought would be solved by the component library, so once more, every hint 
 you have for me will be valuable about what I can do and what not.

 Best Regards,
 Sven

 Am Freitag, 8. August 2014 13:16:49 UTC+2 schrieb Sven Richter:

 Hi,

 I am trying to integrate Stuarts component library into my application. I 
 am not sure if I use it correctly or do something else wrong or just have a 
 wrong mindset. So I will explain how I am currently using it and the 
 problem I see with it.

 I have three components: database, a scheduler and web application (note 
 that my example is simplified to get faster to the point). These components 
 are built like this:

 (component/system-map
   :database (db db-uri)
   :scheduler (component/using (scheduler) [:database])
   :web-app (component/using (web-app)
 [:database
  :scheduler] ))

 And in my web-app I do something like this:

 (start [component]
 (let [db-conn (get-in web-app [:database :db-conn])]
   (assoc component :server
(run-server (make-handler web-app db-conn) {:port 
 port}

 And make-handler is a middleware that associates the database component 
 into the request map.

 Now as I added the scheduler to my system it occured to me that I will 
 have to associate the scheduler into the request map too to access it and I 
 might have to do that for every other component that is coming along the 
 road.
 So basically I am tying my web-app to to all these components and I am 
 tying some components to other components (like scheduler component to the 
 database component).

 And by tying this things together this way they do depend on each other 
 and I cannot move them anymore. This came to my mind as I started thinking 
 about microservices.

 So let's say I want to convert the scheduler into a restful microservice, 
 it's hard to pass in a database connection into it via HTTP, so it seems 
 like it's not decoupled enough. Does that make sense?

 Am I using it wrong? Is it ok to pass all kind of dependencies into the 
 request map and shove it around in the web application? Any other 
 suggestions / remarks?

 Best Regards,
 Sven



-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to 

Re: using Stuarts component library correctly

2014-08-09 Thread Matt Mitchell
I use a closure, but with a slight twist in handler definitions. I close 
over a make-handler fn with the system component.. which returns a 
middleware-wrapped, dispatcher fn; the thing that handles the routing logic 
to a particular handler fun. Each of my handlers are 2 arg fns: (fn [system 
request]) - so the dispatcher passes-in the system to the appropriate 
handler at request-time along with the request.

The system instance is defined in the core ns of my app as a var, and I 
use the same approach Stuart does to deal with app state in a friendly way: 
stop/start and alter-var-root! - that's the only global state, and it's 
really only used for development purposes.

I'm still working out some kinks with testing. I recently moved from Midje 
to clojure.test. I use a lot of reify and proxy for mocking, but I'll 
gladly take this over with-redefs wherever possible. There's definitely 
room for improvement. For example, creating a test system etc..

- Matt

On Saturday, August 9, 2014 9:50:54 AM UTC-4, Brendan Younger wrote:

 I've struggled with the same issue as you, Sven.  In a web app, your 
 handlers wind up needing access to every other component in the system 
 because they are the first point of contact with the outside world.

 In my apps, I've done this one of two ways:

 1. Close over the needed dependencies when creating the ring handlers. 
  (Instead of just associating it into the request map.)  For example:

 (defn make-handler [db sched]
(routes
   (GET / request ...code which uses the db)
   (POST / request ...code which uses the scheduler...)))

 2. Make the system a global variable in your handler namespace.  For 
 example:

 (def system (atom nil))

 (defroutes all-the-routes
(GET / request ...do something with (:db @system)...))

 As long as you don't let code further down the chain rely on having a 
 :system key in the request map or a system global variable, you're still 
 achieving pretty good separation of concerns.

 Brendan

 On Friday, August 8, 2014 7:16:49 AM UTC-4, Sven Richter wrote:

 Hi,

 I am trying to integrate Stuarts component library into my application. I 
 am not sure if I use it correctly or do something else wrong or just have a 
 wrong mindset. So I will explain how I am currently using it and the 
 problem I see with it.

 I have three components: database, a scheduler and web application (note 
 that my example is simplified to get faster to the point). These components 
 are built like this:

 (component/system-map
   :database (db db-uri)
   :scheduler (component/using (scheduler) [:database])
   :web-app (component/using (web-app)
 [:database
  :scheduler] ))

 And in my web-app I do something like this:

 (start [component]
 (let [db-conn (get-in web-app [:database :db-conn])]
   (assoc component :server
(run-server (make-handler web-app db-conn) {:port 
 port}

 And make-handler is a middleware that associates the database component 
 into the request map.

 Now as I added the scheduler to my system it occured to me that I will 
 have to associate the scheduler into the request map too to access it and I 
 might have to do that for every other component that is coming along the 
 road.
 So basically I am tying my web-app to to all these components and I am 
 tying some components to other components (like scheduler component to the 
 database component).

 And by tying this things together this way they do depend on each other 
 and I cannot move them anymore. This came to my mind as I started thinking 
 about microservices.

 So let's say I want to convert the scheduler into a restful microservice, 
 it's hard to pass in a database connection into it via HTTP, so it seems 
 like it's not decoupled enough. Does that make sense?

 Am I using it wrong? Is it ok to pass all kind of dependencies into the 
 request map and shove it around in the web application? Any other 
 suggestions / remarks?

 Best Regards,
 Sven



-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Community Interest in a Clojure Application Config Library, using Zookeeper?

2014-05-22 Thread Matt Mitchell
+1 for open sourcing drcfg!

Might be interesting to apply the same idea (drcfg) to the SS component 
model, where a component manages the atoms instead of having to def them. I 
did something very similar but on top of Curator. One component defined as 
a service discovery component, and others that depend on it. The discovery 
component exposes a listenable interface; when a service is discovered 
the callbacks are fired and the dependent components are notified.

Related but slightly OT - I didn't think the component lib provided the 
ability to restart an individual component within a system?

- Matt

On Thursday, May 22, 2014 10:29:50 AM UTC-4, Thomas Steffes wrote:

 Currently config changes that require restart of a component are not 
 supported by our drcfg

 On Wednesday, May 21, 2014 12:59:18 PM UTC-4, Ben Mabey wrote:

 On 5/20/14, 3:33 PM, Thomas Steffes wrote: 
  Hey folks, 
  
  At Room Key we're using Apache Zookeeper and a home-grown clojure 
  library called drcfg for real-time application configuration 
  management. We're debating open-sourcing drcfg and are trying to gauge 
  community interest in such a tool. 
  
  We think it's got great usage semantics, basically you just def an 
  atom in any namespace where you'd like a variable that can be changed 
  in real-time on a running system. When you define the atom, you can 
  also provide defaults to fall back to if zookeeper is unavailable, a 
  validator to be run on any value when a change is attempted (to 
  prevent invalid configuration data), as well as some meta-data about 
  the variable. 
  
  We've also got a web UI we use to change configuration data, but that 
  would likely be released separate of drcfg itself. 
  
  If anyone's interested, could you reply to this post? I can provide 
  more information as well if need be. 
  
  
  -Thomas Steffes @ Room Key 
  
 Hi Thomas, 
 I'd be interested in learning more about your solution.  Have you ever 
 ran into the case where a config change needs to restart a component?   
 If so, have you written the logic that handles the updating of your 
 entire system based on this change?  e.g. a new DB config requires that 
 your DB component be restarted and each component that relies on the DB 
 component be restarted as well to get the new connection. 

 Thanks, 
 Ben 



-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: use/require/import and quoted form

2014-02-07 Thread Matt Mitchell
Can you give a code example?

- Matt

On Thursday, February 6, 2014 3:15:13 AM UTC-5, Andy Smith wrote:

 Hi,

 I was wondering why use/require and import take quoted forms as their 
 arguments, other alternatives could be strings or keywords, so what is 
 special about the choice of quoted form here?

 Andy


-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Video: Generating Beautiful (and Correct) Documentation from Unit Tests Files

2013-09-26 Thread Matt Mitchell
Very nice! Does lein-midje-doc use the Midje fact(s) labels?

- Matt

On Wednesday, September 25, 2013 10:33:31 PM UTC-4, zcaudate wrote:

 I've put up a video of a new documentation plugin for leiningen

 Project Page:
 https://github.com/zcaudate/lein-midje-doc

 Youtube Video:
 http://www.youtube.com/watch?v=8FjvhDPIUWEfeature=youtu.be


 Sample Generated Documentation:
 http://z.caudate.me/lein-midje-doc/
 http://z.caudate.me/ribol/
 http://z.caudate.me/ova/


 Any Comments or Feedback would be appreciated


-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Best way to pass through named arguments (destructured map)?

2013-09-09 Thread Matt Mitchell
And also:

(mapcat identity {:in [1 2 3]}) = '(:in [1 2 3])

But yeah, destructuring with ** then using *apply* is pretty clear too.

- Matt

On Monday, September 9, 2013 10:41:12 PM UTC-4, Leif wrote:

 Careful - `flatten` recursively flattens sequential things.  E.g.
 (flatten (seq {:in [1 2 3]})) = '(:in 1 2 3), which is probably not what 
 you want.

 You really want `flatten1`, which doesn't exist in core.  A version that 
 works on maps is
 (apply concat {:in [1 2 3]}) = '(:in [1 2 3]).  This appears within 
 Alex's solution.

 I would personally go with Meikel's solution, though.  It seems the nicest.

 --Leif

 On Monday, September 9, 2013 7:02:43 PM UTC-4, Mark Mandel wrote:

 The solution I've actually gone with is:

 (apply esd/search es-index mapping-type (- options seq flatten))

 Seems the most consise and shows the intent of what I'm trying to do 
 quite well - better than a (relatively) confusing `reduce` statement.

 Again, the help is appreciated.

 Mark


 On Tue, Sep 10, 2013 at 8:57 AM, Mark Mandel mark@gmail.com wrote:

 Thanks for the help all, that gave me some things to think about.

 Cheers,

 Mark


 On Mon, Sep 9, 2013 at 9:22 PM, Meikel Brandmeyer (kotarak) 
 m...@kotka.de wrote:

 Hi,

 Am Montag, 9. September 2013 12:31:30 UTC+2 schrieb Alex Fowler:

 I would also add that in case, if you *need* to destructure the 
 `options` map for some reason, like:

 `(defn search
   Docstring
   [mapping-type  {:keys [option-1 option-2] :as options}]
   (do-smth-with-option-1 ...)
   (apply esd/search es-index mapping-type options))`

 then you can use `mapply` to apply maps to functions that accept 
 optional args maps. The code of mapply is the fllowing:

 `(defn mapply [f  args] (apply f (apply concat (butlast args) (last 
 args`

 Combining it with partial, as adviced, could give you the 
 functionality you may sometimes need:

 `(mapply (partial es/search es-index) your-options-map)`


 You don't have to destructure in the argument list:

 (defn search
   [mapping-type  options]
   (let [{:keys [option-1]} options
 index (index-based-on option-1)]
 (apply esd/search index mapping-type options)))

 Kind regards
 Meikel

  -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.com
 Note that posts from new members are moderated - please be patient with 
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google 
 Groups Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to clojure+u...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




 -- 
 E: mark@gmail.com
 T: http://www.twitter.com/neurotic
 W: www.compoundtheory.com

 2 Devs from Down Under Podcast
 http://www.2ddu.com/
  



 -- 
 E: mark@gmail.com
 T: http://www.twitter.com/neurotic
 W: www.compoundtheory.com

 2 Devs from Down Under Podcast
 http://www.2ddu.com/
  


-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Leiningen 2.3.0 released

2013-08-09 Thread Matt Mitchell
The upgrade ended up breaking lein on my system. This fix worked for me. 
Thanks!

On Friday, August 9, 2013 5:30:42 AM UTC-4, Jean Niklas L'orange wrote:

 Hey guys,

 I've hacked together a temporary fix for people who really, really, really 
 want to use 2.3.0 right away, or have broken their lein script and just 
 want to solve this the easy way. I would NOT recommend people to upgrade 
 right now, just wait until the jar has been set up with the right acl. (I 
 would be surprised if that's not the first thing Phil would do in the 
 morning.)

 If you've not tried to upgrade, do so and get the error message in your 
 face: lein upgrade should do the trick. Then go to the directory 
 ~/.lein/self-installs (or your equivalent directory on Windows). Download 
 https://github.com/hyPiRion/leiningen-2.3.0-tempfix/raw/temporary-fix/target/leiningen-2.3.0-standalone.jar
  (wget/curl) 
 and save it in the folder. Ensure that it has the name 
 leiningen-2.3.0-standalone.jar. That's all you need to do to get 2.3.0 
 working.

 Again: this is just a temporary fix, and it is packaged by me, not Phil. 
 However, it should be equivalent in terms of functionality, and there 
 shouldn't be any need to replace the jar once it's downloaded.

 I'll remove the repo with the temporary fix once it is possible to 
 download the official release once again.

 -- Jean Niklas


-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Lexer and parser generator in Clojure

2012-05-19 Thread Matt Mitchell
Here's a parser: https://github.com/joshua-choi/fnparse

Doesn't look like it's active, but could be a starting point?

- Matt

On Friday, May 18, 2012 8:46:19 AM UTC-4, Alexsandro Soares wrote:

 Hi,

  I'm trying to build a compiler using Clojure. Is there any tools 
 like flex and bison generating Clojure code? 
  I'm interested in a lexer/parser in pure Clojure because I think
  in use the same code with Javascript (via ClojureScript) and Java (via 
 Clojure). 
 I already know isolated tools like Jflex, JavaCup and Bison generating 
 Java and
 Jison, JS/CC and friends for Javascript, but I am just interested in a 
 pure Clojure solution.

 Thanks in advance for any answer.

 Cheers,
 Alex


-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Help organizing code and namespaces

2011-06-18 Thread Matt Mitchell
Hi,

I have 3 namespaces, each with functions that relate to the name of the ns:

core -- contains config and *server* var
query  -- contains fn's related to querying
update -- contains update/delete fn's

I want to be able to use my core ns in my application, and call all of the 
public fn's in core, query and update without going through the query and 
update ns aliases. This would be as simple as specifying use in the core 
ns when defining the namespace.

The problem is that the query and update ns's need to access a var called 
*server* in the core ns. The *server* var is set using binding like so:

(use 'my.core)
(with-server :whatever-sever-name
  (delete-by-id xyz))

delete-by-id is an fn in the update namespace, and looks something like:

(defn delete-by-id [id] (*server*/delete-by-id id))

The problem is *server* belongs to core, so that doesn't work. If I pull in 
core to the update ns, I get a circular reference error.

My question is, how can I keep my code separated as it is, but have it so I 
use core, and automatically bring all the fn's in to the same scope, all 
while sharing the core/*server* var? I could easily push all the fn's in the 
same ns, but that seems messy.

Thanks,
Matt

-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en