Re: ANN: ClojureScript 0.0-1877 (Breaking change)

2013-09-26 Thread Ruslan Prokopchuk
I can't get core.async working with 0.0-1877+: nothing is executed in go block 
without any warnings and errors. When I use 0.0-1859 everything goes fine. 
(I've surely done lein cljsbuild clean)

-- 
-- 
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: Typedef-like functionality for Clojure records?

2013-09-26 Thread david sheldrick
I'm not sure about your actual questions, but you should note that `foo` is 
not actually a var which you can reference like `some-ns/foo`. Rather, it 
is a Class. Consider:

user=> (defrecord Thing [a b])
user.Thing
user=> 

user=> (def OtherThing Thing)
#'user/OtherThing
user=> 

user=> (Thing. "hello" "sir")
#user.Thing{:a "hello", :b "sir"}
user=> 

user=> (OtherThing. "hello" "sir")
CompilerException java.lang.IllegalArgumentException: Unable to resolve 
classname: OtherThing, 
compiling:(/private/var/folders/rz/2h_qlr5d2m7dts2xpshlz_nr000c_x/T/form-init123235568201547659.clj:1:1)
 

So you might be wise to put another layer of abstraction in there if you 
need to alias the class in addition to it's constructor functions.

On Thursday, 26 September 2013 06:47:35 UTC+1, Vincent Chen wrote:
>
> Hi, 
>
> I have in my hands an XML description of data structures that I want 
> to mechanically translate into Clojure. There are  and 
>  elements, with  being similar to structs in C (list 
> of fields) and  being similar to typedef in C (defining new 
> name for already defined s). 
>
> I model s using Clojure records, but I'm not sure how to refer 
> to them with a new name when it comes to s. Given the 
> following specification: 
>
>  
>
>
>  
>
>  
>
> I would create records: 
>
> (defrecord foo [a b]) 
> (defrecord bar [a b]) 
>
> The problem is that struct foo and typedef bar lives in different 
> namespaces, i.e. I don't have foo's specification when I encounter 
> typedef bar. What I'd like to do is (def bar some-ns/foo), but what 
> about ->foo and map->foo? 
>
> So should I: 
> - (def bar some-ns/foo) (def ->bar some-ns/->foo) (def map->bar 
> some-ns/map->foo), while hoping that Clojure doesn't extend records 
> syntax/capabilities in the future? 
> - Use something else than records to model structs (suggestions welcome)? 
> - Other? 
>
> Thanks, 
>
> Vincent 
>

-- 
-- 
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: Typedef-like functionality for Clojure records?

2013-09-26 Thread Marshall Bockrath-Vandegrift
Vincent Chen  writes:

> - Use something else than records to model structs (suggestions welcome)?

Maps.

Records have concrete Java types, which allows them to implement
interfaces and participate in protocols.  Fields defined on a record
type are backed by JVM object fields, which can increase performance.
But there are no strictness benefits – a record may have any number of
additional keys associated to values:

(defrecord Foo [bar])
;;=> user.Foo
(map->Foo {:bar 1, :baz 2})
;;=> #user.Foo{:bar 1, :baz 2}
(class (map->Foo {:bar 1, :baz 2}))
;;=> user.Foo

So my suggestion would be to instead turn your `struct` definitions into
functions validating that the expected fields are present within plain
maps.  (Assuming some sort of strictness/validation is the goal.)

-Marshall

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


Question about using extend-type and multiple implementations of the same protocol on nil.

2013-09-26 Thread Dustin Conrad
I am pretty new to Clojure, so what I am trying to do may make no sense.  I 
am completely open to alternative ways to get similar functionality

I have a Heap protocol and two records that implement that protocol:

(defprotocol Heap
  (min [this]
  (insert [this x]))

In heap1.clj
(defrecord Heap1 [n]
  (min [this] (comment do stuff))
  (insert [this x] (comment insert stuff)))

In heap2.clj
(defrecord Heap2 [n]
  (min [this] (comment do some different stuff))
  (insert [this x] (comment insert stuff in a different way))

I found it useful to use extend-type to define this protocol on nil as well.

In heap1.clj
(extend-type nil
  Heap
  (min [this] (throw (Exception.))
  (insert [this x] (->Heap1 x)

This is all still working.  In heap2.clj I would like to define another 
implementation of heap on nil, for when I require/use heap2.clj .
In heap2.clj
(extend-type nil
  Heap
  (min [this] (throw (Exception.))
  (insert [this x] (->Heap2 x)

Now, in the tests for heap1.clj where I am not requiring the heap2 
namespace (or even know about it), my tests are failing because (insert nil 
1) now returns a heap2 record.  At this point I decided I obviously did not 
understand what extend-type actually does, and tried to do a bit of 
research, but I couldn't really find anything that went very in-depth.

If someone could provide an alternative to what I am trying to do, that 
would be great.  Alternatively, it would be useful for someone to explain 
what extend-type does under the covers a bit.



-- 
-- 
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: Question about using extend-type and multiple implementations of the same protocol on nil.

2013-09-26 Thread Jim

On 26/09/13 13:10, Dustin Conrad wrote:

(defprotocol Heap
  (min [this]
  (insert [this x]))

In heap1.clj
(defrecord Heap1 [n]
  (min [this] (comment do stuff))
  (insert [this x] (comment insert stuff)))

In heap2.clj
(defrecord Heap2 [n]
  (min [this] (comment do some different stuff))
  (insert [this x] (comment insert stuff in a different way))


your records don't implement the protocol...are you sure this compiles?

It should be :

(defrecord Heap1 [n]
some-ns/Heap
  (min [this] (comment do stuff))
  (insert [this x] (comment insert stuff)))

Jim

--
--
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: Question about using extend-type and multiple implementations of the same protocol on nil.

2013-09-26 Thread Jim

On 26/09/13 13:10, Dustin Conrad wrote:
Now, in the tests for heap1.clj where I am not requiring the heap2 
namespace (or even know about it), my tests are failing because 
(insert nil 1) now returns a heap2 record.


how is that possible? How does a namespace x returns a concrete object 
from some other ns y which however hasn't been linked/required/used? 
this is impossible is't it?


Jim

--
--
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: Question about using extend-type and multiple implementations of the same protocol on nil.

2013-09-26 Thread Jim
protocol extensions are applied on a per-namespace basis. What you 
describe shouldn't happen...it sounds to me that your tests for 
heap1.clj somehow knows about the heap2.clj, otherwise
 it wouldn't be possible to return an object from that namespace. In 
fact, if you do a


lein test someNS.heap1

the protocol extensions for heap2.lj shouldn't run, unless there is a 
dependency somewhere.


HTH,
Jim


On 26/09/13 13:10, Dustin Conrad wrote:
I am pretty new to Clojure, so what I am trying to do may make no 
sense.  I am completely open to alternative ways to get similar 
functionality


I have a Heap protocol and two records that implement that protocol:

(defprotocol Heap
  (min [this]
  (insert [this x]))

In heap1.clj
(defrecord Heap1 [n]
  (min [this] (comment do stuff))
  (insert [this x] (comment insert stuff)))

In heap2.clj
(defrecord Heap2 [n]
  (min [this] (comment do some different stuff))
  (insert [this x] (comment insert stuff in a different way))

I found it useful to use extend-type to define this protocol on nil as 
well.


In heap1.clj
(extend-type nil
  Heap
  (min [this] (throw (Exception.))
  (insert [this x] (->Heap1 x)

This is all still working.  In heap2.clj I would like to define 
another implementation of heap on nil, for when I require/use heap2.clj .

In heap2.clj
(extend-type nil
  Heap
  (min [this] (throw (Exception.))
  (insert [this x] (->Heap2 x)

Now, in the tests for heap1.clj where I am not requiring the heap2 
namespace (or even know about it), my tests are failing because 
(insert nil 1) now returns a heap2 record.  At this point I decided I 
obviously did not understand what extend-type actually does, and tried 
to do a bit of research, but I couldn't really find anything that went 
very in-depth.


If someone could provide an alternative to what I am trying to do, 
that would be great.  Alternatively, it would be useful for someone to 
explain what extend-type does under the covers a bit.




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


[ANN] es-nozzle 0.3.0 - elasticsearch document ingestion

2013-09-26 Thread Ralf Schmitt
{ es-nozzle is not a clojure library. But es-nozzle is implemented and
extendable in clojure. That's why I'm posting it here, read on! }

Hi all,

on behalf of brainbot technologies AG I'm proud to release es-nozzle
0.3.0 as open source today. This is the first public release.

es-nozzle is a scalable open source framework for connecting source
content repositories like file systems or mail servers to
ElasticSearch clusters.

The framework supports source-repository security policies in
ElasticsSearch and therefore enables users to create open source
Enterprise Search solutions based on es-nozzle and ElasticSearch.

The architecture allows for scalable and fault tolerant
synchronization setups that complement the scalability of
ElasticSearch clusters.

Professional development and production support is available through
brainbot technologies AG, a company specialized in search solutions
which created the framework.


Links
===
documentation:
  http://brainbot.com/es-nozzle/doc/

prebuilt distribution:
  http://brainbot.com/es-nozzle/download/es-nozzle-0.3.0.zip

source code:
  https://github.com/brainbot-com/es-nozzle

Contact:
  http://brainbot.com / es-noz...@brainbot.com
  (or use the elasticsearch mailing list)

We're excited to get feedback about this release, so please give it a
shot and let us know about your experience.

-- 
Cheers
Ralf Schmitt

-- 
-- 
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] clara-rules 0.1.0 released -- rules as a control structure

2013-09-26 Thread Ryan Brush
Not yet, although I would like to make use of simple maps natural. I had
been toying with the idea of typing into the :type metadata that could be
attached to a map, allowing expressions like:

(defrule test-rule
   [:example/person-map-type (= "Alice" (:first-name this))]
   =>
   (println "Hello, Alice!"))

That way any map with that type annotation could be used in the rule. Today
Clara does automatically bind "this" as a reference to the matched object,
so functions can be called against it. (I'm not particularly thrilled by
the implicit binding of "this", but it is common in rules engines so I
included it here.)

The advantage of records is they have a pre-defined type and pre-defined
fields, so they are a natural alternative to facts and slots seen in other
production systems. But since simple maps are so common in Clojure code I
do want to incorporate them here, either by tapping into the type metadata
as seen in the above example, or by doing something akin to how
multimethods work, where the fact "type" is effectively defined by a
function.

I'd love to hear suggestions on this one. The goal is to get the advantages
of a production system in a way that feels natural to Clojure developers.
What would feel most natural to members of this group?

On Wednesday, September 25, 2013, zcaudate wrote:

> Hi Ryan!
>
> Great work. Can normal clojure maps can be used instead of records?
>
> --
> --
> 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/pfeFyZkoRdU/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 it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Question about using extend-type and multiple implementations of the same protocol on nil.

2013-09-26 Thread Marshall Bockrath-Vandegrift
Dustin Conrad  writes:

> Now, in the tests for heap1.clj where I am not requiring the heap2
> namespace (or even know about it), my tests are failing because
> (insert nil 1) now returns a heap2 record.

Different namespaces aren’t isolated from one another.  There is a
single global “namespace of namespaces,” you could say.  The tests for
the `heap1` namespace may not have `require`d the `heap2` namespace, but
e.g. under the normal Leiningen clojure.test test runner, they will both
end up being loaded in the same process.  Namespaces provide a way to
prevent collisions between names, but all references to the same
fully-qualified name refer to the same object identity.

> At this point I decided I obviously did not understand what
> extend-type actually does, and tried to do a bit of research, but I
> couldn't really find anything that went very in-depth.

The `extend-type` form mutates the collection of implementations for one
or more protocol to include implementations for the extended type,
replacing any existing implementations for that type.  Because the
protocols themselves are extended, all such extensions are globally
visible to all users of the protocol.

> If someone could provide an alternative to what I am trying to do,
> that would be great. Alternatively, it would be useful for someone to
> explain what extend-type does under the covers a bit.

It’s not entirely clear what you’re trying to do, but one approach would
be for each namespace to have separate nil-heap `reify`-cations of the
`Heap` protocol.  All local invocations of heap protocol functions would
then go through proxy functions which would replace `nil` with the local
nil-heap implementation.

-- 
Marshall Bockrath-Vandegrift 
Damballa Staff Software Engineer | 518.859.4559m

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


Emacs font and theme for clojure

2013-09-26 Thread Murtaza Husain
Hi,

I was just cycling through the different themes in emacs. I was wondering 
what font and theme combination others are using ? Any recommendations for 
mac pro retina ? 

I like the solarized-dark theme, however the default font doesnt seem very 
good with it. 

Thanks,
Murtaza 

-- 
-- 
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: Nightcode questions

2013-09-26 Thread Zach Oakes
Hi, thanks for trying it out. In the future, you are welcome to post a 
question on reddit.com/r/Nightcode or email me directly, since these 
questions pertain specifically to Nightcode rather than Clojure per se.

As for encoding, it currently defaults to your system encoding, but I just 
pushed a change to use UTF-8, so if you could clone the repo and try it out 
I would appreciate it. The shortcuts and paredit commands should definitely 
be working. The latter are invoked via the Alt key. Please try that and let 
me know if it works. It would be helpful to know what OS you are using as 
well.

To answer your question you posted in another thread, I'm aware of the 
highlighting bug (I actually created the Github issue that originally 
reported it). It's been fixed, but only about a week ago so it is 
definitely not in RSyntaxTextArea 2.5.0.

Zach

On Thursday, September 26, 2013 1:42:03 AM UTC-4, adrians wrote:
>
> Hi Zach,
>
> After trying various multi-key combinations in order to invoke some 
> paredit commands, I ended up so that typing Ctrl+anything would insert odd, 
> non alphanumeric characters into the edior (I'm using a US keyboard, btw). 
> Even basics like ctrl-z, ctrl-s wouldn't do the right thing. Are you using 
> the default encoding or setting it to anything specific in the text editor? 
> Could you make this customizable? I had similar issues in Eclipse until I 
> set the container encoding to UTF-8 so that new editors would use that. I'd 
> also like to know what happens with existing files that have a specific 
> encoding as far as any default conversion being applied. Can you give any 
> details?
>
> Another thing I'm not clear on, are all the shortcuts supposed to be 
> working at this point? I see (by pressing ctrl) that the toggle for the 
> paredit switch is shift-P, so I guess ctrl-shift-P should toggle that 
> toolbar button, but it doesn't, for me. If I turn on paredit mode using the 
> mouse, how do I invoke commands? Is this working yet?
>
> Thanks for adding clarity to my fumbling around.
>
> -- Adrian
>

-- 
-- 
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: Emacs font and theme for clojure

2013-09-26 Thread Baishampayan Ghose
I use Source Code Pro[1] with tomorrow-theme[2]. ~BG

[1] http://blogs.adobe.com/typblography/2012/09/source-code-pro.html
[2] https://github.com/chriskempson/tomorrow-theme

On Thu, Sep 26, 2013 at 8:21 PM, Murtaza Husain
 wrote:
> Hi,
>
> I was just cycling through the different themes in emacs. I was wondering
> what font and theme combination others are using ? Any recommendations for
> mac pro retina ?
>
> I like the solarized-dark theme, however the default font doesnt seem very
> good with it.
>
> Thanks,
> Murtaza
>
> --
> --
> 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.



-- 
Baishampayan Ghose
b.ghose at gmail.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: Video: Generating Beautiful (and Correct) Documentation from Unit Tests Files

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

- Matt

On Wednesday, September 25, 2013 10:33:31 PM UTC-4, zcaudate wrote:
>
> I've put up a video of a new documentation plugin for leiningen
>
> Project Page:
> https://github.com/zcaudate/lein-midje-doc
>
> Youtube Video:
> http://www.youtube.com/watch?v=8FjvhDPIUWE&feature=youtu.be
>
>
> Sample Generated Documentation:
> http://z.caudate.me/lein-midje-doc/
> http://z.caudate.me/ribol/
> http://z.caudate.me/ova/
>
>
> Any Comments or Feedback would be appreciated
>

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


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

2013-09-26 Thread Ben Mabey

On 9/25/13 8:33 PM, zcaudate wrote:

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

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

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


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


Any Comments or Feedback would be appreciated




This library looks great Chris!  I can't wait to put it to use. :)

It seems like the goal of this project is aimed at high level 
documentation like you find in READMEs.  That said, have you considered 
yet how to incorporate similar ideas into lower level API 
documentation?  For example,  API documentation generated by tools like 
Autodoc could be augmented with midje facts that have been tagged to be 
examples for a particular function.


Thanks for the great library!

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


Re: Emacs font and theme for clojure

2013-09-26 Thread Murtaza Husain



Thanks BG. I installed both and they look beautiful. 



On Thursday, September 26, 2013 8:25:59 PM UTC+5:30, Baishampayan Ghose 
wrote:
>
> I use Source Code Pro[1] with tomorrow-theme[2]. ~BG 
>
> [1] http://blogs.adobe.com/typblography/2012/09/source-code-pro.html 
> [2] https://github.com/chriskempson/tomorrow-theme 
>
> On Thu, Sep 26, 2013 at 8:21 PM, Murtaza Husain 
> > wrote: 
> > Hi, 
> > 
> > I was just cycling through the different themes in emacs. I was 
> wondering 
> > what font and theme combination others are using ? Any recommendations 
> for 
> > mac pro retina ? 
> > 
> > I like the solarized-dark theme, however the default font doesnt seem 
> very 
> > good with it. 
> > 
> > Thanks, 
> > Murtaza 
> > 
> > -- 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group. 
> > To post to this group, send email to clo...@googlegroups.com 
> > Note that posts from new members are moderated - please be patient with 
> your 
> > first post. 
> > To unsubscribe from this group, send email to 
> > clojure+u...@googlegroups.com  
> > For more options, visit this group at 
> > http://groups.google.com/group/clojure?hl=en 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Clojure" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to clojure+u...@googlegroups.com . 
> > For more options, visit https://groups.google.com/groups/opt_out. 
>
>
>
> -- 
> Baishampayan Ghose 
> b.ghose at gmail.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: Introspecting documentation information

2013-09-26 Thread juan.facorro
Maybe this bit of code serves your purpose or leads you in some useful 
direction.

(ns doc-query
  (:use clojure.repl))

(defn seq-docs
  "Prints the docstrings of a seq of symbols."
  [s]
  (with-out-str (doseq [x s] (eval `(doc ~x)

(defn ns-docs
  "Given a namespace object or its symbol returns a string with all 
  the docstrings of the interned vars in that ns."
  [ns-sym]
  (let [refs (->> ns-sym the-ns ns-interns keys (filter (complement nil?)))]
(apply str (seq-docs refs

(let [nss  (all-ns)
  docs (->> nss (map ns-docs) (apply str))]
(spit "docs.txt" docs))

(spit "special.txt" (seq-docs '(def let loop recur ,,,)))


To get the documentation for the special forms you can create a list with their 
symbols and use it with the seq-docs function as shown in the last expression.


HTH,


Juan


On Thursday, September 26, 2013 7:44:10 AM UTC+8, Marek Kubica wrote:
>
> Hi, 
>
> I was thinking of extracting the information that (doc) returns, but I 
> couldn't find an universal way to do it: 
>
>  - When I use (meta (var foo)) this works, but only for functions 
>  - I looked in the source code of clojure.repl/doc but it uses a lot of 
>private functions, that I'd have to copy & paste 
>
> So, is there any universal way to get docs of special forms as well? 
>
> Thanks in advance! 
>
> regards, 
> Marek 
>

-- 
-- 
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: Introspecting documentation information

2013-09-26 Thread juan.facorro
Maybe this bit of code serves your purpose or leads you in some useful 
direction.

(ns doc-query
  (:use clojure.repl))

(defn seq-docs
  "Prints the docstrings of a seq of symbols."
  [s]
  (with-out-str (doseq [x s] (eval `(doc ~x)

(defn ns-docs
  "Given a namespace object or its symbol returns a string with all 
  the docstrings of the interned vars in that ns."
  [ns-sym]
  (let [refs (->> ns-sym the-ns ns-interns keys (filter (complement nil?)))]
(apply str (seq-docs refs

(let [nss  (all-ns)
  docs (->> nss (map ns-docs) (apply str))]
(spit "docs.txt" docs))

(spit "special.txt" (seq-docs '(def let loop recur ,,,)))


To get the documentation for the special forms you can create a list with their 
symbols and use it with the seq-docs function as shown in the last expression.


HTH,


Juan


On Thursday, September 26, 2013 7:44:10 AM UTC+8, Marek Kubica wrote:
>
> Hi, 
>
> I was thinking of extracting the information that (doc) returns, but I 
> couldn't find an universal way to do it: 
>
>  - When I use (meta (var foo)) this works, but only for functions 
>  - I looked in the source code of clojure.repl/doc but it uses a lot of 
>private functions, that I'd have to copy & paste 
>
> So, is there any universal way to get docs of special forms as well? 
>
> Thanks in advance! 
>
> regards, 
> Marek 
>

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


Adding tomorrow theme to prelude

2013-09-26 Thread Murtaza Husain
Hi,

I want to use the tomorrow theme with prelude  - 
https://github.com/chriskempson/tomorrow-theme

How do I add it to use with prelude ? Is a prelude package availaible for 
it ?

Thanks,
Murtaza

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


[Video] Deep Walking Macros

2013-09-26 Thread Timothy Baldridge
Here's a short 30 min video I put up on YouTube this morning as a
introduction to macros and specifically deep-walking macros.

http://www.youtube.com/watch?v=HXfDK1OYpco

Perhaps it will be useful to some.

Timothy

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


[Video] Understanding list comprehension in Clojure

2013-09-26 Thread Jernau
Hi everyone,

I recorded another screencast - this time with the aim of helping people 
understand 
list comprehension in Clojure .

I hope that some Clojure newcomers (or those unfamiliar with list 
comprehension) find it useful.

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.


Re: Emacs font and theme for clojure

2013-09-26 Thread Joel Holdbrooks
I've been using the noctilux-theme  
with 
Oxygen Mono  or Liberation 
Mono . 

On Thursday, September 26, 2013 7:51:44 AM UTC-7, Murtaza Husain wrote:
>
> Hi,
>
> I was just cycling through the different themes in emacs. I was wondering 
> what font and theme combination others are using ? Any recommendations for 
> mac pro retina ? 
>
> I like the solarized-dark theme, however the default font doesnt seem very 
> good with it. 
>
> Thanks,
> Murtaza 
>

-- 
-- 
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] ribol "v0.2.1" - comprehensive document on conditional restart systems

2013-09-26 Thread Dima Sabanin
Thanks for implementing this!

I found myself in a situation when I needed to provide different exceptions
types triggering different errors in the raise-on macro. I implemented this
as a macro that's just nesting the raise-on blocks:
https://gist.github.com/dsabanin/6717877

Is that something that makes sense? If it is, it probably makes sense to
extend raise-on macro with this, but it might get a bit complex after that.



On Wed, Sep 25, 2013 at 10:20 PM, zcaudate  wrote:

> Hi Dima,
>
> You can now put 'finally' clause in v0.2.2, just loaded onto clojars.
>
> I haven't done an example on the readme yet
>
> but the following should print a hello and return [1 2 :A]:
>
> (manage  ;; L2
>  [1 2 (manage;; L1
>(raise :A);; L0
>(on :A [] :A))]   ;; H1A
>  (on :B [] :B) (finally (print "hello")))
>
> Chris.
>
>
>
> On Thursday, September 26, 2013 1:26:37 AM UTC+10, Dima Sabanin wrote:
>
>> Hi Chris!
>>
>> Great library! I'm trying to apply this to a project I'm working on, but
>> I'm somewhat new to the conditional restarts theory. What would I use
>> instead of Clojure's finally block to properly free up the resources on
>> error escalation?
>>
>> --
>> Thanks,
>> Dima Sabanin
>> http://twitter.com/dimasabanin
>>
>>
>> On Wed, Sep 25, 2013 at 3:14 AM, zcaudate  wrote:
>>
>>> I've done a pretty comprehensive guide on conditional restart systems in
>>> clojure with diagrams to show why it is much more flexible over try/catch
>>> mechanism
>>>
>>> Project:
>>> https://github.com/zcaudate/**ribol
>>>
>>> Generated Documentation:
>>> http://z.caudate.me/ribol/
>>>
>>>
>>>
>>>  --
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clo...@googlegroups.com
>>>
>>> Note that posts from new members are moderated - please be patient with
>>> your first post.
>>> To unsubscribe from this group, send email to
>>> clojure+u...@**googlegroups.com
>>>
>>> For more options, visit this group at
>>> http://groups.google.com/**group/clojure?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to clojure+u...@**googlegroups.com.
>>>
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out
>>> .
>>>
>>
>>
>>
>> --
>> Best regards,
>> Dima Sabanin
>> http://twitter.com/dimasabanin
>>
>  --
> --
> 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 regards,
Dima Sabanin
http://twitter.com/dimasabanin

-- 
-- 
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: Introspecting documentation information

2013-09-26 Thread Marek Kubica
Hey,

Thanks for your answer.

On Thu, 26 Sep 2013 10:34:20 -0700 (PDT)
"juan.facorro"  wrote:

> Maybe this bit of code serves your purpose or leads you in some
> useful direction.

> (defn seq-docs
>   "Prints the docstrings of a seq of symbols."
>   [s]
>   (with-out-str (doseq [x s] (eval `(doc ~x)

Yup, I figured that out already, but it is kinda unstructured. I was
hoping for something better.

> (defn ns-docs
>   "Given a namespace object or its symbol returns a string with all 
>   the docstrings of the interned vars in that ns."
>   [ns-sym]
>   (let [refs (->> ns-sym the-ns ns-interns keys (filter (complement
> nil?)))] (apply str (seq-docs refs
> 
> (let [nss  (all-ns)
>   docs (->> nss (map ns-docs) (apply str))]
> (spit "docs.txt" docs))
> 
> (spit "special.txt" (seq-docs '(def let loop recur ,,,)))
> 
> 
> To get the documentation for the special forms you can create a list
> with their symbols and use it with the seq-docs function as shown in
> the last expression.

Well, what I am doing now is basically extracting all that data that is
private in clojure's repl.clj. I'm accessing the private data now and
reimplemented doc without calling print-doc, basically. Which works
pretty well.

I think this approach is good enough for me. Will publish the code
later.

regards,
Marek

-- 
-- 
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: Emacs font and theme for clojure

2013-09-26 Thread martin madera
I am quite comfortable with arjen theme.

Dne čtvrtek, 26. září 2013 20:15:27 UTC+2 Joel Holdbrooks napsal(a):
>
> I've been using the noctilux-theme 
> with 
> Oxygen Mono  or Liberation 
> Mono . 
>
> On Thursday, September 26, 2013 7:51:44 AM UTC-7, Murtaza Husain wrote:
>>
>> Hi,
>>
>> I was just cycling through the different themes in emacs. I was wondering 
>> what font and theme combination others are using ? Any recommendations for 
>> mac pro retina ? 
>>
>> I like the solarized-dark theme, however the default font doesnt seem 
>> very good with it. 
>>
>> Thanks,
>> Murtaza 
>>
>

-- 
-- 
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] ribol "v0.2.1" - comprehensive document on conditional restart systems

2013-09-26 Thread Chris Zheng
Hi Dima,

I think you can already add multiple types of exceptions with raise-on... I am 
sure it was there in my tests... :) will confirm today. It shouldn't be too 
hard to add a finally clause into the raise-on macro... Thanks for you 
suggestion

i would caution again using too much of raise-on in the example that you 
gave, raise-on acts like a catch. The stack is lost right up at that point. And 
so you won't get any benefits on being able to call 'continue' by using it like 
that to deal with different types of circumstances.

On 27/09/2013, at 4:32, Dima Sabanin  wrote:

> Thanks for implementing this!
> 
> I found myself in a situation when I needed to provide different exceptions 
> types triggering different errors in the raise-on macro. I implemented this 
> as a macro that's just nesting the raise-on blocks: 
> https://gist.github.com/dsabanin/6717877
> 
> Is that something that makes sense? If it is, it probably makes sense to 
> extend raise-on macro with this, but it might get a bit complex after that.
> 
> 
> 
> On Wed, Sep 25, 2013 at 10:20 PM, zcaudate  wrote:
>> Hi Dima,
>> 
>> You can now put 'finally' clause in v0.2.2, just loaded onto clojars. 
>> 
>> I haven't done an example on the readme yet
>> 
>> but the following should print a hello and return [1 2 :A]:
>> 
>> 
>> (manage  ;; L2
>>  [1 2 (manage;; L1
>>(raise :A);; L0
>>(on :A [] :A))]   ;; H1A
>>  (on :B [] :B) (finally (print "hello")))
>> Chris.
>> 
>> 
>> 
>> On Thursday, September 26, 2013 1:26:37 AM UTC+10, Dima Sabanin wrote:
>>> Hi Chris!
>>> 
>>> Great library! I'm trying to apply this to a project I'm working on, but 
>>> I'm somewhat new to the conditional restarts theory. What would I use 
>>> instead of Clojure's finally block to properly free up the resources on 
>>> error escalation?
>>> 
>>> -- 
>>> Thanks,
>>> Dima Sabanin
>>> http://twitter.com/dimasabanin
>>> 
>>> 
>>> On Wed, Sep 25, 2013 at 3:14 AM, zcaudate  wrote:
 I've done a pretty comprehensive guide on conditional restart systems in 
 clojure with diagrams to show why it is much more flexible over try/catch 
 mechanism
 
 Project:
 https://github.com/zcaudate/ribol
 
 Generated Documentation:
 http://z.caudate.me/ribol/
 
 
 
 -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups "Clojure" group.
 To post to this group, send email to clo...@googlegroups.com
 
 Note that posts from new members are moderated - please be patient with 
 your first post.
 To unsubscribe from this group, send email to
 clojure+u...@googlegroups.com
 
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 --- 
 You received this message because you are subscribed to the Google Groups 
 "Clojure" group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojure+u...@googlegroups.com.
 
 For more options, visit https://groups.google.com/groups/opt_out.
>>> 
>>> 
>>> 
>>> 
>>> -- 
>>> Best regards,
>>> Dima Sabanin
>>> http://twitter.com/dimasabanin
>> 
>> -- 
>> -- 
>> 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 regards,
> Dima Sabanin
> http://twitter.com/dimasabanin
> -- 
> -- 
> 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/elRWA13Iidg/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

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

2013-09-26 Thread Chris Zheng
Hi Ben!

Thanks for the feedback! I have thought about how this feature may be 
implemented. I've got some ideas but a little short on time... With what you 
are saying, The autodoc feature has to be built into the library as well. To 
generate an index of functions, one can use a tag of some kind... ie.. :autodoc

You can then tag each fact, or piece of code with the function that it it for, 
then when the function is being generated, it will spit out the relevant tagged 
samples into the document.

 this current version is a hack and needs to be rewritten... Collaborators 
would be most welcome!



On 27/09/2013, at 2:21, Ben Mabey  wrote:

> On 9/25/13 8:33 PM, zcaudate wrote:
>> I've put up a video of a new documentation plugin for leiningen
>> 
>> Project Page:
>> https://github.com/zcaudate/lein-midje-doc
>> 
>> Youtube Video:
>> http://www.youtube.com/watch?v=8FjvhDPIUWE&feature=youtu.be
>> 
>> 
>> Sample Generated Documentation:
>> http://z.caudate.me/lein-midje-doc/
>> http://z.caudate.me/ribol/
>> http://z.caudate.me/ova/
>> 
>> 
>> Any Comments or Feedback would be appreciated
> 
> 
> This library looks great Chris!  I can't wait to put it to use. :)
> 
> It seems like the goal of this project is aimed at high level documentation 
> like you find in READMEs.  That said, have you considered yet how to 
> incorporate similar ideas into lower level API documentation?  For example,  
> API documentation generated by tools like Autodoc could be augmented with 
> midje facts that have been tagged to be examples for a particular function.
> 
> Thanks for the great library!
> 
> -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 a topic in the 
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/clojure/JBCGLK5gpF8/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 it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


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

2013-09-26 Thread Chris Zheng
Thanks Matt! 

Yes it does! Please give it a go. I would love to see some examples of more 
generated readmes

On 27/09/2013, at 1:39, Matt Mitchell  wrote:

> Very nice! Does lein-midje-doc use the Midje fact(s) labels?
> 
> - Matt
> 
> On Wednesday, September 25, 2013 10:33:31 PM UTC-4, zcaudate wrote:
>> 
>> I've put up a video of a new documentation plugin for leiningen
>> 
>> Project Page:
>> https://github.com/zcaudate/lein-midje-doc
>> 
>> Youtube Video:
>> http://www.youtube.com/watch?v=8FjvhDPIUWE&feature=youtu.be
>> 
>> 
>> Sample Generated Documentation:
>> http://z.caudate.me/lein-midje-doc/
>> http://z.caudate.me/ribol/
>> http://z.caudate.me/ova/
>> 
>> 
>> Any Comments or Feedback would be appreciated
> 
> -- 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Clojure" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/clojure/JBCGLK5gpF8/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 it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


adoption of clojurescript.test

2013-09-26 Thread Mimmo Cosenza
Hi all,
while working on CLJS I always use someone else's CLJS libs (e.g. domina, 
dommy, shoreleave, hiccups, now enfocus, etc).

Few of them have unit testing code and the ones that have it use different and 
tricky approaches. My personal opinion is that the clojurescript.test unit 
testing lib by the great Chas Emerick is mature enough to be used all over the 
places, and it also allows, through cljx to share unit testing codebase with 
CLJ. 

May I propose to make it the standard testing lib for CLJS, or there are other 
not too tricky options ready to be used?

Thanks for you attention

Mimmo
   

-- 
-- 
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] clara-rules 0.1.0 released -- rules as a control structure

2013-09-26 Thread Chris Zheng
Hi Ryan!

Thanks for your response. I would love to see maps and nested maps as part of 
the rules. I find that clara provides great syntax for defining inputs and 
outputs and I would love to use it as a rules engine just beneath my front end. 

However, most of my work is web based, data is javascript and so I'm converting 
it into clojure maps and dispatching based on routes

I'm not sure adding a :type field would be a good idea. I've implemented 
something much simpler to work with arrays of elements with different ways that 
elements can be selected and its better to work directly with the data itself 
rather than tag….

I'm really hoping that something similar could be implemented in with routes 
and data… something like:

(defmaprule notify-client-rep
  "Find the client represntative and send a notification of a support request."
   [:support/request [req] (== ?client (:client req))
   [:add/client/representive [req]  ((req :clients) ?client) (== ?name (:name 
req))]
=> (println "Notify" ?name "that" ?client "has a support request")
)


On 27/09/2013, at 12:23 AM, Ryan Brush  wrote:

> Not yet, although I would like to make use of simple maps natural. I had been 
> toying with the idea of typing into the :type metadata that could be attached 
> to a map, allowing expressions like:
> 
> (defrule test-rule 
>[:example/person-map-type (= "Alice" (:first-name this))]
>=>
>(println "Hello, Alice!"))
> 
> That way any map with that type annotation could be used in the rule. Today 
> Clara does automatically bind "this" as a reference to the matched object, so 
> functions can be called against it. (I'm not particularly thrilled by the 
> implicit binding of "this", but it is common in rules engines so I included 
> it here.)
> 
> The advantage of records is they have a pre-defined type and pre-defined 
> fields, so they are a natural alternative to facts and slots seen in other 
> production systems. But since simple maps are so common in Clojure code I do 
> want to incorporate them here, either by tapping into the type metadata as 
> seen in the above example, or by doing something akin to how multimethods 
> work, where the fact "type" is effectively defined by a function.
> 
> I'd love to hear suggestions on this one. The goal is to get the advantages 
> of a production system in a way that feels natural to Clojure developers. 
> What would feel most natural to members of this group?
> 
> On Wednesday, September 25, 2013, zcaudate wrote:
> Hi Ryan!
> 
> Great work. Can normal clojure maps can be used instead of records?
> 
> --
> --
> 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/pfeFyZkoRdU/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 a topic in the Google 
> Groups "Clojure" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/clojure/pfeFyZkoRdU/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 it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Video] Understanding list comprehension in Clojure

2013-09-26 Thread Magomimmo
Nice job, as usual!
mimmo

On Thursday, September 26, 2013 8:10:33 PM UTC+2, Jernau wrote:
>
> Hi everyone,
>
> I recorded another screencast - this time with the aim of helping people 
> understand 
> list comprehension in Clojure 
> .
>
> I hope that some Clojure newcomers (or those unfamiliar with list 
> comprehension) find it useful.
>
> 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.


Re: room available at Clojure/conj (taken)

2013-09-26 Thread Rich Morin
I have found a roommate.  

-r

 -- 
http://www.cfcl.com/rdmRich Morin
http://www.cfcl.com/rdm/resume r...@cfcl.com
http://www.cfcl.com/rdm/weblog +1 650-873-7841

Software system design, development, and documentation


-- 
-- 
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 How to Write a Useful Change Log

2013-09-26 Thread Colin Fleming
I'm a little late to the party here, but I just wanted to thank you guys
for writing these posts - they're great. Thanks for emphasizing the social
aspects of software development, this is all to often forgotten.


On 13 September 2013 09:09, Michael Klishin wrote:

> The ClojureWerkz team recently started writing a series of blog posts
> about how we do things (and why). The series were started
> a while ago in [1]. Here's the second part, on writing useful
> change logs:
>
>
> http://blog.clojurewerkz.org/blog/2013/09/07/how-to-write-a-useful-change-log/
>
> If you have examples of change logs you really like (or find terrible),
> please
> reply to this thread and I will update the post.
>
> 1.
> http://blog.clojurewerkz.org/blog/2013/04/20/how-to-make-your-open-source-project-really-awesome/
> --
> MK
>
> http://github.com/michaelklishin
> http://twitter.com/michaelklishin
>
> --
> --
> 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.


Re: Typedef-like functionality for Clojure records?

2013-09-26 Thread Jason Wolfe
I'm not sure if this would meet your need (it doesn't help with your 
proximate defrecord issue), but if you're primarily interested in 
documentation and validation you could consider prismatic/schema [1] as a 
translation target, and just represent your data with maps.

[1] https://github.com/Prismatic/schema

On Wednesday, September 25, 2013 10:47:35 PM UTC-7, Vincent Chen wrote:
>
> Hi, 
>
> I have in my hands an XML description of data structures that I want 
> to mechanically translate into Clojure. There are  and 
>  elements, with  being similar to structs in C (list 
> of fields) and  being similar to typedef in C (defining new 
> name for already defined s). 
>
> I model s using Clojure records, but I'm not sure how to refer 
> to them with a new name when it comes to s. Given the 
> following specification: 
>
>  
>
>
>  
>
>  
>
> I would create records: 
>
> (defrecord foo [a b]) 
> (defrecord bar [a b]) 
>
> The problem is that struct foo and typedef bar lives in different 
> namespaces, i.e. I don't have foo's specification when I encounter 
> typedef bar. What I'd like to do is (def bar some-ns/foo), but what 
> about ->foo and map->foo? 
>
> So should I: 
> - (def bar some-ns/foo) (def ->bar some-ns/->foo) (def map->bar 
> some-ns/map->foo), while hoping that Clojure doesn't extend records 
> syntax/capabilities in the future? 
> - Use something else than records to model structs (suggestions welcome)? 
> - Other? 
>
> Thanks, 
>
> Vincent 
>

-- 
-- 
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] ribol "v0.2.1" - comprehensive document on conditional restart systems

2013-09-26 Thread Lee Spector

I apologize for the naivety of this question, but whenever I see 
libraries/discussions of enhanced mechanisms for 
exceptions/conditions/errors/restarts/etc in Clojure I wonder if they could 
provide a couple of features that I dearly miss from Common Lisp, and this 
contribution makes me wonder the same thing. I looked briefly through the guide 
(nice diagrams!) but couldn't quite tell if it could do what I miss from Common 
Lisp in Clojure, and therefore whether I should take the time to study it in 
more detail.

What do I miss from Common Lisp condition handling?

When you hit an error in Common Lisp you get a REPL (sometimes called a "break 
loop") that lives in the context where the error occurred. The most useful 
thing to me is that you can examine the state of the system there (through 
normal REPL interactions) and look at the values of local variables all up and 
down the stack. In addition, you can change the values of variables and restart 
the computation, and the restart mechanisms can be customized based on the type 
of error/condition... which is very cool and occasionally useful, but for me 
personally the big win is in just being able to really examine the state at the 
point of the error (including running little pieces of code to help to examine 
the state, etc.).

Note that this happens in Common Lisp wherever an error occurs, and the 
programmer doesn't have to mark or wrap expressions in any special way to get 
this functionality. Which is crucial, because many of the situations in which 
this is useful are ones when you hit an error that you had no idea existed, and 
you certainly didn't know in advance where errors would occur.

Another Common Lisp feature that's very handy in this context is the ability to 
trigger an interrupt manually from the keyboard and end up in the same kind of 
break loop. Your program seems to be hung and you have no idea what it's doing? 
Interrupt it and look at the stack and the local variables. Everything looks 
okay but it's just taking a long time? Restart and you're back in action, 
continuing from where the interrupt occurred. If it doesn't look okay then 
examine the state to try to figure out what went wrong, abort the computation, 
fix the problem and re-run from the beginning.

My sense has been that this kind of functionality doesn't exist in any Clojure 
environment, maybe due to something about how the JVM works (about which I 
don't know very much, which may be very clear to all of you :-). But when I see 
fancy new conditional restart mechanisms etc. then I get a glimmer of hope that 
maybe I'm wrong about this.

So, can any existing libraries/systems in the Clojure ecosystem provide this 
functionality? Is it conceivable that any would in the future?

Thanks,

 -Lee




On Sep 25, 2013, at 3:14 AM, zcaudate wrote:

> I've done a pretty comprehensive guide on conditional restart systems in 
> clojure with diagrams to show why it is much more flexible over try/catch 
> mechanism
> 
> Project:
> https://github.com/zcaudate/ribol
> 
> Generated Documentation:
> http://z.caudate.me/ribol/
> 

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


[ANN] Garden 1.0.0 released

2013-09-26 Thread Joel Holdbrooks
After nearly a month and a half of work, I'm extremely excited to finally 
announce the release of Garden 1.0.0 ! 

This new release contains several important bug fixes, new features, and of 
course breaking changes. Please be sure to see the 
ChangeLogfor
 what has changed since the last release. This is critical for people 
who want to upgrade as there are some syntax changes and namespaces which 
are no longer included.

In a nutshell the new version has:


   - full ClojureScript support
   - built-in @keyframes support
   - the garden.core/css *function* (previously was a macro)
   - the garden.core/style function for inline styling of HTML
   - new compiler settings
   - configurable automatic vendor prefixing


A huge thank you goes out to Julien Eluard for making ClojureScript support 
a success. Also, I want to thank Rob Jens for spotting bugs and writing 
stylesheets with Garden against the development version. Without this kind 
of support, I don't think I'd be as happy as I am today.

As always, I'm interested in hearing new ideas and getting feedback from 
the community.

Sincerely,

Joel

-- 
-- 
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] clara-rules 0.1.0 released -- rules as a control structure

2013-09-26 Thread Ryan Brush
Hey, I appreciate the thoughts. Funny how posting a project yields use 
cases you've never thought of. I went ahead and logged an issue to track 
arbitrary maps as facts here:

https://github.com/rbrush/clara-rules/issues/6

I'm looking for ways to align with you needs, but I don't see an 
immediately obvious way to do so. Out of respect for this mailing list, it 
probably seems best to use the github issue to go deeper on this one. 

-Ryan

On Thursday, September 26, 2013 5:03:24 PM UTC-5, zcaudate wrote:
>
> Hi Ryan!
>
> Thanks for your response. I would love to see maps and nested maps as part 
> of the rules. I find that clara provides great syntax for defining inputs 
> and outputs and I would love to use it as a rules engine just beneath my 
> front end. 
>
> However, most of my work is web based, data is javascript and so I'm 
> converting it into clojure maps and dispatching based on routes
>
> I'm not sure adding a :type field would be a good idea. I've implemented 
> something much simpler to work with arrays of elements with different ways 
> that elements can be selected and its better to work directly with the data 
> itself rather than tag….
>
> I'm really hoping that something similar could be implemented in with 
> routes and data… something like:
>
> (defmaprule notify-client-rep
>   "Find the client represntative and send a notification of a support 
> request."
>[:support/request [req] (== ?client (:client req))
>[:add/client/representive [req]  ((req :clients) ?client) (== ?name 
> (:name req))]
> => (println "Notify" ?name "that" ?client "has a support request")
> )
>
>
> On 27/09/2013, at 12:23 AM, Ryan Brush > 
> wrote:
>
> Not yet, although I would like to make use of simple maps natural. I had 
> been toying with the idea of typing into the :type metadata that could be 
> attached to a map, allowing expressions like:
>
> (defrule test-rule 
>[:example/person-map-type (= "Alice" (:first-name this))]
>=>
>(println "Hello, Alice!"))
>
> That way any map with that type annotation could be used in the 
> rule. Today Clara does automatically bind "this" as a reference to the 
> matched object, so functions can be called against it. (I'm not 
> particularly thrilled by the implicit binding of "this", but it is common 
> in rules engines so I included it here.)
>
> The advantage of records is they have a pre-defined type and pre-defined 
> fields, so they are a natural alternative to facts and slots seen in other 
> production systems. But since simple maps are so common in Clojure code I 
> do want to incorporate them here, either by tapping into the type metadata 
> as seen in the above example, or by doing something akin to how 
> multimethods work, where the fact "type" is effectively defined by a 
> function.
>
> I'd love to hear suggestions on this one. The goal is to get the 
> advantages of a production system in a way that feels natural to Clojure 
> developers. What would feel most natural to members of this group?
>
> On Wednesday, September 25, 2013, zcaudate wrote:
>
>> Hi Ryan!
>>
>> Great work. Can normal clojure maps can be used instead of records?
>>
>> --
>> --
>> 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/pfeFyZkoRdU/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 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 a topic in the 
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/clojure/pfeFyZkoRdU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> clojure+u...@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 cl

Re: abysmal multicore performance, especially on AMD processors

2013-09-26 Thread Andy Fingerhut
Adding to this thread from almost a year ago.  I don't have conclusive
proof with experiments to show right now, but I do have some experiments
that have led me to what I think is a plausible cause of not just Clojure
programs running more slowly when multi-threaded than when single-threaded,
but any programs running on JVM's memory model doing so.  Qualification: My
explanation would be true only for multi-threaded programs running on the
JVM that store significant amounts of data in memory, even if the data
written by each thread is only read by that thread, and there is no locking
or other inter-thread communication, i.e. for "embarrasingly parallel"
problems.

Outline of the argument:

When you start a thread, and then wait for the thread to complete, the JVM
memory model requires all loads and stores to satisfy certain
restrictions.  One of these is that any store done before the thread is
created should 'happen before' the thread start, and thus the updated
stored values must be visible to the new thread.  'Visible' here means that
the thread doing the store must cause the CPU it is running on to update
main memory from whatever locally modified values it has written into its
local cache.  That rule isn't so relevant to my argument.

The one that is relevant is that any store performed by the thread is
considered to 'happen before' a join operation on the thread.  Thus any
store done by a thread must be written back to main memory, *even if the
store is to a JVM object that later becomes garbage*.

So imagine a single-threaded program that creates X bytes of garbage while
it runs.  Those X bytes will definitely be written to the CPU's local
cache, but they will only be written to main memory if the cache space runs
out before the garbage collector does its work and allows that memory to be
reused for allocations.  The CPU-to-local-cache bandwidth in many modern
systems is significantly faster than local-cache-to-main-memory bandwidth.

Now take that same program and spread its work across 2 or more threads,
with a join at the end of each one.  For the sake of example, say that each
thread will write X/N bytes of data while it runs.  Even if the only data
needed later in the rest of the program is a single Long object, for
example, all of those X/N bytes of data will be copied from the local cache
to main memory (if that did not already happen before the thread
terminated).

If the number of threads is large enough, the amount of data written from
all local caches to main memory can be higher in the multi-threaded case
than in the single-threaded case.

Anyway, that is my hypothesis about what could be happening here.  It isn't
Clojure-specific, but it can be exacerbated by the common behavior of a lot
of Clojure code to allocate significant amounts of memory that becomes
garbage.

Andy



On Wed, Jan 30, 2013 at 6:20 PM, Lee Spector  wrote:

>
> FYI we had a bit of a discussion about this at a meetup in Amherst MA
> yesterday, and while I'm not sufficiently on top of the JVM or system
> issues to have briefed everyone on all of the details there has been a
> little of followup since the discussion, including results of some
> different experiments by Chas Emerick, at:
> http://www.meetup.com/Functional-Programming-Connoisseurs/messages/boards/thread/30946382
>
>  -Lee
>
> On Jan 30, 2013, at 8:39 PM, Marshall Bockrath-Vandegrift wrote:
> >
> > Apologies for my very-slow reply here.  I keep thinking that I’ll have
> > more time to look into this issue, and keep having other things
> > requiring my attention.  And on top of that, I’ve temporarily lost the
> > many-way AMD system I was using as a test-bed.
> >
> > I very much want to see if I can get my hands on an Intel system to
> > compare to.  My AMD system is in theory 32-way – two physical CPUs, each
> > with 16 cores.  However, Linux reports (via /proc/cpuinfo) the cores in
> > groups of 8 (“cpu cores : 8” etc).  And something very strange happens
> > when extending parallelism beyond 8-way...  I ran several experiments
> > using a version of your whole-application benchmark I modified to
> > control the level of parallelism.  At parallelism 9+, the real time it
> > takes to complete the benchmark hardly budges, but the user/CPU time
> > increases linearly with the level of parallelism!  As far as I can tell,
> > multi-processor AMD *is* a NUMA architecture, which might potentially
> > explain things.  But enabling the JVM NUMA options doesn’t seem to
> > affect the benchmark.
> >
> > I think next steps are two-fold: (1) examine parallelism vs real & CPU
> > time on an Intel system, and (2) attempt to reproduce the observed
> > behavior in pure Java.  I’m keeping my fingers crossed that I’ll have
> > some time to look at this more soon, but I’m honestly not very hopeful.
> >
> > In the mean time, I hope you’ve managed to exploit multi-process
> > parallelism to run more efficiently?
> >
> > -Marshall
>
> --
> --
> You received this message becaus

Re: [Video] Understanding list comprehension in Clojure

2013-09-26 Thread Jernau
Thanks Mimmo.

By the way, I've been working my way through your modern-cljs 
tutorials, 
and have been finding them both interesting and helpful. Thank you so much 
for spending the time to create such a useful resource.

Cheers, 
James

On Friday, September 27, 2013 12:06:04 AM UTC+2, Magomimmo wrote:
>
> Nice job, as usual!
> mimmo
>
> On Thursday, September 26, 2013 8:10:33 PM UTC+2, Jernau wrote:
>>
>> Hi everyone,
>>
>> I recorded another screencast - this time with the aim of helping people 
>> understand 
>> list comprehension in Clojure
>> .
>>
>> I hope that some Clojure newcomers (or those unfamiliar with list 
>> comprehension) find it useful.
>>
>> 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.