Re: Entity–component–system and Clojure

2017-08-15 Thread Mark Mandel
A while ago, I wrote a library called *brute *as an ECS library for Clojure
+ ClojureScript.

Articles:
http://www.compoundtheory.com/category/brute/

Github:
https://github.com/markmandel/brute
https://github.com/markmandel/brute-play-pong

Mark

On 15 August 2017 at 18:49, James Reeves  wrote:

> I wrote Ittyon  a little while
> ago, which is a database partially inspired by the entity-component model,
> but uses a more clojurey architecture.
>
> There are also experiments with trying to make rule systems like Clara
> fast enough to use in games.
>
> On 16 August 2017 at 02:05, Jeaye  wrote:
>
>> Alex Kehayias gave a talk about designing a functional game engine in
>> ClojureScript, using components, here: https://www.youtube.com/watch?
>> v=TW1ie0pIO_E I thought it was a superb talk.
>>
>> There's also Arcadia, here: https://github.com/arcadia-unity/Arcadia
>> which wrap's Unity3D in Clojure, but Unity takes about the most imperative
>> approach to components as possible.
>>
>> In general, and as Alex shows, the entity-component approach can work
>> very well with game engines. The issues of coupling can either be tackled
>> with explicit dependency declaration or by a more flexible async
>> notification/inbox system. I haven't yet built something like this, though
>> I'd like to, but, if/when I do, my design would be very much along the
>> lines of Alex's.
>>
>> J
>>
>> On Tue, Aug 15, 2017 at 05:52:38PM -0700, Didier wrote:
>> > I recently stumbled upon the entity-component-system design pattern
>> which
>> > is popular in game engine
>> > design: https://en.wikipedia.org/wiki/Entity%E2%80%93component%E2%80
>> %93system,
>> > and really liked what I saw, thought it could be a good fit for Clojure.
>> >
>> > Basically, it has three concepts:
>> >
>> > 1) Components are pure data grouped together as per a given domain. In a
>> > game engine that would be for example the 3D positional data related to
>> > positioning of objects in the 3D scene. So one component would be
>> > PositionComponent and it would have :X, :Y.
>> >
>> > 2) Entities are collections of Components with a unique ID.
>> >
>> > 3) Systems are processing functions that take an entity, transforming
>> their
>> > components' data, or performing side effects from them.
>> >
>> > Generally, in games, they inverse the entities, so instead of having
>> > entities contain components, they have components stored in an array
>> with
>> > the index being the entity ID, and another array which contains the set
>> of
>> > components for the entity at that index. All of this is kept track of
>> by a
>> > world container.
>> >
>> > (def world
>> >   {:entities []
>> >:comp1 []
>> >:comp2 []
>> >...})
>> >
>> >
>> > So say you want to create an entity which is composed of comp1 and
>> comp2,
>> > you would just add to the world :entities at index 0 a set #{:comp1
>> > :comp2}, and to the world :comp1 and :comp2 vectors at index 0 an
>> initial
>> > component1 and component2 data structure. In games, for performance,
>> they
>> > use a bitmask instead of a set for the entry of :entities.
>> >
>> >
>> > I'm not sure this structure is necessary if trying to use the pattern
>> not
>> > for game, but it doesn't hurt either I think.
>> >
>> > What I like about this, is I'm thinking its possible to use it to do
>> > data-driven functional object modeling in Clojure. A problem I face,
>> and I
>> > feel other faces in Clojure, is how do you model entities without OOP? I
>> > find this creates a kind of OO that is functional and data driven.
>> >
>> > You would spec a bunch of component, they're pure data. Then you'd
>> define
>> > systems (aka functions) which take an entity, and operate on the
>> entity's
>> > components (aka its data). At first glance, this appears to just be OOP,
>> > but there's no inheritance here, and functions that operate or related
>> data
>> > are decoupled from the data. Systems are implicitly mapped to
>> components,
>> > based on what they work on. So you can extend all entities with more
>> > functionality easily. You can also create entities from components on
>> the
>> > fly.
>> >
>> > On second glance, I wonder what's different about this from just
>> functions
>> > operating over data. I think its just a more rigid means to do so when
>> you
>> > need the concept of entities. In a way, entities act as a class, in that
>> > they're a template of data. A system works over that template.
>> >
>> > Has anyone experimented with this in Clojure?
>> >
>> > --
>> > 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

Re: What's the best option similar to Vert.x, Reactor, Nodejs for use with Clojure?

2016-01-23 Thread Mark Mandel
+1 to what Andrey said.

You could also run Redis as a backend and use it's pubsub service [1], if
being more language agnostic is more your thing.

Depending on where you are hosting, you could also use a hosted pubsub
mechanism, such as Google Cloud PubSub[2] or AWS SNS[3].

There are definitely lots of ways to solve this particular problem outside
of vert.x

[1]: http://redis.io/topics/pubsub
[2]: https://cloud.google.com/pubsub/docs
[3]: https://aws.amazon.com/sns/faqs/

On 23 January 2016 at 08:20, Andrey Antukh  wrote:

> The eventbus of vert.x as far as I know is implemented on top of
> hazelcast[1] that you already can use from clojure.
>
> Make a eventbus like concept on top of hazelcast is pretty easy and it
> already gives you the autodiscovery and all the "clustering" stuff for free.
>
> [1]; http://hazelcast.org/use-cases/messaging/
>
> Andrey
>
> On Sat, Jan 23, 2016 at 1:50 PM, qsys  wrote:
>
>> Depends on what you want... what I really like is the easy modularity:
>> deploy new 'verticles' somewhere in your network, and they're just all
>> connected through a the eventbus. I make a 'new' module, I put it somewhere
>> and it's automatically picked up by the appication and I can communicate
>> with it using that event bus. Is there something similar in clojure, or can
>> I achieve something similar in clojure? I checked
>> - catacumba: web toolkit, not what I'm after
>> - sente: is about the web
>> - aleph: comes closer: does have tcp-servers, but no autodiscovery, and
>> well, no 'event bus' (a kind of wrapper around netty etc).
>> - manifold: I don't really see the added value, having core.async - but I
>> may fail to see something important here
>> - pomegranate: is possibly very interesting in adding new modules... not
>> for removing 'old versions' of a module.
>> - pedestal: have to have a deeper look into it, but so far, I have a
>> feeling it's more about web than 'intra-program' communication
>>
>> So, so far, I don't see how to implement something like the vert.x event
>> bus, with autodiscovery, in clojure (although I would love to see something
>> like it), expanding to the browser. I don't mind (and prefer) composing it
>> using different libraries, but I feel to see how to have this functionality
>> in clojure (now, I wrap the vertx eventbus in my clojure programs), and
>> since I already load vertx for the eventbus, I use it as web server as
>> well, if I need one... So well, if someone has an idea, it might be a nice
>> project I'd love to work on :).
>>
>> thx, qsys
>>
>> Op zondag 3 januari 2016 22:25:04 UTC+1 schreef tbc++:
>>>
>>> I've done some evaluations of Vert.x in the past and was rather
>>> underwhelmed. What is it that you are trying to accomplish? Stuff like
>>> Pedestal offers async web services, but without the complexity of an
>>> traditional evented server. So perhaps if we had a better idea of your
>>> requirements we could be a bit more helpful.
>>>
>>> So I'd say, look into Pedestal and then define what you need that it
>>> cannot do. Same for other toolkits like ring and httpkit.
>>>
>>> Timothy
>>>
>>> On Sun, Jan 3, 2016 at 12:59 PM, adrians  wrote:
>>>

 It used to be that Vert.x 2.x had integration for Clojure, but version
 3.x hasn't added it yet. Has anyone used this version through the Java API
 and if so, how painful was it? Is Reactor any
 better in that respect? What are people using when they want this kind of
 back end?

 --
 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/d/optout.

>>>
>>>
>>>
>>> --
>>> “One of the main causes of the fall of the Roman Empire was that–lacking
>>> zero–they had no way to indicate successful termination of their C
>>> programs.”
>>> (Robert Firth)
>>>
>> --
>> 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

[ANN] Brute 0.4.0 - A lightweight Entity Component System library for writing games

2016-01-21 Thread Mark Mandel
Brute is a simple and lightweight Entity Component System library for
writing games with Clojure and ClojureScript.

This release is essentially just a move from CLJX to Reader Conditionals to
implement support for both CLJ and CLJS.

Full details, and how the conversation process went can be found in the
full blog post:
http://www.compoundtheory.com/brute-0-4-0-from-cljx-to-reader-conditionals/

Project can be found on Github at:
https://github.com/markmandel/brute

As always feedback and pull requests are welcome.

-- 
E: mark.man...@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/d/optout.


Re: Better/more idiomatic way to read EDNs than using java.io.PushbackReader

2015-03-06 Thread Mark Mandel
Totally off the top of my head, but this should work -

(edn/read-string (join " " (line-seq r)))

Mark

On 7 March 2015 at 14:18, Sam Raker  wrote:

> I'm experimenting a little with EDN files. I've currently got this
> function:
>
> (defn from-edn [edn-file] (with-open [r (clojure.java.io/reader edn-file)]
> (edn/read (java.io.PushbackReader. r
>
> Having to explicitly reach into the Java API to read a clojure-only format
> seems wrong. What should I be doing instead?
>
> --
> 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.
>



-- 
E: mark.man...@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/d/optout.


Re: Unmarshalling EDN to Java Object

2014-10-08 Thread Mark Mandel
I'm sure you can, but you would need to implement your own custom methods
to do it, using :readers or :default options in edn/read  / edn/read-string

It would very much depend on the format of the outputted EDN as to which
approach to take.

Mark



On 9 October 2014 07:12, Timur  wrote:

> Hi everyone,
>
> One can use into-edn [1] to convert from Java objects to EDN structures.
>
> Is there a way to convert EDN structures to their original Java objects?
>
> Regards,
>
> Timur
>
> [1] https://github.com/thebusby/into-edn
>
> --
> 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.
>



-- 
E: mark.man...@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/d/optout.


[ANN] Brute 0.3.0 - A lightweight Entity Component System library for writing games

2014-07-16 Thread Mark Mandel
Brute is a simple and lightweight Entity Component System library for
writing games with Clojure and now also **ClojureScript**.

Big thanks to Martin Janiczek  for porting
Brute over to CLJX and making everything work.

There are also some new functions - including:

   - An implementation of (update-function ... ) to make functionally
   changing component state much easier
   - Ability to add throttled system functions that only fire every n
   milliseconds.

Full blog post on changes:
http://www.compoundtheory.com/brute-0-3-0-now-supporting-clojurescript/

Project can be found on Github at:
https://github.com/markmandel/brute

As always feedback and pull requests are welcome.

-- 
E: mark.man...@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/d/optout.


Re: working intellij plugin?

2014-07-13 Thread Mark Mandel
Try this for IntelliJ instead. It's far better:

https://cursiveclojure.com/

Mark


On Mon, Jul 14, 2014 at 11:35 AM, Brian Craft  wrote:

> In need of a way to breakpoint in java code, I decided to look at
> intellij. I tried the directions here:
>
> http://wiki.jetbrains.net/intellij/Getting_started_with_La_Clojure
>
> which don't work. When trying to open a project, it throws:
>
> java.lang.NoSuchMethodError:
> com.intellij.openapi.module.ModifiableModuleModel.newModule(Ljava/lang/String;Lcom/intellij/openapi/module/ModuleType;)Lcom/intellij/openapi/module/Module;
> at
> de.janthomae.leiningenplugin.project.LeiningenProject.reimport(LeiningenProject.java:133)
> at
> de.janthomae.leiningenplugin.project.LeiningenProjectsManager.importLeiningenProject(LeiningenProjectsManager.java:71)
> at
> de.janthomae.leiningenplugin.project.LeiningenProjectBuilder.commit(LeiningenProjectBuilder.java:57)
>
>
> Tracking down the leinningen plugin project I see that it's dead, and
> points to the cursive project, which has no downloads.
>
> Is there a way to get this working? Or, alternatively, is there a less
> painful way to set a breakpoint in java code from a lein project? My usual
> environment is fireplace. Command line would be great, but I'm not up for
> switching to emacs this week. ;)
>
> --
> 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.
>



-- 
E: mark.man...@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/d/optout.


Re: [ANN] Clojure cheatsheet variants with links to Grimoire

2014-07-11 Thread Mark Mandel
Brilliant work :) This is definitely my new goto for Clojure docs.

Mark


On Sat, Jul 12, 2014 at 8:38 AM, Reid McKenzie 
wrote:

>  Sorta kinda on the automated synchronization. Whenever I rebuild/update
> Grimoire (and you can too!) it fetches the latest examples from ClojureDocs
> and formats them appropriately. So as of the last rebuild Grimoire is at
> least a clone of Clojuredocs.
>
> I hope that this proves useful,
> Reid
>
>
> On 07/11/2014 05:39 PM, Andy Fingerhut wrote:
>
>Thanks to some updates from Reid McKenzie (aka arrdem), there are now
> Clojure cheatsheet variants published with links to Grimoire pages, in
> addition to the ones that have been up for years now that have links to
> ClojureDocs pages.
>
>  The version at clojure.org/cheatsheet is unchanged (it still links to
> ClojureDocs).
>
>  One click away from that page is here:
>
> http://jafingerhut.github.io
>
>  And in the table of variants there are now ClojureDocs and Grimoire
> links.  Here is my personal favorite, because it has nice tooltips:
>
>
> http://jafingerhut.github.io/cheatsheet/grimoire/cheatsheet-tiptip-cdocs-summary.html
>
>  The primary advantage to the Grimoire-linked versions is that Grimoire
> has updated doc strings and source code for things added to Clojure after
> version 1.3.0.
>
>  The examples you will see on ClojureDocs.org and Grimoire are currently
> the same, last I heard, but there is no automated synchronization between
> them.  It remains to be seen how things will progress from here, but I
> thought it would be nice to provide the option and let people decide what
> they want to use.  Please, please, no harsh words about what people besides
> yourself ought to do.
>
>  Andy Fingerhut
>  --
> 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.
>
>
>  --
> 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.
>



-- 
E: mark.man...@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/d/optout.


Re: [ANN] Grimoire: up to date Clojure web docs

2014-07-07 Thread Mark Mandel
Nice work! I've been using Grimoire all day :)

Two small suggestions, which you have probably thought of: (1) search  (2)
a copy of the clojure cheat sheet that points to grimoire instead. (Maybe
Grimoire needs it's own domain?)

CrossClj is *awesome* as well. I've been wanting something similar for a
looong time. Thanks!

Mark



On Tue, Jul 8, 2014 at 2:31 PM, Reid McKenzie  wrote:

>  I'm delighted to announce that thanks to the official Clojuredocs client (
> https://github.com/dakrone/clojuredocs-client) Grimoire now features
> every example posted on Clojuredocs.
>
> Ex.
> http://www.arrdem.com/grimoire/1.6.0/clojure.core/DASH__GT__GT/#example-0
>
> Currently at 0.0.13, which represents a slew of changes since the original
> announcement including the dropping of 1.5.1 as a documented version (it's
> a patch release, nothing changed from 1.5.0) and a major rework of the way
> I munge symbols and include examples between versions.
>
> I'd like to give Alex (puredanger) a huge shout out for handing me a SQL
> dump of the clojuredocs examples table right after I got a dakrone's client
> working.
>
> More tooling thanks to Phil (technomancy), lein's profiles enabled me to
> ditch a make target which downloaded old Clojure versions in favor of
> simply having one lein profile for each documented Clojure version.
>
>
> Reid
>
> On 07/07/2014 04:54 PM, cldwalker wrote:
>
> Hey Reid,
>
>  Nice work! I think this is a much more maintainable approach for a
> community-based examples repository.  Have you thought about seeding
> examples from clojuredocs using their api e.g.
> http://api.clojuredocs.org/examples/1.3.0/clojure.core/map? I think this
> would help if the goal is to become the canonical site for clojure fn
> examples.
>
>  It is worth noting that clojuredocs is undergoing a rewrite,
> https://github.com/zk/clojuredocs/tree/clj-rewrite. If this rewrite lands
> soon than it may be worth adding a Motivation section to the home page to
> distinguish it from clojuredocs.org.
>
>  On Tuesday, July 1, 2014 7:34:38 PM UTC-4, Reid McKenzie wrote:
>>
>> Hey guys,
>>
>> If you're like me while using clojure.repl/doc works for the most part
>> there are just times that you need to send someone a link to the
>> official docs and navigating the docstrings in the core Clojure
>> repository is a pain.
>>
>> After several months of being frustrated that clojuredocs is out of
>> date, I finally sat down and built an alternative which I'm pleased to
>> present here: http://www.arrdem.com/grimoire/
>>
>> Grimoire is still alpha and subject to change, especially with regards
>> to the example contribution process which needs streamlining beyond the
>> current "click a link, edit on github and submit a PR".
>>
>
>  I think this is a reasonable approach. It's better than having a login
> just for clojuredocs.
>
>
>>
>> I'd like to give a shout out to César for porting clojure.repl/source
>> into the doc generation script and to Nicola for his random usability
>> criticisms.
>>
>
>
>
> Cheers,
> Gabriel
>
>
>>
>> Reid McKenzie
>>
>  --
> 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.
>
>
>  --
> 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.
>



-- 
E: mark.man...@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 m

Re: Game logic with Clojure

2014-06-23 Thread Mark Mandel
If you are looking for another example, here is my pong clone with
play-clj, and my own Entity Component system, brute.
https://github.com/markmandel/brute-play-pong

I also use an atom that I reset! on each game loop. Because it's integrated
with play-clj (and therefore libgdx) there is a bit more mutable state in
there than normal.

Mark


On Tue, Jun 24, 2014 at 7:45 AM, James Reeves  wrote:

> I typically keep my state in an atom, and use swap! to update it. This
> means I can decouple rendering and other things from the actual game logic.
> However, depending on how your application functions, you might just be
> able to keep the state in a loop.
>
> - James
>
>
> On 23 June 2014 21:53, Majen Ful  wrote:
>
>> Thank you all !
>> @James, I confirm it is like Bang! (same editor), but I prefer this ;-)
>>
>> So in fact I don't have to have a state to update, instead, I just pass
>> my init state to functions/loops to get a new one.
>>
>> Le lundi 23 juin 2014 21:54:56 UTC+2, Majen Ful a écrit :
>>
>>> Hello all,
>>>
>>> First, thank you all for your contribution and your help. I just follow
>>> Clojure's news and groups, and I'm really impressed by how this community
>>> is pleasant and helpful.
>>>
>>> Well, I am new to Clojure world, I do programming as a hobby (I'm not
>>> pro) and I don't have advanced knowledges. However I really enjoy
>>> programming and I like games. In a "classic" language, as Ruby or Java, I
>>> can use mutable states and objects so it is "easy" to reason. In Clojure, I
>>> understand how immutability works, but I still miss some reflexes.
>>>
>>> My goal is to build a little card game like http://boardgamegeek.com/
>>> boardgame/128667/samurai-sword
>>> A lot of things to do, but I have some difficulties at beginning.
>>>
>>> For example, I can define cards, I can define some function (isdead,
>>> attack)... But how can I save the state of the game ? When a player attacks
>>> another player, the second player must have its life reduced. At this
>>> point, my OO reflexes are went back and don't find a solution.
>>>
>>> Could you give me some tips and lead me to the right things to do.
>>>
>>> Thanks by advance :-)
>>>
>>  --
>> 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.
>>
>
>  --
> 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.
>



-- 
E: mark.man...@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/d/optout.


Re: IntelliJ Cursive ClojureScript IDE slowdown

2014-06-21 Thread Mark Mandel
Yah, I noticed this as well. I figured it was something in the terminal
plugin.

Sent from my mobile doohickey
On 22/06/2014 3:13 PM, "Colin Fleming"  wrote:

> Hmm, thanks for the report - I'll take a look at this and see if I can
> figure out what's happening.
>
> One related question - how have you found the interaction between
> IntelliJ's automatic saving and 'cljsbuild auto'? Are you manually saving
> to trigger the compilation, or relying on the save on frame deactivation?
>
>
> On 22 June 2014 02:06, Mike Fikes  wrote:
>
>> Just sharing a tooling hint:
>>
>> If you are using IntelliJ / Cursive to edit ClojureScript (on a Mac at
>> least), opening a Terminal “pane” at the bottom of the IDE in order to run
>> `lein cljsbuild auto` is nice because you can readily see any errors or
>> warnings the ClojureScript compiler might emit.
>>
>> But… this ends up fairly quickly slowing down editing in IntelliJ to the
>> point where keystrokes feel “mushy” rather than “crisp.” A more dramatic
>> way to see this is to select some lengthy ClojureScript text and drag and
>> watch the selection UI updates follow behind the cursor.
>>
>> The simple fix: Instead run `lein cljsbuild auto` in an OS X Terminal
>> window.
>>
>> --
>> 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.
>>
>
>  --
> 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.
>

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


Runnable.com + Clojure

2014-06-03 Thread Mark Mandel
I got bored and set up a simple Clojure project to fork if they want on
Runnable.com

http://runnable.com/U46bKu4Y8pZgeAW9/clojure-%2B-leiningen-example

For some reason, the editor currently can't open .clj files, but that's
easy enough to work around with a text editor in the terminal.
(Bug:
http://support.runnable.com/runnable/topics/cant_open_clojure_files_in_the_editor
)

Thought some people might find it useful for sharing demo code around.

Mark

-- 
E: mark.man...@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/d/optout.


[ANN] brute 0.2.0 - A lightweight Entity Component System library for writing games

2014-05-12 Thread Mark Mandel
Brute is a simple and lightweight Entity Component System library for
writing games with Clojure.

This is a rewrite of Brute 0.1.1, to get rid of all the global internal
refs, and make it so that Brute simply passes around an immutable
collection.  This makes things far nicer to deal with, and makes the
library far more flexible.

Full Blog Post on changes:
http://www.compoundtheory.com/brute-entity-component-system-library-0-2-0-the-sequel/

The aim of this project was to use basic Clojure building blocks to form an
Entity System architecture, and get out of the author's way when deciding
exactly what approach would best fit their game when integrating with this
library.

To that end:


   - Entities are UUIDs.
   - The Component type system can be easily extended through a multimethod
   get-component-type, but defaults to using the component's instance class as
   its type.
   - Components can therefore be defrecords or deftypes by default, but
   could easily be maps or just about anything else.
   - Systems are simply references to functions of the format (fn [delta]).

Project can be found on Github at:
https://github.com/markmandel/brute

Sample Pong Game can be found on Github as well:
https://github.com/markmandel/brute-play-pong


-- 
E: mark.man...@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/d/optout.


Re: Unity 3d and Clojure

2014-04-28 Thread Mark Mandel
That's awesome. I'll be keeping an eye this project for sure.

Sent from my mobile doohickey
On 28/04/2014 4:51 PM, "Tims Gardner"  wrote:

> Hi Jacob, thanks for your interest! As Max said, this project is
> definitely still in the "mostly functional hack" phase, but it should be
> emerging from that in the next few weeks, and we'll keep the list posted as
> things develop.
>
> - Tims Gardner
>
> On Sun, Apr 27, 2014 at 6:15 PM, Max Kreminski wrote:
>
>> It looks like it's still in the "mostly functional hack" phase, and
>> there's not yet any documentation on how to set it up or what exactly can
>> be done with it, but there's a public GitHub 
>> repoyou can look at if you're 
>> feeling adventurous.
>>
>> --
>> 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.
>>
>
>  --
> 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.
>

-- 
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: Dealing with edn for the first time

2014-04-20 Thread Mark Mandel
I wrote a blog post a while back on working with EDN, which could be
helpful:
http://www.compoundtheory.com/clojure-edn-walkthrough/

>From there, fire up a REPL, load in clojure.edn, and start converting
vectors and maps to EDN and see what the format looks like :)

Mark


On Mon, Apr 21, 2014 at 2:21 AM, Mike Haney  wrote:

> Found the project I lifted my config code from, it's this one:
> https://github.com/bellkev/dacom
>
> Look through that, it should give you a good starting point.  If you still
> have questions, feel free to ask and we'll try to help.
>
> --
> 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.
>



-- 
E: mark.man...@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/d/optout.


Re: Light table

2014-04-16 Thread Mark Mandel
I use Cursive for my Clojure development and it's great! I'm a big fan.

Standard disclaimer: I was already firmly entrenched in Intellij beforehand.

Sent from my mobile doohickey
On 17/04/2014 11:12 AM, "Mark Engelberg"  wrote:

> On Wed, Apr 16, 2014 at 6:01 PM, Colin Fleming <
> colin.mailingl...@gmail.com> wrote:
>
>> Standard disclaimer: I develop Cursive.
>>
>>
> How's Cursive coming along? The website still says it's only for those who
> are "feeling brave".
>
> --
> 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.
>

-- 
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] brute 0.1.1 - A lightweight Entity Component System library for writing games

2014-04-14 Thread Mark Mandel
Great! Would love to have contributions!

Mark

On Tue, Apr 15, 2014 at 9:45 AM, Reid McKenzie wrote:

> Cool project! I just hammered out my own CES in the last few weeks for a
> private project, I'll be interested to see how they compare and whether
> there's anything I can add :D
>
> Reid
>




-- 
E: mark.man...@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/d/optout.


[ANN] brute 0.1.1 - A lightweight Entity Component System library for writing games

2014-04-14 Thread Mark Mandel
Heya!

First real Clojure library release, so exciting/scary stuff, but feedback
would very much be appreciated.

Brute is a a simple and lightweight Entity Component System library for
writing games with Clojure.

The aim of this project was to use basic Clojure building blocks to form an
Entity System architecture, and get out of the author's way when deciding
exactly what approach would best fit their game when integrating with this
library.

To that end:

   - Entities are UUIDs.
   - The Component type system can be easily extended through a multimethod
   get-component-type, but defaults to using the component's instance class as
   its type.
   - Components can therefore be defrecords or deftypes by default, but
   could easily be maps or just about anything else.
   - Systems are simply references to functions of the format (fn [delta]).

Project can be found on Github at:
https://github.com/markmandel/brute

Sample Pong Game can be found on Github as well:
https://github.com/markmandel/brute-play-pong

Blog post on the initial release:
http://www.compoundtheory.com/brute-entity-component-system-library-for-clojure/


-- 
E: mark.man...@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/d/optout.


Re: [ANN] - purnam 0.4.3 released - Javascript Language Extensions for Clojurescript

2014-03-02 Thread Mark Mandel
Awesome.

Glad to have this complete. I had some pending pull requests I wanted to
drop in.

Mark


On Sun, Mar 2, 2014 at 8:22 AM, zcaudate  wrote:

> I'm also looking for collaborators as it is getting to a stage where I'm
> having trouble managing it by myself.
>
>  if anybody is interested. Please send me a message
>
> Chris
>
> --
> 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.
>



-- 
E: mark.man...@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: core.async over websocket + cljs + clojure

2014-01-23 Thread Mark Mandel
I'm sure Plugh probably does similar things, but my "learning clojure app"
has my own custom RPC mechanism over websockets that I wrote (because it
was fun) that is all based around core.async and uses edn to transfer data
back and forth.

https://github.com/markmandel/chaperone

Server Side:
https://github.com/markmandel/chaperone/blob/master/src/chaperone/web/websocket.clj
https://github.com/markmandel/chaperone/blob/master/src/chaperone/web/rpc.clj

Client Side:
https://github.com/markmandel/chaperone/blob/master/src-cljs/chaperone/websocket.cljs

Hope that helps.  The project isn't hugely far along, but the RPC mechanism
works.

Mark


On Thu, Jan 23, 2014 at 6:55 PM, Sean Corfield  wrote:

> Ah, what good timing!
>
> David Pollak's project Plugh does this, essentially as an implementation
> detail. I spent some time with him today discussing this, as I want to use
> exactly this functionality in a project I'm building.
>
> The plan is for me to create a standalone project, based on the kernel of
> David's code, and enhance it to address a number of issues that he
> identified as needing work before the project could be used in production
> code, and then - hopefully - people will use it and provide additional
> integrations (such as core.async over a message hub to provide
> server-to-server operation, or core.async between browser client and server
> using more transmission methods than just web sockets).
>
> David's code addresses naming using a registry of channels, identified by
> GUIDs, on both sides. The web socket reconnection issue is one of the
> specific enhancements he identified that I plan to figure out and address.
> There are several others (including actually "GC'ing" closed channels on
> the other side of the address space divide).
>
> Sean
>
> On Jan 22, 2014, at 11:39 PM, t x  wrote:
>
> Hi,
>
>   I apologize for my vague question.
>
>   Does anyone have a good example / blog / library for using the
> core.async abstraction across a websocket.
>
>   * one side of the channel is in clojure land
>   * other side of the channel is in cljs land
>
>   * I promise that all messages can be encoded via pr-str and read via
> clojure.edn/read-string
>
>   What I'm struggling with are matters of:
>
>   * how to ensure data is not lost even when websocket disconects /
> reconnects
>
>   * "naming" on client/server side to ensure messages go to right channels
> on both sides
>
>   * issues I haven't even begun to imagine.
>
>   Good news:
>
>   * I control both sides: both the clj and cljs side, so any workable
> design is fine.
>
> Thanks!
>
> --
> --
> 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.
>
>
> Sean Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
>
> "Perfection is the enemy of the good."
> -- Gustave Flaubert, French realist novelist (1821-1880)
>
>
>
>


-- 
E: mark.man...@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: go "kill infinite loop"

2014-01-14 Thread Mark Mandel
On Wed, Jan 15, 2014 at 12:39 AM, Alex Miller  wrote:

> 2) Be careful using when using falsey tests like when or if - these will
> stop on nil but will also stop on false coming through the channel. Might
> be ok here, but it's something to be aware of.


Oooh! that is a really good point! I honestly didn't think of that.  In my
case, it won't but it's definitely something to consider.

Mark


-- 
E: mark.man...@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: go "kill infinite loop"

2014-01-13 Thread Mark Mandel
I found this macro I wrote really useful for exactly this type of thing:
https://github.com/markmandel/while-let

As long as you are happy for your go loop to stop when nil comes through
(i.e. when it gets closed).

(go (while-let [data ( wrote:

> Understood. Thanks for the clarification.
>
>
> On Mon, Jan 13, 2014 at 9:28 PM, Ben Mabey  wrote:
>
>> On Mon Jan 13 18:11:10 2014, t x wrote:
>>
>>> Consider the following code block:
>>>
>>>
>>> (defn make-stupid []
>>>   (go (loop []
>>> (recur
>>>
>>> (def x (make-stupid))
>>>
>>> ;; ... is there a way to kill this infinite go-loop ?
>>>
>>
>> No, you can not kill the loop with the go channel that is bound to x.
>>  You need to return a stop, a.k.a. poison, channel that the go block checks
>> before recurring. Something like:
>>
>> (let [stop (chan)]
>>  (go
>>   (loop []
>> (when (alt! stop false :default :keep-going)
>>   ...
>>   (recur
>>  stop)
>>
>> -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/groups/opt_out.
>>
>
>  --
> --
> 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.
>



-- 
E: mark.man...@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: How to handle configuration in Clojure?

2014-01-13 Thread Mark Mandel
+1 for environ as well.

I also have combined that with the Stuart Sierra reloaded workflow (started
it before Components, don't know if I want to switch).
http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded

Finding it a great fit, as it's easy to switch out environ variables in
your system map when testing very easily, as you pass it all around.

Mark


On Tue, Jan 14, 2014 at 8:57 AM, Christopher Allen wrote:

> Example here:
> https://github.com/bitemyapp/berossus/blob/master/src/berossus/rocks/your/data/config.clj
>
>
> On Monday, January 13, 2014 1:57:06 PM UTC-8, Christopher Allen wrote:
>>
>>
>> github.com/weavejester/environ/ + environment variables. 12-factor it
>> that way, proxy the environment variables via a config namespace so that
>> configuration values are programmatically generated in case something needs
>> to intervene.
>>
>> On Monday, January 13, 2014 5:50:54 AM UTC-8, James Trunk wrote:
>>>
>>> I've been investigating how to handle configuration in a Clojure
>>> application/library, and have discovered two main candidates: dynamics vars
>>> and argument passing.
>>>
>>> The downsides to dynamic vars seem to be: hiddenness, thread safety, and
>>> more complex tests (binding before each test).
>>>
>>> The downside to argument passing is noise in the code (especially when
>>> you're just passing the config through). Longer and more descriptive names
>>> for the config (i.e. not "ctx" or "cfg") make this noise even more painful.
>>>
>>> Are there any alternatives that I've missed? What is the current best
>>> practice for handling configuration?
>>>
>>> Cheers,
>>> James
>>>
>>  --
> --
> 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.
>



-- 
E: mark.man...@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: How do I serve clojure pages with nginx

2013-12-28 Thread Mark Mandel
I have found in the past I needed to  reload-configuration of initctl.
Maybe try that?

Mark

Sent from my mobile doohickey
On 29/12/2013 9:14 AM, "James Reeves"  wrote:

> The script I included in my example assumes that there is a "deploy" user
> that owns the "/deploy" directory and everything in it.
>
> - James
>
>
> On 28 December 2013 19:18, Ahmet Zeynel  wrote:
>
>> Earlier I changed the permissions in /deploy but now I put it back to
>> root and now I have:
>>
>> z@ubuntu:/deploy$ ll
>> total 8164
>>  drwxr-xr-x  2 root root4096 Dec 27 08:20 ./
>> drwxr-xr-x 24 root root4096 Dec 27 08:09 ../
>>  -rw-r--r--  1 root root 8351715 Dec 27 08:20
>> my-webapp-0.1.0-standalone.jar
>>
>> and now when try to start as root I get this:
>>
>> root@ubuntu:/deploy# start nomilkforme
>>  start: Job failed to start
>>
>>
>> On Sat, Dec 28, 2013 at 1:16 PM, James Reeves wrote:
>>
>>> Upstart gives you useful tools like respawning failed services, log
>>> rotation, and starting on server boot.
>>>
>>> Have you checked the logs in /var/log/upstart/nomilkforme.log? Perhaps
>>> it's got something to do with the permissions of the deploy directory.
>>>
>>> - James
>>>
>>>
>>> On 28 December 2013 17:08, Zeynel  wrote:
>>>
 I tried it like this and it seems to work:

 z@ubuntu:/etc/nginx/sites-available$ export PORT=4000
 z@ubuntu:/etc/nginx/sites-available$ java -jar
 /deploy/my-webapp-0.1.0-standalone.jar
 2013-12-28 11:58:16.307:INFO:oejs.Server:jetty-7.x.y-SNAPSHOT
 2013-12-28 11:58:16.409:INFO:oejs.AbstractConnector:Started
 SelectChannelConnector@0.0.0.0:4000

 What's wrong with deploying it like this?

 On Saturday, December 28, 2013 10:53:29 AM UTC-4, Zeynel wrote:
>
> Can I deploy this as explained here http://www.luminusweb.net/
> docs/deployment.md#running_standalone with
>
>
>
>
> java -jar myapp-0.1.0-SNAPSHOT-standalone.jar
>
>
> On Wednesday, December 25, 2013 10:06:58 AM UTC-4, James Reeves wrote:
>>
>> I currently serve a web app on a Ubuntu server. Here's the
>> configuration I use:
>>
>> In "/etc/nginx/sites-available/":
>>
>> server {
>> listen 80;
>>
>> location / {
>> proxy_set_header  X-Real-IP$remote_addr;
>> proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
>> proxy_set_header  Host $http_host;
>> proxy_redirectoff;
>>  proxy_passhttp://127.0.0.1:4000;
>> }
>>  }
>>
>>
>> Then I enable this configuration by adding a symbolic link:
>>
>> cd /etc/nginx/sites-enabled
>> ln -s  ../sites-available/
>>
>>
>> Then I create an upstart job to run the server in
>> "/etc/init/.conf:
>>
>> description ""
>> author ""
>>
>> start on startup
>> stop on shutdown
>>
>> setuid deploy
>> chdir /deploy
>> console log
>>
>> env PORT=4000
>> exec java -jar .jar
>>
>>
>> The jar file I place in "/deploy", a directory I've added in at the
>> top level.
>>
>> If all goes according to plan, then I can reload nginx and start my
>> server:
>>
>> reload nginx
>>
>> start 
>>
>>
>> Hope that helps.
>>
>> - James
>>
>>
>>
>> On 25 December 2013 11:42, Zeynel  wrote:
>>
>>> Ok, I worked through the tutorial referenced http://clojure-doc.
>>> org/articles/tutorials/basic_web_development.html#build-and-run-itand I 
>>> created a jar file and ran it with $ java -jar -my-webapp.jar. This
>>> works. But my understanding is that this is would not work for 
>>> production.
>>> I need to use nginx as proxy to jetty (or immutant?). I am trying to 
>>> figure
>>> out the correct configuration for jetty and nginx. Each tutorial 
>>> appears to
>>> be different and so far I couldn't make it work.
>>>
>>>
>>> On Friday, December 20, 2013 9:39:07 AM UTC-4, David Della Costa
>>> wrote:
>>>
 Hi Zeynel,

 I don't know if setting things up the way I've laid out there is
 such a
 great idea.  What I would do instead is set the port and whatnot in
 the
 jetty configuration inside of ring, assuming that's what you're
 using
 (this assumes a lot about how your app is set up, so let me know if
 this
 doesn't match your setup):

 http://ring-clojure.github.io/ring/ring.adapter.jetty.html

 Then, I would compile an uberjar with lein, like so:

 $ lein uberjar

 In your startup script, as Curtis laid out, call the jar file using
 something like:

 /path/to/java -jar /path/to/uberjar

 That will be much simpler than what I have in my tutorial...which I
 should really 

Re: [ClojureScript] ANN: ClojureScript 0.0-2075

2013-11-24 Thread Mark Mandel
I just upgraded from 0.0-2030

And now when I run lein-cljsbuild, I keep getting the error:
Compiling "resources/public/js/main.js" from ["src-cljs"]...
Compiling "resources/public/js/main.js" failed.
java.lang.AssertionError: Assert failed: :output-dir
"/home/mark/workspace/chaperone/target/cljsbuild-compiler-0" must specify a
directory in :output-to's parent
"/home/mark/workspace/chaperone/resources/public/js" if optimization
setting applied
(same-or-subdirectory-of? (absolute-parent output-to) output-dir)

Full stack: http://pastebin.com/aBbpg54b

Reverting to 2030 stops this issue.

Does this look like a bug? "/home/mark/workspace/chaperone" seems to be the
common parent directory here, no?

Mark


On Sun, Nov 24, 2013 at 3:27 AM, Mimmo Cosenza wrote:

> unrestrainable :-)
> thanks!
>
> On Nov 23, 2013, at 4:04 PM, David Nolen  wrote:
>
> Just pushed out 0.0-2080, fixes a regression around inference and adds
> unsigned-bit-shift-right to keep in sync with the Clojure 1.6 alphas.
>
> David
>
>
> On Fri, Nov 22, 2013 at 7:44 PM, David Nolen wrote:
>
>> Following the last announcement, the only significant changes are
>> CLJS-681 which is Windows source map support and improved numeric checks.
>>
>> David
>>
>
>
> --
> Note that posts from new members are moderated - please be patient with
> your first post.
> ---
> You received this message because you are subscribed to the Google Groups
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.
>
>
>


-- 
E: mark.man...@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: How to interrupt execution and open a debugger/REPL?

2013-11-12 Thread Mark Mandel
Gah! Thank you, thank you, thank you.

That was one thing I was dying for in Clojure (coming from Pry in Ruby).

That just made my day.

Mark


On Wed, Nov 13, 2013 at 1:56 PM, Jason Gilman  wrote:

> The debug-repl library (https://github.com/georgejahad/debug-repl) is
> what you want. I believe the macros from Joy of Clojure are based on it if
> I remember correctly. I just used it earlier this week on a project so I
> know it works. Let me know if you can't get it working and I can provide
> assistance.
>
> --
> --
> 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.
>



-- 
E: mark.man...@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: Testing with Angular.js, Clojurescript and Purnam - Code and Part 1

2013-11-05 Thread Mark Mandel
This is actually really relevant to me - I'm *just* about to start writing
angular tests with purnam.test.angular.

Thanks!

Mark


On Tue, Nov 5, 2013 at 9:56 PM, Chris Zheng  wrote:

> I'm sorry ;-)
>
> but I've written that many clojure macros for this library that i think
> the post is still relevant =)
>
>
> On 05/11/2013, at 9:39 PM, Josh Kamau  wrote:
>
> zcaudate,
> You realize you have posted on a clojure mailing list??
>
>
> On Tue, Nov 5, 2013 at 1:31 PM, zcaudate  wrote:
>
>> Code:  https://github.com/zcaudate/purnam-angular-example
>> Demo: http://docs.caudate.me/purnam-angular-example/
>> Article: http://z.caudate.me/purnam-angular-js-testing-part-1-services/
>>
>> 
>>
>> Even with the karma  test runner,
>> testing in angularjs is painful. It's one thing to be able to write a
>> *angular.js*controller, its another to be able to test them. Making it
>> more difficult is the sheer complexity of the framework. There are
>> different strategies of testing controllers, directives, filters and
>> injectables (values, services, factories and providers)
>>
>> There are two excellent articles about testing in angular.js by Year of
>> Moo. 
>> Here
>>  and 
>> Here.
>> However, my eyes start hurting when I look at the test code. It is modular,
>> it is brilliantly thought out, it is *very* complete... but it is
>> seriously hard to get my head around. An example of controller testing can
>> be found 
>> here
>>
>> It took me about a couple of days to summon up the courage to even
>> attempt to read the code. Then I realised that the tests weren't doing that
>> much at all. Most of it was boilerplate and not that interesting. Out of
>> about 5 lines of test code, something interesting only happened in one of
>> them. I abstracted out all the angular.js testing code into 
>> macros
>> .
>>
>> The point I've been making on previous 
>> post is
>> that clojurescript rocks if we really embrace javascript libraries through
>> macros. With macros for *angular.js*, working with angular.js is so much
>> clearer than in javascript.
>>
>> I have put together an example 
>> project that
>> shows how one may go about doing a simple app with tests. I'm going to take
>> a couple of posts to explain how purnam.angular, purnam.test and
>> purnam.test.angular work 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/groups/opt_out.
>>
>
>
> --
> --
> 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 a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/qbr4DRJp1SI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> clojure+unsubscr...@googlegroups.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>  --
> --
> 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 i

Re: clojars.org image for latest version of a project

2013-10-10 Thread Mark Mandel
Thanks for that recommendation! I was thinking about this exactly this
issue.

Mark


On Fri, Oct 11, 2013 at 10:19 AM, Karsten Schmidt  wrote:

> On 11 October 2013 00:01, Adam Clements  wrote:
> > I find it ridiculously useful not having to go to my browser to look up
> the
> > latest version of libraries I use all the time.
>
> Adam, you might want to check out this leiningen plugin then...
> https://github.com/xsc/lein-ancient
>
> K.
>
> --
> --
> 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.
>



-- 
E: mark.man...@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.


Separate Leiningen Profile for ClojureScript compilation?

2013-09-29 Thread Mark Mandel
Just wondering if this is a common thing or not, or if it was just me.

For the full project file in question, is here:
https://github.com/markmandel/chaperone/blob/master/project.clj#L29-L46

I found that when trying to compile my clojurescript with lein-cljsbuild,
it would error out, as the dieter library was looking for a v8 native
dependency (in the wrong spot).

To combat this, I ended up writing a "cljs" profile, specifically for
compiling my clojurescript, like so:

:profiles {
...
   :cljs{:dependencies [[org.clojure/clojurescript "0.0-1889"]
[purnam "0.1.0-beta"]]
 :exclusions   [dieter http-kit compojure selmer environ]
 :plugins  [[lein-cljsbuild "0.3.3"]]
 :cljsbuild{ ... }
}

... and basically excluded anything that wasn't specific to the
clojurescript, and could therefore build my clojurescript like so: `lein
with-profile cljs cljsbuild auto`
and all was well with the world.

Is there a better way to do this? Or is this a common thing?

Do people take it as far as having separate profiles for server and client
side?

I'm quite new to clojure, so not quite sure what the best way forward is
here (although this was does seem to work just fine).

Any thoughts are appreciated.

Mark


-- 
E: mark.man...@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] Introducing VDD Core - Visualization Driven Development in Clojure

2013-09-10 Thread Mark Mandel
Thanks for posting this - at first glance it looks very cool :)

See you at Strangeloop - I've been looking forward to this talk :)

Mark


On Wed, Sep 11, 2013 at 10:13 AM, Jason Gilman wrote:

> I've just released a new open source tool, VDD Core, to help enable
> Visualization Driven Development in Clojure. Visualization Driven
> Development and VDD Core are the subject of my Strange Loop talk (
> https://thestrangeloop.com/sessions/visualization-driven-development)
> next week. VDD Core's goal is to make it easy to capture and send data to
> be visualized in a web browser. This is an early alpha release. I hoping to
> get others interested and testing it out.
>
> You can read more about VDD Core and Visualization Driven Development at
> the following places:
>
>   * Blog Announcement: http://www.element84.com/announcing-vdd-core.html
>   * Github Page: https://github.com/Element84/vdd-core
>   * Wiki: https://github.com/Element84/vdd-core/wiki
>   * Example Project: https://github.com/Element84/vdd-core-examples
>
>
> Thanks,
> Jason Gilman
>
> --
> --
> 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.
>



-- 
E: mark.man...@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: Best way to pass through named arguments (destructured map)?

2013-09-09 Thread Mark Mandel
I like that mapcat solution a lot. Very nice.

For some reason I can't get the destructuring to work... clearly missing
something there.

But fair point on the flatten - I had a play with it, and I can clearly see
the issue.

Thanks for the extra help.

Mark


On Tue, Sep 10, 2013 at 2:17 PM, Matt Mitchell  wrote:

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

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

2013-09-09 Thread Mark Mandel
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  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) 
> 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 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.
>>
>
>
>
> --
> E: mark.man...@gmail.com
> T: http://www.twitter.com/neurotic
> W: www.compoundtheory.com
>
> 2 Devs from Down Under Podcast
> http://www.2ddu.com/
>



-- 
E: mark.man...@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: Best way to pass through named arguments (destructured map)?

2013-09-09 Thread Mark Mandel
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) 
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 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.
>



-- 
E: mark.man...@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.


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

2013-09-09 Thread Mark Mandel
Hey all,

Relatively new to Clojure, and I'm wondering if there is a better/simpler 
way to handle what I'm doing.

I'm working with the Elastisch library for interacting with ElasticSearch, 
and it has the following function:
http://reference.clojureelasticsearch.info/clojurewerkz.elastisch.rest.document.html#var-search

(search index mapping-type & {:as options})

That's all fine, except I want to call it from another function, to provide 
my default values for `index`, but still allow for the passthrough the 
options map for the `search` function.

The solution I came up with was:

(defn search
"Search the mapping-type, with the given properties"
[mapping-type & {:as options}]
(apply esd/search (reduce (fn [coll [k, v]] (conj coll k v)) [es-index 
mapping-type] options)))

Where `es-index` is already defined as a global def.

So basically I break the options apart into a vector, and apply it over the 
top of the esd/search function (where esd is the elastisch function defined 
earlier).

Does this make sense? Is there a better way?

It works, but wondering if there is an improvement I could make, especially 
as I could see myself doing this quite often.

Thanks in advance,

Mark


-- 
-- 
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: Interest in a commercial IDE for Clojure?

2013-08-24 Thread Mark Mandel
I'd be keen on this too - but probably more as a plugin than a standalone
IDE (a'la WebStorm, RubyMine, etc).  I already have a licence for IntelliJ,
so would be wanting to have a better plugin than La Clojure.

I just started trying to work out my workflow with IntelliJ and Clojure,
and found it kinda painful in places, so any improvement there I'd love to
have, and I'd be happy to pay for it too.

Very interested to see what you have. Any chance for a video teaser? ;)

If you are looking for alpha/beta testers ;) I'm sure there are a few of us
willing to put our hands up.

Mark


On Sun, Aug 25, 2013 at 12:42 AM, Francesco Bellomi <
francesco.bell...@gmail.com> wrote:

> I agree with Matt that a commercial plugin for IntelliJ would be mainly
> targeted at people already using and preferring IntellJ, but this could be
> an interesting market.
>
> As a personal note, I have tried CCW and found it a beautiful piece of
> software, but the fact is that I simply prefer IntelliJ over Eclipse for
> many big and small reasons.
> It would be very difficult for me to leave IntelliJ, even if the current
> version of La Clojure has a lot of problems.
> I suspect that there is a sort of "rigid" demand for plugins for each of
> the major IDEs, simply because of the investments people have put into them.
>
> I would be willing to pay a price in the suggested range even to access
> the current alpha/beta version of the plugin, if it's better than the
> current La Clojure build. Colin, if you are open and interested to this
> kind of proposal you may contact me privately at francesco.bellomi(at)gmail.
>
> In any case, I wish you good luck with this project
>
> Francesco
>
> On Sunday, July 28, 2013 11:07:18 PM UTC+2, matt hoffman wrote:
>>
>> I've been watching your fork on Github for a while -- I've been excited
>> to see that someone is actively working on La Clojure. I would pay for an
>> IntelliJ plugin that was significantly better than La Clojure, but I'm also
>> aware that I'd be paying just for my preference of IntelliJ over Eclipse
>> for mixed Java/Clojure development. For pure Clojure development, Emacs
>> would also be a contender. So that would be a really tough market.
>> It would be a tough sell for my company, as well. They pay for IntelliJ
>> Ultimate licenses, and if we told them we wanted to add in $200 more for a
>> Clojure plugin, I'd have to be prepared to re-open the "just use Eclipse"
>> argument.
>>
>> I'd also contribute to a Kickstarter, if you decided to go that route. I
>> don't imagine you could make a living off of it that way, but you might be
>> able to recoup some of your time.  A couple of developers in my company
>> have talked about funding a bounty for nrepl integration alone.
>>
>>
>>
>> On Sat, Jul 27, 2013 at 3:20 PM, kovas boguta wrote:
>>
>>> My suggestion: release as open source, and then try a kickstarter to see
>>> if there is interest in extending/continuing the project.
>>>
>>> IDE is a tough business. It has broken many. After all there is a reason
>>> intellij open-sourced the core in the first place.
>>>
>>> Frankly I think there is a bigger market in using clojure to develop
>>> better tools for other languages. If you have a nice intellij wrapper, then
>>> you have a huge advantage in developing tooling in general.
>>>
>>> On a side note, I would love to see intellij's widget library broken out
>>> in a more stand-alone way, so we can develop sexy clojure apps with pure
>>> jvm technology. Any thoughts on if that is technically doable?
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Sat, Jul 27, 2013 at 4:54 AM, Colin Fleming wrote:
>>>
 Hi all,

 I was planning to wait a little longer before going public, but since
 it's pretty relevant to the other IntelliJ thread going on at the moment I
 thought I'd jump in. For the last couple of months of happy unemployment
 I've been working on a fork of La Clojure which is now about 70% migrated
 to Clojure and significantly improved. It's a lot of work to develop a tool
 like this, and one of the options I'm considering is starting a company to
 develop it as a commercial product - JetBrains have never maintained
 development of La Clojure very actively. I've been doing a little market
 research but there's really not much data around about whether there are
 enough people working with Clojure to sustain a product like that, and also
 the community is currently very focused on open source.

 One problem is that the IDE space is already fairly fractured - there's
 Emacs and CCW, Clooj, Sublime Text and the promise of Light Table at some
 point, and of course the current public version of La Clojure. But there's
 still not a great option for something that's powerful but easy to use -
 CCW is probably the closest thing to this right now. However I think it's
 telling that a large fraction of people in the State of Clojure 2012 survey
 still identified developm

Re: Current state of the art in Web deployment?

2013-08-17 Thread Mark Mandel
On Sun, Aug 18, 2013 at 6:52 AM, John Jacobsen wrote:

> After some prototyping and development, we are now getting to the stage
> where "lein run" and a Jetty server running from -main aren't going to cut
> it.


At the risk of asking a dumb question, but being quite new to Clojure, I
don't mind - why do you say they won't cut it?

Mark


-- 
E: mark.man...@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.