Re: [ANN] Vertigo: fast, idiomatic C-style structs

2013-07-19 Thread Patrick Wright
Zach, it might be interesting to keep an eye on the newly-announced ObjectLayout project by Gil Tene and Martin Thompson. Discussion/overview is on this mail thread https://groups.google.com/forum/m/#!topic/mechanical-sympathy/9PNuQKuWVa4 and the project is here http://objectlayout.github.io/

Re: Proposed change to let-> syntax

2013-07-19 Thread Daniel Dinnyes
Hi, This will sound strange from me, but are these macros really to be added to the core? Firstly, I don't see they extend the language in any way new. Instead they ease some very special cases, which could have been done with the combination of existing core functions/macros just as well, and

Re: Proposed change to let-> syntax

2013-07-19 Thread Michał Marczyk
On 19 July 2013 10:24, Daniel Dinnyes wrote: > Why don't we have a "candidate" name-space, a separate library, like the > contrib before, which most people who prefer to be on the cutting edge just > include automatically. That would give reasonable feedback on how much > traction new stuff like t

Re: Proposed change to let-> syntax

2013-07-19 Thread Alex Baranosky
I use some-> and cond-> pretty heavily... I know I'm just one dude, but I am grateful they're in core so I don't have to cajole all my teammates into accepting them in the code base :) On Fri, Jul 19, 2013 at 1:38 AM, Michał Marczyk wrote: > On 19 July 2013 10:24, Daniel Dinnyes wrote: > > Why d

Domain-specific language design books

2013-07-19 Thread Sam Griffith
This book has examples in several JVM languages like Java, Scala, Clojure, Ruby, and Groovy and contains fully explained code snippets that implement real-world DSL designs. http://www.manning.com/ghosh/ I found it quite good. -- -- You received this message because you are subscribed to the

Wrapping LevelDB with ring/compojure app

2013-07-19 Thread Tarik Ansari
Hello Folks, I am a complete Clojure newbie and trying to achieve something pretty simple and looking for an idiomatic, if I can make it work at all, way to do it. My issue is I need to retain the LevelDB descriptor and share it between requests, LevelDB is already thread-safe. For example: (

Re: Domain-specific language design books

2013-07-19 Thread Jay Fields
this is a great book: http://www.amazon.com/Domain-Specific-Languages-Addison-Wesley-Signature-Series/dp/0321712943 don't let the language selection deter you. the patterns are abstract and can easily be applied to Clojure. On Thu, Jul 18, 2013 at 4:30 PM, JvJ wrote: > Does anyone know of any

Re: Proposed change to let-> syntax

2013-07-19 Thread Jay Fields
I'm already using as-> in prod. I think the ship has sailed on convincing Rich not to include them. On Fri, Jul 19, 2013 at 5:39 AM, Alex Baranosky < alexander.barano...@gmail.com> wrote: > I use some-> and cond-> pretty heavily... I know I'm just one dude, but I > am grateful they're in core so

Re: How core.async compares to agents, future and promise?

2013-07-19 Thread Timothy Baldridge
Let me give a short description of each and perhaps that will help explain when each would be preferred: promise - creates a object that can be deref'd. The result of the promise can be delivered once, and deref-ing a undelivered will cause the deref-ing thread to block. A single producer can give

Re: Proposed change to let-> syntax

2013-07-19 Thread Daniel Dinnyes
Yeah, seemingly I am still a newcomer here. As long as no one minds me coming up with "great ideas", I don't mind looking stupid either... it will improve hopefully :) On Friday, July 19, 2013 9:38:48 AM UTC+1, Michał Marczyk wrote: > > On 19 July 2013 10:24, Daniel Dinnyes > > wrote: > > Why

Re: How core.async compares to agents, future and promise?

2013-07-19 Thread Cedric Greevey
On Fri, Jul 19, 2013 at 8:25 AM, Timothy Baldridge wrote: > channels - allow multiple producers to provide data to multiple consumers > on a one-to-one basis. That is to say, a single value put into a channel > can only be taken by a single consumer. > Although, you can implement a "cable splitte

Re: How core.async compares to agents, future and promise?

2013-07-19 Thread Timothy Baldridge
But notice that each of these examples uses either uses multiple channels. Or is unrecommended behavior. In your latter example, you're throwing parallelism out of the window. It might work better if you had something like (go (f x)) but that then creates an unbounded queue. Why not allow subscri

Re: How core.async compares to agents, future and promise?

2013-07-19 Thread Cedric Greevey
Occurs to me that a common async pattern is going to be to put an unconditional infinite loop in a go block, so we might want a macro for such loops if they'll become much more common: (defmacro endlessly "Executes the body over and over again." [& body] `(loop [] ~@(concat body '(recur

Re: How core.async compares to agents, future and promise?

2013-07-19 Thread Cedric Greevey
On Fri, Jul 19, 2013 at 9:16 AM, Timothy Baldridge wrote: > But notice that each of these examples uses either uses multiple > channels. Or is unrecommended behavior. > > In your latter example, you're throwing parallelism out of the window. It > might work better if you had something like (go (f

Re: Wrapping LevelDB with ring/compojure app

2013-07-19 Thread gaz jones
Instead of using the var #'web/app in run-jetty, use a function that takes your main-db as an argument and returns the routes for your app. You can use the compojure.core/routes to build your app routes rather than using a global var. On Fri, Jul 19, 2013 at 3:42 AM, Tarik Ansari wrote: > Hello

Re: --> macro proposal

2013-07-19 Thread Daniel Dinnyes
On Monday, July 15, 2013 11:53:09 PM UTC+1, Jeremy Heiler wrote: > > On July 15, 2013 at 6:30:28 PM, Daniel Dinnyes > (dinn...@gmail.com) > wrote: > > Hmm, good point, especially the `let` one... What is `as->`? I can't find > anything about that. > > http://clojure.github.io/clojure/clojure.c

Re: ns defaults

2013-07-19 Thread Stuart Sierra
On Thursday, July 18, 2013 4:34:49 AM UTC-4, Jozef Wagner wrote: > Compiler loads and refers clojure.core namespace for each > new namespace. In my projects, I often have one or two > namespaces I use nearly in every other namespace. (e.g. > clojure.tools.logging or clojure.string). It would be >

Re: --> macro proposal

2013-07-19 Thread Daniel Dinnyes
Cheers mate, good point there! On Wednesday, July 17, 2013 6:03:41 PM UTC+1, David Nolen wrote: > > While the macro can do what the original enhancement request suggested > that's not the actual problem the new threading macros were intended to > solve. They were primarily added to eliminate: >

[ANN] Immutant 1.0.0.cr1 released

2013-07-19 Thread Toby Crawley
We just released[0] v1.0.0.cr1 of Immutant, and plan to have 1.0.0 final out in about a week. If you are an Immutant user, please upgrade as soon as you can to help us track down any remaining bugs. ## What is Immutant? Immutant[1] is an application server for Clojure. It's an integrated platform

Re: Design Question: Agents vs. Refs

2013-07-19 Thread Mikera
If you want to do in in "pure functional style" then I would suggest a single atom / ref that contains the whole game state (including monsters, players, map, items etc.) That's the approach I've taken in the two Clojure games I've written so far, and it has worked pretty well. You might be int

ANN: Pulsar 0.2.0 Released

2013-07-19 Thread pron
Featuring: distributed actors, supervisors, fiber-blocking IO, and an implementation of core.async. Read the announcement here . Imagine running an entire Ring handler inside a go-block... -- -

Re: Design Question: Agents vs. Refs

2013-07-19 Thread vis
Note: what concerns me about using a* ref of a hashmap that holds agents of monsters* is that I would loose the transaction benefits of the ref (hence I can't safely move items from a player to a monster). -- -- You received this message because you are subscribed to the Google Groups "Clojure

Design Question: Agents vs. Refs

2013-07-19 Thread vis
Hey guys, I am playing around with a gameserver in clojure, here is the situation: - I have a *ref of a hashmap that holds refs of players* - I have a *ref of a hashmap that holds refs of monsters* I used "refs of players" and "refs of monsters" because at some point I might have to transfer thin

Re: Penumbra vs. LibGDX

2013-07-19 Thread Jonathan Fischer Friberg
While I haven't tried libgdx myself, you should be able to do something like this: 1. Create a "global" namespace (or similar), which should contain global variables and/or functions that should never be reloaded. In this namespace you essentially put the things that there can only be one of - the

Re: Socket.IO and Clojure?

2013-07-19 Thread cma
If you want something robust I'd recommend something like http-kit or Netty on the backend + using websockets (and a shim) directly on the frontend, or possibly browserchannel if you need to worry about firewalls and ancient browsers. Socket.IO is a moving target intended for a single audience

Re: --> macro proposal

2013-07-19 Thread Daniel Dinnyes
Oh, and the implementation is clean and simple. Just cleaned it up a bit from all the clutter: ;;; The DUH..IT'S SO SIMPLE! macro (defmacro duh-> ([x alias form] `(let [~alias ~x] ~form)) ([x alias form & more] `(duh-> (duh-> ~x ~alias ~form) ~@more))) This gives YOU the full power

Re: ns defaults

2013-07-19 Thread Stuart Sierra
On Fri, Jul 19, 2013 at 3:03 PM, Jozef Wagner wrote: > Yes, but this seems to work only in Clojure, not in ClojureScript. That's true. -S -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroup

Re: Interest in a Full Featured Clojure Blog Engine

2013-07-19 Thread Thorsten Wilms
On 07/19/2013 08:46 PM, Timothy Washington wrote: There would just be a core data model of posts, assets and tags, that would exists as definitions, and could be pulled into a runtime soup. How about unifying everything that may be mapped to its own URL as "resource"? Such a resource would hav

Re: Interest in a Full Featured Clojure Blog Engine

2013-07-19 Thread Timothy Washington
Ok, so I've thought a little more about the architecture of a Clojure-based, composable blogging system. I put up my initial notes in this github repo: Stefon . I've ordered the system components, based on core functionality, outwards. - There would just be a

Importing another data_readers

2013-07-19 Thread JvJ
I'm not 100% on how the data_readers.clj file works. It's just a map with no namespace that appears to get loaded by some kind of black magic. Is it possible to provide a library which includes its reader macros, so that the library user's project doesn't need to include their own data_readers

Re: --> macro proposal

2013-07-19 Thread Jeremy Heiler
On July 19, 2013 at 11:28:50 AM, Daniel Dinnyes (dinny...@gmail.com) wrote: Oh, and the implementation is clean and simple. Just cleaned it up a bit from all the clutter: ;;; The DUH..IT'S SO SIMPLE! macro (defmacro duh->   ([x alias form] `(let [~alias ~x] ~form))   ([x alias form & more]  

[ANN] tools.namespace 0.2.4

2013-07-19 Thread Stuart Sierra
*tools.namespace:* utilities to search for, parse, move, and reload namespaces with awareness of their dependencies Release 0.2.4: bug fixes only README and source code: https://github.com/clojure/tools.namespace Leiningen dependency information: [org.clojure/tools.namespace "0.2.4"] Chang

Re: Interest in a Full Featured Clojure Blog Engine

2013-07-19 Thread Timothy Washington
My spidey sense is that the proposed data types (posts, assets, tags, comments too ?), will have to be handled differently. What I plan to do though, is go through some basic workflow cases, and work out the best data relationships. That's the point at which I think common data types could be unif

Re: Importing another data_readers

2013-07-19 Thread Stuart Sierra
When Clojure starts it will search for files named data_readers.clj at the root the Java classpath. Every library JAR can have its own data_readers.clj and they will all be loaded and merged. Be careful with this: if there's a conflict in data reader bindings, Clojure won't start. If your libra

Re: Exporting Multiple Namespaces

2013-07-19 Thread JvJ
"Facades and workarounds for things that are more difficult than they should be." Very nice. On Friday, 19 July 2013 13:06:50 UTC-7, JvJ wrote: > > I'm creating a library with a lot of available functions in a lot of > different namespaces, and I'd like many of them to be available to users of

Re: Design Question: Agents vs. Refs

2013-07-19 Thread Alex Baranosky
I'll second that you are usually doing something unidiomatic if you're using refs of refs. On Fri, Jul 19, 2013 at 2:44 PM, vis wrote: > Good point, I didn't think about that for some reason. > Yes I will give it a read, thanks for the link! > > > On Friday, July 19, 2013 6:19:03 PM UTC+2, Miker

Re: Design Question: Agents vs. Refs

2013-07-19 Thread vis
Good point, I didn't think about that for some reason. Yes I will give it a read, thanks for the link! On Friday, July 19, 2013 6:19:03 PM UTC+2, Mikera wrote: > > If you want to do in in "pure functional style" then I would suggest a > single atom / ref that contains the whole game state (inclu

Exporting Multiple Namespaces

2013-07-19 Thread JvJ
I'm creating a library with a lot of available functions in a lot of different namespaces, and I'd like many of them to be available to users of the library without having to specify a number of different import statements. Is there a way to have the core namespace 'export' the other namespaces

Re: Exporting Multiple Namespaces

2013-07-19 Thread Jonathan Fischer Friberg
Hehe, yep. I mean, it's super useful for any library that needs more than one file. Which is most of them. Jonathan On Sat, Jul 20, 2013 at 12:57 AM, JvJ wrote: > "Facades and workarounds for things that are more difficult than they > should be." Very nice. > > > On Friday, 19 July 2013 13:06:

Re: Interest in a Full Featured Clojure Blog Engine

2013-07-19 Thread Timothy Washington
Ok, that makes sense. Thanks Chas. On Fri, Jul 19, 2013 at 7:53 PM, Chas Emerick wrote: > On Jul 19, 2013, at 2:46 PM, Timothy Washington wrote: > > I've deliberately proposed a small core, so that you can use only the > pieces you absolutely need. Additionally, I think it encourages a clean >

Re: --> macro proposal

2013-07-19 Thread Daniel Dinnyes
> I understood David's comment differently, that the current threading > macros exist so that explicit bindings for each threaded form are not > needed for they very specific cases they intend to simplify. I'm not saying > your macro is dumb, I just don't find the sugar particularly tasty. ;-)

Re: [ANN] REST in Peace 0.1.0

2013-07-19 Thread Jeremy Heiler
Got a link? On July 19, 2013 at 8:37:13 PM, Sebastian Rojas (sebastian.rojas.viva...@gmail.com) wrote: A library for RESTFul applications built on top of Compojure, includes routing abstractions with reverse routing functionalities and validation helpers. -- -- You received this message bec

Re: [ANN] REST in Peace 0.1.0

2013-07-19 Thread Steven Degutis
https://github.com/sebastiansen/rip On Fri, Jul 19, 2013 at 7:49 PM, Jeremy Heiler wrote: > Got a link? > > On July 19, 2013 at 8:37:13 PM, Sebastian Rojas ( > sebastian.rojas.viva...@gmail.com) wrote: > > A library for RESTFul applications built on top of Compojure, includes > routing abstracti

Re: Interest in a Full Featured Clojure Blog Engine

2013-07-19 Thread Chas Emerick
On Jul 19, 2013, at 2:46 PM, Timothy Washington wrote: > I've deliberately proposed a small core, so that you can use only the pieces > you absolutely need. Additionally, I think it encourages a clean design, > forcing explicit interaction semantics between system components. If we > accept thi

Re: --> macro proposal

2013-07-19 Thread Brian Craft
On Friday, July 19, 2013 7:18:15 AM UTC-7, Daniel Dinnyes wrote: > > You are trying to pick it up on the wrong end. Check this out: > > (-> "test-string-with-lots-of-dashes" > (fn [x] (s/split x #"-")) > (fn [y] (interleave y (range))) > (fn [z] (s/join #"_" z)) > (fn [z] (s/join

[ANN] REST in Peace 0.1.0

2013-07-19 Thread Sebastian Rojas
A library for RESTFul applications built on top of Compojure, includes routing abstractions with reverse routing functionalities and validation helpers. -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure

primitive array casts

2013-07-19 Thread Brian Craft
I'm unable to find any examples of primitive array casts, and the docs are not helpful. Can someone point me to examples or docs that explain what they do? -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloj

Re: ns defaults

2013-07-19 Thread Jozef Wagner
On Friday, July 19, 2013 4:20:36 PM UTC+2, Stuart Sierra wrote: > > On Thursday, July 18, 2013 4:34:49 AM UTC-4, Jozef Wagner wrote: > > > Compiler loads and refers clojure.core namespace for each > > new namespace. In my projects, I often have one or two > > namespaces I use nearly in every other

java interop: passing int[]

2013-07-19 Thread Brian Craft
For implementing a method with this signature int getType(int[] inputTypes) How would I declare inputTypes in gen-class? -- -- 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 pos

{{ANN} clj-xmemcached release 0.2.3

2013-07-19 Thread dennis zhuang
An opensource memcached client for clojure,it wraps xmemcached. 0.2.3 releases, main highlights: 1.Supports delete with CAS value in binary protocol ;;delete with CAS (xm/delete "num" (:cas (gets "num"))) 2.Supports lighweight distribution lock with try-lock macro: (def counter (ato

Re: [ANN] tools.namespace 0.2.4

2013-07-19 Thread Ambrose Bonnaire-Sergeant
Thanks for your hard work Stuart. Ambrose On Sat, Jul 20, 2013 at 4:37 AM, Stuart Sierra wrote: > *tools.namespace:* utilities to search for, parse, move, and > reload namespaces with awareness of their dependencies > > Release 0.2.4: bug fixes only > > README and source code: > https://github.

Re: Exporting Multiple Namespaces

2013-07-19 Thread Jonathan Fischer Friberg
Yes, there is https://github.com/ztellman/potemkin Jonathan On Fri, Jul 19, 2013 at 10:06 PM, JvJ wrote: > I'm creating a library with a lot of available functions in a lot of > different namespaces, and I'd like many of them to be available to users of > the library without having to specify a

Re: Interest in a Full Featured Clojure Blog Engine

2013-07-19 Thread James Ashley
>From the peanut gallery: I think this basic idea sounds fabulous. I've been kicking clojure's tires, and I keep meaning to slap a blog engine together. But then I go into tailspin because I want to blog about the experience, but my blogs are down and I don't want to go through setting up WP y

Re: Importing another data_readers

2013-07-19 Thread JvJ
Thanks. I'll make sure users know about it. It's a game engine, so I'll mostly be using it for things like Box2D vector literals (i.e. v#(1,2)), and floating-point numbers ( f#(1.4), so they don't have to say (float 1.4)). On Friday, 19 July 2013 13:48:50 UTC-7, Stuart Sierra wrote: > > Whe

Re: {{ANN} clj-xmemcached release 0.2.3

2013-07-19 Thread Shantanu Kumar
Thanks for the release. Coincidentally, yesterday I wrote a command-line Kestrel client (a script) using clj-xmemcached 0.2.2, lein-exec and tools.cli - it works very well. Shantanu On Saturday, 20 July 2013 08:50:02 UTC+5:30, dennis wrote: > > An opensource memcached client for clojure,it wrap

Re: Wrapping LevelDB with ring/compojure app

2013-07-19 Thread Tarik Ansari
Thanks you, this actually works great! Now I have an other question, are there any arguments against doing that with ring-jetty? Is there a possibility that Jetty isolate the requests and those lose context of the descriptor in-between? Or is it fine as long as it's not run as a servlet? If so,