Re: primitive array casts

2013-07-20 Thread Mikera
Do you mean something like (int-array [1 2 3 4])?

This is a cast-like operation that produces a primitive array of ints, 
exactly like int[] in Java. You can then use it with array operations like 
"aget". 

If you want to type-hint int-array parameters then you need to use 
something like "^ints", e.g. 

(defn third-int-in-array [^ints xs]
 (aget xs 2))

On Saturday, 20 July 2013 02:28:15 UTC+1, Brian Craft wrote:
>
> 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 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: primitive array casts

2013-07-20 Thread Michał Marczyk
I think it's more about clojure.core/{ints,longs,...}. These are
basically tools for removing reflection:

(let [xs (ints (get-some-ints))]
   (aget xs 0)) ; no reflection here thanks to the cast

Cheers,
Michał


On 20 July 2013 10:47, Mikera  wrote:
> Do you mean something like (int-array [1 2 3 4])?
>
> This is a cast-like operation that produces a primitive array of ints,
> exactly like int[] in Java. You can then use it with array operations like
> "aget".
>
> If you want to type-hint int-array parameters then you need to use something
> like "^ints", e.g.
>
> (defn third-int-in-array [^ints xs]
>  (aget xs 2))
>
> On Saturday, 20 July 2013 02:28:15 UTC+1, Brian Craft wrote:
>>
>> 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 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: primitive array casts

2013-07-20 Thread Michał Marczyk
More complete example:

(defn get-some-ints []
  (int-array [1 2 3]))

(set! *warn-on-reflection* true)

;; causes a reflection warning
(let [xs (get-some-ints)]
  (aget xs 0))

;; do not cause reflection warnings
(let [xs (ints (get-some-ints))]
  (aget xs 0))

(let [xs ^ints (get-some-ints)]
  (aget xs 0))

(let [^ints xs (get-some-ints)]
  (aget xs 0))

Cheers,
Michał


On 20 July 2013 11:25, Michał Marczyk  wrote:
> I think it's more about clojure.core/{ints,longs,...}. These are
> basically tools for removing reflection:
>
> (let [xs (ints (get-some-ints))]
>(aget xs 0)) ; no reflection here thanks to the cast
>
> Cheers,
> Michał
>
>
> On 20 July 2013 10:47, Mikera  wrote:
>> Do you mean something like (int-array [1 2 3 4])?
>>
>> This is a cast-like operation that produces a primitive array of ints,
>> exactly like int[] in Java. You can then use it with array operations like
>> "aget".
>>
>> If you want to type-hint int-array parameters then you need to use something
>> like "^ints", e.g.
>>
>> (defn third-int-in-array [^ints xs]
>>  (aget xs 2))
>>
>> On Saturday, 20 July 2013 02:28:15 UTC+1, Brian Craft wrote:
>>>
>>> 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 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: [ANN] REST in Peace 0.1.0

2013-07-20 Thread bernardH


On Saturday, July 20, 2013 3:21:47 AM UTC+2, Steven Degutis wrote:
>
> https://github.com/sebastiansen/rip
>
>  
Thanks !
I'll be implementing RESTful ws this summer and intended to use 
http://clojure-liberator.github.io/liberator/ .
How does your library compares to it ? Any advice on how to make the choice 
would be greatly appreciated.

Cheers,

B.

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




async.core : how to process (match) sequences of events ?

2013-07-20 Thread bernardH
Dear Clojurians,

I'm currently wrapping my head around core.async and it seems really great 
to process events from various souces.
However, I don't currently see how I could use it for my use case.

I want to make a kind of multiplayer action game with "combos" moves for
sequences of input events (i.e. down, down+forward, forward, punch )
with :
- timeout on each step of the would-be combo
- combo chaining (i.e. a combo move can be followed by other specific 
combos only available after it)
- combo breakers (events for outside -i.e. other player(s)- can 
interrupt/reset the sequence

My current understanding would drive me to make matcher channel for each
combo :
- with a buffer of the size of the max combo length
- reading from :
  - the player input stream
  - a control stream for combo breaker
- using a timeout channel

The input stream would be broadcast to all the combos matcher, and the 
select loop would alt! on all of them.
However, this would :
- perform greedy match of the shortest subsequence (I'd want the opposite : 
matching the longuest combo)
- not handle combo chaining

Should I really go back to a hand-written state machine ?

I'm looking forward to any insights.

Best Regards,

B.

-- 
-- 
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: java interop: passing int[]

2013-07-20 Thread Alex Fowler
Some questions to clarify things up:

Do you mean - how do you create that type of value or how do you generatte 
a method that accepts that very type?

Are you sure you need to use gen-class and not proxy or reify?

суббота, 20 июля 2013 г., 7:28:03 UTC+4 пользователь 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 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: primitive array casts

2013-07-20 Thread Michał Marczyk
Also, ^foo-style hints are "soft hints" in the following sense:

(let [^ints xs [1 2 3]] xs) ; no complaint from compiler or RTE

In contrast, ints & Co. demand that the casts be correct:

(let [xs (ints [1 2 3])] xs) ; ClassCastException


On 20 July 2013 11:29, Michał Marczyk  wrote:
> More complete example:
>
> (defn get-some-ints []
>   (int-array [1 2 3]))
>
> (set! *warn-on-reflection* true)
>
> ;; causes a reflection warning
> (let [xs (get-some-ints)]
>   (aget xs 0))
>
> ;; do not cause reflection warnings
> (let [xs (ints (get-some-ints))]
>   (aget xs 0))
>
> (let [xs ^ints (get-some-ints)]
>   (aget xs 0))
>
> (let [^ints xs (get-some-ints)]
>   (aget xs 0))
>
> Cheers,
> Michał
>
>
> On 20 July 2013 11:25, Michał Marczyk  wrote:
>> I think it's more about clojure.core/{ints,longs,...}. These are
>> basically tools for removing reflection:
>>
>> (let [xs (ints (get-some-ints))]
>>(aget xs 0)) ; no reflection here thanks to the cast
>>
>> Cheers,
>> Michał
>>
>>
>> On 20 July 2013 10:47, Mikera  wrote:
>>> Do you mean something like (int-array [1 2 3 4])?
>>>
>>> This is a cast-like operation that produces a primitive array of ints,
>>> exactly like int[] in Java. You can then use it with array operations like
>>> "aget".
>>>
>>> If you want to type-hint int-array parameters then you need to use something
>>> like "^ints", e.g.
>>>
>>> (defn third-int-in-array [^ints xs]
>>>  (aget xs 2))
>>>
>>> On Saturday, 20 July 2013 02:28:15 UTC+1, Brian Craft wrote:

 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 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: Making RPCs with Shoreleave

2013-07-20 Thread Alex Fowler
That wasn't hte case either. After some buzz with ddellacosta and others on 
#clojure, it was found that the RPC call is unable to find that very remote 
procedure I was requesting. Then I have verified that all is properly 
stored in the remote procedures registry on backend and that the front end 
makes proper calls. The problem was that the backend was expecting edn 
while the frontend was sending it in html-form format in request body. I am 
just a beginner with Clojure's web stack, so I think that maybe I missed 
some wrappers with Noir or Ring, but I was doing all according to the 
tutorial and it failed to work. So I had to manually override several 
functions from Shoreleave back-end and front-end to behave coherently and 
send and receive data in edn format. I think this makes a patch for the 
library since the RPC functionality is broken out-of-the-box. Unless I am 
missing something crucial, but examples I found miss that either...



четверг, 18 июля 2013 г., 15:42:35 UTC+4 пользователь terjesb написал:
>
> The default /_shoreleave endpoint should work if you're running using lein 
> ring server.
>
> Are you running a WAR in a container? If so, I don't think Shoreleave 
> currently picks up the context. If you have only one client app, you could 
> proxy this using nginx in front on your container. For multiple client apps 
> (also standalone, without a container), you may need to do what I did:
>
> override default "/_shoreleave" in your app: (wrap-rpc 
> "/your-context/_shoreleave")
>
> and then (binding [shoreleave.remotes.http-rpc/*remote-uri* 
> "/your-context/_shoreleave"] ) around your client calls.
>
> Terje.
>
>
>
>
> kl. 10:50:17 UTC+2 mandag 15. juli 2013 skrev Alex Fowler følgende:
>>
>> Did not work.. all that is strange since I've been following the manual 
>> step-by-step.. looks like the shoreleave's wrapper does not even create a 
>> http route for itself... any other ideas?
>>
>> On Friday, July 12, 2013 7:14:42 AM UTC+4, Samrat Man Singh wrote:
>>>
>>> I think you need to (use projectname.ajax) in your projectname.handler 
>>> page. If I remember correctly, there's also a way to specify which 
>>> namespace your remote function is in.
>>>
>>> On Thursday, July 11, 2013 10:42:15 PM UTC+5:45, Alex Fowler wrote:

 Hi all, this is my first experience with Shoreleave and I'm trying to 
 use it's RPC mechanism to perform AJAX tasks. However, on a call to a 
 remote procedure, I get this:

 `

1. POST http://localhost:8080/_shoreleave 404 (Not Found) 
cljs.js:25223 
   1. goog.net.XhrIo.sendcljs.js:25223
   2. xhr__delegatecljs.js:31416 
   3. xhrcljs.js:31423 
   4. 
 remote_callback__delegatecljs.js:32504
   5. remote_callbackcljs.js:32515
   6. load_storecljs.js:32745 
   7. 
 mk__AMPERSAND__load_store__delegatecljs.js:32755
   8. 
 mk__AMPERSAND__load_storecljs.js:32763
   9. example_storecljs.js:33341 
   10. simplecljs.js:33361 
   11. setup_guicljs.js:33962 
   12. setup_allcljs.js:33982 
   13. startupcljs.js:41166 
   14. onloadapp:2 
   
 XHR ERROR: Not Found 
 `

 What is wrong and how do I fix it? I have been following this tutorial: 
 Shoreleave 
 Tutorial 10 - Introducing 
 Ajax
  my 
 code (relevant parts) is this:

 Project.clj:
 `
 (defproject projectname "0.1.0-SNAPSHOT"
   :description "FIXME: write description"
   :url "http://example.com/FIXME";
   :dependencies [[org.clojure/clojure "1.5.1"]
  [lib-noir "0.6.3"]
  [compojure "1.2.0-SNAPSHOT"]
  [ring-server "0.2.8"]
  [clabango "0.5"]
  [hiccup "1.0.3"]
  [com.taoensso/timbre "2.1.2"]
  [com.taoensso/tower "1.7.1"]
  [markdown-clj "0.9.26"]

  ; -- ajax
  [shoreleave "0.3.0"]
  [shoreleave/shoreleave-remote-ring "0.3.0"]
  [shoreleave/shoreleave-remote "0.3.0"]
  
  ; -- cljs
  [com.keminglabs/singult "0.1.6"]
  [enfocus "1.0.1"]
  [jayq "2.3.0"]
   

Can't get namespace metadata

2013-07-20 Thread Alexander Yakushev
Example:

user=> (meta (find-ns 'clojure.set))
nil
user=> (meta (find-ns 'clojure.string))
nil
user=> (meta (find-ns 'clojure.core))
{:doc "Fundamental library of the Clojure language"}

clojure.core is the only namespace that has metadata. Apparently because it 
has metadata set differently 
https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L6158, 
so I blame *ns *macro.

I tested this with clojure 1.2-1.5, so it is not a regression, and unless 
I'm doing something wrong, this was broken from the beginning.

-- 
-- 
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: java interop: passing int[]

2013-07-20 Thread Brian Craft
I'm trying to write a user function for h2. I think that means I need 
gen-class, but I'm extremely fuzzy on how java class loading works. Perhaps 
my question is moot, because I just ran across this obscure note in a 
gen-class example:

;; declare only new methods, not superclass methods

If I'm implementing an interface in h2, does that mean I shouldn't declare 
the methods? I also found a stackoverflow answer that suggested something 
like

["[Ljava.lang.Integer;"]

which looks like black magic, and I can't find this in the docs anywhere.

On Saturday, July 20, 2013 2:39:06 AM UTC-7, Alex Fowler wrote:
>
> Some questions to clarify things up:
>
> Do you mean - how do you create that type of value or how do you generatte 
> a method that accepts that very type?
>
> Are you sure you need to use gen-class and not proxy or reify?
>
> суббота, 20 июля 2013 г., 7:28:03 UTC+4 пользователь 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 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: primitive array casts

2013-07-20 Thread Brian Craft
Can you explain this more? In the second example, it's unhappy because a 
vector is not a primitive array?

And I don't understand the idea of a "soft hint". It looks like "this may 
be ints", but that's true without the hint. So what is the hint doing?

On Saturday, July 20, 2013 2:31:50 AM UTC-7, Michał Marczyk wrote:
>
> Also, ^foo-style hints are "soft hints" in the following sense: 
>
> (let [^ints xs [1 2 3]] xs) ; no complaint from compiler or RTE 
>
> In contrast, ints & Co. demand that the casts be correct: 
>
> (let [xs (ints [1 2 3])] xs) ; ClassCastException 
>
>
> On 20 July 2013 11:29, Michał Marczyk > 
> wrote: 
> > More complete example: 
> > 
> > (defn get-some-ints [] 
> >   (int-array [1 2 3])) 
> > 
> > (set! *warn-on-reflection* true) 
> > 
> > ;; causes a reflection warning 
> > (let [xs (get-some-ints)] 
> >   (aget xs 0)) 
> > 
> > ;; do not cause reflection warnings 
> > (let [xs (ints (get-some-ints))] 
> >   (aget xs 0)) 
> > 
> > (let [xs ^ints (get-some-ints)] 
> >   (aget xs 0)) 
> > 
> > (let [^ints xs (get-some-ints)] 
> >   (aget xs 0)) 
> > 
> > Cheers, 
> > Michał 
> > 
> > 
> > On 20 July 2013 11:25, Michał Marczyk > 
> wrote: 
> >> I think it's more about clojure.core/{ints,longs,...}. These are 
> >> basically tools for removing reflection: 
> >> 
> >> (let [xs (ints (get-some-ints))] 
> >>(aget xs 0)) ; no reflection here thanks to the cast 
> >> 
> >> Cheers, 
> >> Michał 
> >> 
> >> 
> >> On 20 July 2013 10:47, Mikera > 
> wrote: 
> >>> Do you mean something like (int-array [1 2 3 4])? 
> >>> 
> >>> This is a cast-like operation that produces a primitive array of ints, 
> >>> exactly like int[] in Java. You can then use it with array operations 
> like 
> >>> "aget". 
> >>> 
> >>> If you want to type-hint int-array parameters then you need to use 
> something 
> >>> like "^ints", e.g. 
> >>> 
> >>> (defn third-int-in-array [^ints xs] 
> >>>  (aget xs 2)) 
> >>> 
> >>> On Saturday, 20 July 2013 02:28:15 UTC+1, Brian Craft wrote: 
>  
>  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 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. 
> >>> 
> >>> 
>

-- 
-- 
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] REST in Peace 0.1.0

2013-07-20 Thread Sebastian Rojas
Link to repository https://github.com/sebastiansen/rip

On Friday, July 19, 2013 7:03:18 PM UTC-4, Sebastian Rojas 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 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: java interop: passing int[]

2013-07-20 Thread Cedric Greevey
That would specify an array of boxed ints. If you want an array of
primitive ints, I think that's [I instead.


On Sat, Jul 20, 2013 at 9:42 AM, Brian Craft  wrote:

> I'm trying to write a user function for h2. I think that means I need
> gen-class, but I'm extremely fuzzy on how java class loading works. Perhaps
> my question is moot, because I just ran across this obscure note in a
> gen-class example:
>
> ;; declare only new methods, not superclass methods
>
> If I'm implementing an interface in h2, does that mean I shouldn't declare
> the methods? I also found a stackoverflow answer that suggested something
> like
>
> ["[Ljava.lang.Integer;"]
>
> which looks like black magic, and I can't find this in the docs anywhere.
>
> On Saturday, July 20, 2013 2:39:06 AM UTC-7, Alex Fowler wrote:
>>
>> Some questions to clarify things up:
>>
>> Do you mean - how do you create that type of value or how do you
>> generatte a method that accepts that very type?
>>
>> Are you sure you need to use gen-class and not proxy or reify?
>>
>> суббота, 20 июля 2013 г., 7:28:03 UTC+4 пользователь 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 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: java interop: passing int[]

2013-07-20 Thread Alex Fowler
BTW, take a look 
http://blog.getprismatic.com/blog/2013/7/10/introducing-hiphip-array-fast-and-flexible-numerical-computation-in-clojure

суббота, 20 июля 2013 г., 17:42:36 UTC+4 пользователь Brian Craft написал:
>
> I'm trying to write a user function for h2. I think that means I need 
> gen-class, but I'm extremely fuzzy on how java class loading works. Perhaps 
> my question is moot, because I just ran across this obscure note in a 
> gen-class example:
>
> ;; declare only new methods, not superclass methods
>
> If I'm implementing an interface in h2, does that mean I shouldn't declare 
> the methods? I also found a stackoverflow answer that suggested something 
> like
>
> ["[Ljava.lang.Integer;"]
>
> which looks like black magic, and I can't find this in the docs anywhere.
>
> On Saturday, July 20, 2013 2:39:06 AM UTC-7, Alex Fowler wrote:
>>
>> Some questions to clarify things up:
>>
>> Do you mean - how do you create that type of value or how do you 
>> generatte a method that accepts that very type?
>>
>> Are you sure you need to use gen-class and not proxy or reify?
>>
>> суббота, 20 июля 2013 г., 7:28:03 UTC+4 пользователь 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 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: primitive array casts

2013-07-20 Thread Softaddicts
Type hints are given so the compiler can optimize the generated code by assuming
first that the value passed will be of the type hint.

It does not preclude you from passing something that is not what the hint says 
it
should be. In this case the usual behavior is to use reflection on the value 
class
to find be method and call it.

Luc P.

> Can you explain this more? In the second example, it's unhappy because a > 
> vector is not a primitive array?
> > And I don't understand the idea of a "soft hint". It looks like "this may > 
> > be ints", but that's true without the hint. So what is the hint doing?
> > On Saturday, July 20, 2013 2:31:50 AM UTC-7, Michał Marczyk wrote:
> >
> > Also, ^foo-style hints are "soft hints" in the following sense: > >
> > (let [^ints xs [1 2 3]] xs) ; no complaint from compiler or RTE > >
> > In contrast, ints & Co. demand that the casts be correct: > >
> > (let [xs (ints [1 2 3])] xs) ; ClassCastException > >
> >
> > On 20 July 2013 11:29, Michał Marczyk > 
> > > > wrote: > > > More complete example: > > > > > > (defn get-some-ints [] 
> > > > >   (int-array [1 2 3])) > > > > > > (set! *warn-on-reflection* true) > 
> > > > > > > ;; causes a reflection warning > > > (let [xs (get-some-ints)] > 
> > > >   (aget xs 0)) > > > > > > ;; do not cause reflection warnings > > > 
> > (let [xs (ints (get-some-ints))] > > >   (aget xs 0)) > > > > > > (let [xs 
> > ^ints (get-some-ints)] > > >   (aget xs 0)) > > > > > > (let [^ints xs 
> > (get-some-ints)] > > >   (aget xs 0)) > > > > > > Cheers, > > > Michał > > 
> > > > > > > > > On 20 July 2013 11:25, Michał Marczyk 
> > > > > wrote: > > >> I think it's more 
> > about clojure.core/{ints,longs,...}. These are > > >> basically tools for 
> > removing reflection: > > >> > > >> (let [xs (ints (get-some-ints))] > > >>  
> >   (aget xs 0)) ; no reflection here thanks to the cast > > >> > > >> 
> > Cheers, > > >> Michał > > >> > > >> > > >> On 20 July 2013 10:47, Mikera 
> > > > > wrote: > > >>> Do you mean 
> > something like (int-array [1 2 3 4])? > > >>> > > >>> This is a cast-like 
> > operation that produces a primitive array of ints, > > >>> exactly like 
> > int[] in Java. You can then use it with array operations > > like > > >>> 
> > "aget". > > >>> > > >>> If you want to type-hint int-array parameters then 
> > you need to use > > something > > >>> like "^ints", e.g. > > >>> > > >>> 
> > (defn third-int-in-array [^ints xs] > > >>>  (aget xs 2)) > > >>> > > 
> > >>> On Saturday, 20 July 2013 02:28:15 UTC+1, Brian Craft wrote: > >  > 
> > >  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 
> > 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. > > >>> > > >>> > >
> > -- > -- > 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.
> > > --
Softaddicts sent by ibisMail from my ipad!

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

Re: Interest in a Full Featured Clojure Blog Engine

2013-07-20 Thread Manuel Paccagnella
Interesting +1

I've slammed together some quick and dirty Clojure code and wrote my own 
little blog engine (I'll not link the repo, the code is... well 
quick&dirty: I needed something running quickly). But it has the bare 
minimum and I didn't find any real feature complete blog engine as the one 
you are proposing. An engine designed with a "clojuresque" vision behind 
its architecture (simple, modular, extensible, and made of composable 
pieces) would be very interesting to see come to life.

I'll read through the comments and hopefully add something when this 
headache will give me a break. I'm about to begin writing a prototype  
system for my dayjob, but I'd like to help you in this endeavour (I hope 
I'll have the time to do that).

Cheers,
Manuel

Il giorno giovedì 18 luglio 2013 17:10:26 UTC+2, frye ha scritto:
>
> Ok, I'll start to flesh this out a little more - overall architecture, 
> 3rd-party libs, etc. And I'll get some more of your feedback from there. 
> Please add anymore ideas to this effect, if you have them. 
>
>
> More soon 
>
> Tim Washington 
> Interruptsoftware.ca / Bkeeping.com 
>
>
> On Thu, Jul 18, 2013 at 10:55 AM, Michael Fogus 
> > wrote: 
>
>> That's what I hoped you meant. Sounds fun. 
>>
>> On Thu, Jul 18, 2013 at 10:44 AM, Timothy Washington 
>> > 
>> wrote: 
>> > Ah, by composable, I meant you could choose to only use a core server
>> > component, posting txt entries, let's say with an in-memory data store 
>> ( who
>> > knows.. it's your blog :). And if you want a little more, you can 
>> choose to
>> > add a DB adapter out to Datomic, and Import / Export support. This is 
>> all
>> > still within a running Clojure repl. So additionally, you might choose 
>> to
>> > add a Web UI (or tablet or smartphone UI), and so on.
>> >
>> >
>> > Tim Washington
>> > Interruptsoftware.ca / Bkeeping.com
>> >
>> >
>> > On Thu, Jul 18, 2013 at 10:36 AM, Michael Fogus 
>> > > 
>> wrote:
>> >>
>> >> Quick answer: Yes.  I'd love to see a legitimate, maintained
>> >> Clojure-based blogging engine.  I have one question: what does
>> >> "composable blogging engine" mean?
>> >>
>> >>
>> >> On Thu, Jul 18, 2013 at 10:24 AM, Timothy Washington <
>> twas...@gmail.com >
>> >> wrote:
>> >> > Hello,
>> >> >
>> >> > I'm thinking of how to build a composable blogging engine in Clojure.
>> >> > There
>> >> > have been a few attempts at this, with cow-blog and my-blog. But 
>> these
>> >> > seem
>> >> > to be abandoned, and not heavily used. Vijay Kiran, last year, even
>> >> > wrote a
>> >> > series of blog posts (see here) about building a blog engine. As far 
>> as
>> >> > a
>> >> > list of posts goes, the data structure for each record was simple:
>> >> >
>> >> > title
>> >> > content
>> >> > status
>> >> > created-date
>> >> > published-date
>> >> > author
>> >> >
>>
>

-- 
-- 
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: java interop: passing int[]

2013-07-20 Thread Alex Fowler
So, out of what you're saying - you want to implement an interface, without 
adding new methods - I strongly suggest using proxy and delegate all the 
type-resolution hassle to JVM (just rely on it).

If you are really sure you need specifying types explicitly, then use type 
hints and dedicated clojure handling functions. Explore typehints like 
`^ints` or `^floats` and array-related functions like (ints) or 
(int-array). I would avoid using gen-class until it is really necessary 
(out of bytecode compatibility requirements I guess)


суббота, 20 июля 2013 г., 17:42:36 UTC+4 пользователь Brian Craft написал:
>
> I'm trying to write a user function for h2. I think that means I need 
> gen-class, but I'm extremely fuzzy on how java class loading works. Perhaps 
> my question is moot, because I just ran across this obscure note in a 
> gen-class example:
>
> ;; declare only new methods, not superclass methods
>
> If I'm implementing an interface in h2, does that mean I shouldn't declare 
> the methods? I also found a stackoverflow answer that suggested something 
> like
>
> ["[Ljava.lang.Integer;"]
>
> which looks like black magic, and I can't find this in the docs anywhere.
>
> On Saturday, July 20, 2013 2:39:06 AM UTC-7, Alex Fowler wrote:
>>
>> Some questions to clarify things up:
>>
>> Do you mean - how do you create that type of value or how do you 
>> generatte a method that accepts that very type?
>>
>> Are you sure you need to use gen-class and not proxy or reify?
>>
>> суббота, 20 июля 2013 г., 7:28:03 UTC+4 пользователь 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 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: java interop: passing int[]

2013-07-20 Thread Brian Craft
I don't think proxy creates a named class, though. I believe h2 looks up 
user functions via a string naming the class.

On Saturday, July 20, 2013 9:31:38 AM UTC-7, Alex Fowler wrote:
>
> So, out of what you're saying - you want to implement an interface, 
> without adding new methods - I strongly suggest using proxy and delegate 
> all the type-resolution hassle to JVM (just rely on it).
>
> If you are really sure you need specifying types explicitly, then use type 
> hints and dedicated clojure handling functions. Explore typehints like 
> `^ints` or `^floats` and array-related functions like (ints) or 
> (int-array). I would avoid using gen-class until it is really necessary 
> (out of bytecode compatibility requirements I guess)
>
>
> суббота, 20 июля 2013 г., 17:42:36 UTC+4 пользователь Brian Craft написал:
>>
>> I'm trying to write a user function for h2. I think that means I need 
>> gen-class, but I'm extremely fuzzy on how java class loading works. Perhaps 
>> my question is moot, because I just ran across this obscure note in a 
>> gen-class example:
>>
>> ;; declare only new methods, not superclass methods
>>
>> If I'm implementing an interface in h2, does that mean I shouldn't 
>> declare the methods? I also found a stackoverflow answer that suggested 
>> something like
>>
>> ["[Ljava.lang.Integer;"]
>>
>> which looks like black magic, and I can't find this in the docs anywhere.
>>
>> On Saturday, July 20, 2013 2:39:06 AM UTC-7, Alex Fowler wrote:
>>>
>>> Some questions to clarify things up:
>>>
>>> Do you mean - how do you create that type of value or how do you 
>>> generatte a method that accepts that very type?
>>>
>>> Are you sure you need to use gen-class and not proxy or reify?
>>>
>>> суббота, 20 июля 2013 г., 7:28:03 UTC+4 пользователь 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 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: java interop: passing int[]

2013-07-20 Thread Brian Craft
I've been looking at hiphip, though it's not clear to me how it's related 
to h2 user functions. ;)

It wasn't immediately clear to me if hiphip handles multidimensional matix 
operations.

On Saturday, July 20, 2013 9:32:50 AM UTC-7, Alex Fowler wrote:
>
> BTW, take a look 
> http://blog.getprismatic.com/blog/2013/7/10/introducing-hiphip-array-fast-and-flexible-numerical-computation-in-clojure
>
> суббота, 20 июля 2013 г., 17:42:36 UTC+4 пользователь Brian Craft написал:
>>
>> I'm trying to write a user function for h2. I think that means I need 
>> gen-class, but I'm extremely fuzzy on how java class loading works. Perhaps 
>> my question is moot, because I just ran across this obscure note in a 
>> gen-class example:
>>
>> ;; declare only new methods, not superclass methods
>>
>> If I'm implementing an interface in h2, does that mean I shouldn't 
>> declare the methods? I also found a stackoverflow answer that suggested 
>> something like
>>
>> ["[Ljava.lang.Integer;"]
>>
>> which looks like black magic, and I can't find this in the docs anywhere.
>>
>> On Saturday, July 20, 2013 2:39:06 AM UTC-7, Alex Fowler wrote:
>>>
>>> Some questions to clarify things up:
>>>
>>> Do you mean - how do you create that type of value or how do you 
>>> generatte a method that accepts that very type?
>>>
>>> Are you sure you need to use gen-class and not proxy or reify?
>>>
>>> суббота, 20 июля 2013 г., 7:28:03 UTC+4 пользователь 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 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: separate namespace for extra-special forms?

2013-07-20 Thread Gary Verhaegen
fn and let are macros in the clojure.core namespace; & is technically not a
valid character in a symbol, but the Clojure reader is quite lenient on
that front. As far as I know, it is not treated as anything special at the
level of the language, it is just interpreted by the destructuring macros.

On the other hand, real "special forms" in the Lispy sense are not macros -
they are "hard coded".

Think of the interpreter as doing something akin to:

(defn eval [form)
  (if (list? form)
(cond
  (= 'let* (first form))  (...))
  (= 'fn* (first form)) (...))
  ;; same for all special forms
  (fn? (get-in-env (first form))) (apply (first form) (map eval (rest
form)))
  (macro? (get-in-env (first form))) (apply (first form) (rest
form))

This is of course highly sketchy, but you get the idea: functions and
macros are looked-up in the environment and executed from their definition,
so you can rebind them in the local environment, but special forms are just
executed directly.

(At least, this is how it works in toy implementations à la SICP & little
schemer - I'm not at all familiar with the Clojure source code, but this is
a working mental model for explaining the observed behavior.)


On 24 June 2013 00:43, Ben Wolfson  wrote:

> Well, when used as the first element of a list. (And I certainly wouldn't
> use them as local names, since that would be extremely confusing; I was
> trying to verify the correctness of some code I'm working on.)
>
> But I called these "extra-special" because, in my understanding of the
> term, "special form" generically just refers to something with non-normal
> evaluation order (or special evaluation semantics generally). "when", in
> this definition, is a special form, as are "fn" and "let" (both of which
> are listed as special forms on http://clojure.org/special_forms). But
> neither "fn" nor "let" is special the way "let*", "fn*", "do", or the other
> *extra*-special forms are:
>
> user> (let [fn (fn [x] x)] (fn 4))
> 4
> user> (let [let (fn [x] x)] (let 4))
> 4
>
> Thinking about it more, I suppose you're thinking of what's returned by
> clojure.lang.Compiler/specials, except several of them can be used just
> fine in this pattern:
>
> user> (let [& (fn [x] x)] (& 1))
> 1
>
> The above also works for finally and catch.
>
> Anyway, I'm surprised one can establish local bindings for these guys at
> all.
>
> On Sun, Jun 23, 2013 at 2:46 PM, Ambrose Bonnaire-Sergeant <
> abonnaireserge...@gmail.com> wrote:
>
>> Special forms are special when used in a list. IMO it's a bad idea to use
>> special forms
>> as local names, a caveat which is surprisingly under-documented.
>>
>> Thanks,
>> Ambrose
>>
>>
>> On Mon, Jun 24, 2013 at 5:38 AM, Ben Wolfson  wrote:
>>
>>> This strikes me as pretty odd:
>>>
>>> user> (let [z 1
>>> try 2
>>> fn* 3]
>>> (try (let [x (fn* ([a b c] [a b c]))]
>>>(x z try fn*))
>>>  (catch Exception e e)))
>>> [1 2 3]
>>>
>>>
>>> --
>>> Ben Wolfson
>>> "Human kind has used its intelligence to vary the flavour of drinks,
>>> which may be sweet, aromatic, fermented or spirit-based. ... Family and
>>> social life also offer numerous other occasions to consume drinks for
>>> pleasure." [Larousse, "Drink" entry]
>>>
>>>  --
>>> --
>>> 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.
>>
>>
>>
>
>
>
> --
> Ben Wolfson
> "Human kind has used its intelligence to vary the flavour of drinks, which
> may be sweet, aromatic, fermented or spirit-based. ... Family an

concat primitive arrays

2013-07-20 Thread Brian Craft
Is there an easy, fast way to concat primitive arrays? I was hoping java 
arrays had some common interface for this, but I haven't found much of use. 
I mostly see code like this:

byte[] c = new byte[a.length + b.length];
System.arraycopy(a, 0, c, 0, a.length);
System.arraycopy(b, 0, c, a.length, b.length);

which only works for bytes (in this case).

-- 
-- 
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: separate namespace for extra-special forms?

2013-07-20 Thread Cedric Greevey
Shouldn't the "macro?" case have an (eval ...) wrapped around the (apply
...)?


On Sat, Jul 20, 2013 at 4:19 PM, Gary Verhaegen wrote:

> fn and let are macros in the clojure.core namespace; & is technically not
> a valid character in a symbol, but the Clojure reader is quite lenient on
> that front. As far as I know, it is not treated as anything special at the
> level of the language, it is just interpreted by the destructuring macros.
>
> On the other hand, real "special forms" in the Lispy sense are not macros
> - they are "hard coded".
>
> Think of the interpreter as doing something akin to:
>
> (defn eval [form)
>   (if (list? form)
> (cond
>   (= 'let* (first form))  (...))
>   (= 'fn* (first form)) (...))
>   ;; same for all special forms
>   (fn? (get-in-env (first form))) (apply (first form) (map eval (rest
> form)))
>   (macro? (get-in-env (first form))) (apply (first form) (rest
> form))
>
> This is of course highly sketchy, but you get the idea: functions and
> macros are looked-up in the environment and executed from their definition,
> so you can rebind them in the local environment, but special forms are just
> executed directly.
>
> (At least, this is how it works in toy implementations à la SICP & little
> schemer - I'm not at all familiar with the Clojure source code, but this is
> a working mental model for explaining the observed behavior.)
>
>
> On 24 June 2013 00:43, Ben Wolfson  wrote:
>
>> Well, when used as the first element of a list. (And I certainly wouldn't
>> use them as local names, since that would be extremely confusing; I was
>> trying to verify the correctness of some code I'm working on.)
>>
>> But I called these "extra-special" because, in my understanding of the
>> term, "special form" generically just refers to something with non-normal
>> evaluation order (or special evaluation semantics generally). "when", in
>> this definition, is a special form, as are "fn" and "let" (both of which
>> are listed as special forms on http://clojure.org/special_forms). But
>> neither "fn" nor "let" is special the way "let*", "fn*", "do", or the other
>> *extra*-special forms are:
>>
>> user> (let [fn (fn [x] x)] (fn 4))
>> 4
>> user> (let [let (fn [x] x)] (let 4))
>> 4
>>
>> Thinking about it more, I suppose you're thinking of what's returned by
>> clojure.lang.Compiler/specials, except several of them can be used just
>> fine in this pattern:
>>
>> user> (let [& (fn [x] x)] (& 1))
>> 1
>>
>> The above also works for finally and catch.
>>
>> Anyway, I'm surprised one can establish local bindings for these guys at
>> all.
>>
>> On Sun, Jun 23, 2013 at 2:46 PM, Ambrose Bonnaire-Sergeant <
>> abonnaireserge...@gmail.com> wrote:
>>
>>> Special forms are special when used in a list. IMO it's a bad idea to
>>> use special forms
>>> as local names, a caveat which is surprisingly under-documented.
>>>
>>> Thanks,
>>> Ambrose
>>>
>>>
>>> On Mon, Jun 24, 2013 at 5:38 AM, Ben Wolfson  wrote:
>>>
 This strikes me as pretty odd:

 user> (let [z 1
 try 2
 fn* 3]
 (try (let [x (fn* ([a b c] [a b c]))]
(x z try fn*))
  (catch Exception e e)))
 [1 2 3]


 --
 Ben Wolfson
 "Human kind has used its intelligence to vary the flavour of drinks,
 which may be sweet, aromatic, fermented or spirit-based. ... Family and
 social life also offer numerous other occasions to consume drinks for
 pleasure." [Larousse, "Drink" entry]

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

Re: concat primitive arrays

2013-07-20 Thread Brian Craft
Here are some experiments that aren't polymorphic. The System/arraycopy 
version is fastest, by far. Is there any good way to make the other 
versions faster, or make them handle any array type?

(defn bconcat [& arrays]
 (let [sizes (map count arrays)
   sizes_r (vec (reductions + sizes))
   offsets (cons 0 (drop-last sizes_r))
   total (last sizes_r)
   out (float-array total)]
   (dorun (map #(System/arraycopy %2 0 out %1 %3) offsets arrays sizes))
   out))

(defn cconcat [& arrays]
 (let [vs (map vec arrays)
   cc (apply concat vs)]
   (float-array cc)))

(defn dconcat [& arrays]
 (let [vs (map vec arrays)
   cc (reduce into [] vs)]
   (float-array cc)))

(defn econcat [& arrays]
 (let [cc (reduce into [] arrays)]
   (float-array cc)))


On Saturday, July 20, 2013 2:24:14 PM UTC-7, Brian Craft wrote:
>
> Is there an easy, fast way to concat primitive arrays? I was hoping java 
> arrays had some common interface for this, but I haven't found much of use. 
> I mostly see code like this:
>
> byte[] c = new byte[a.length + b.length];
> System.arraycopy(a, 0, c, 0, a.length);
> System.arraycopy(b, 0, c, a.length, b.length);
>
> which only works for bytes (in this case).
>

-- 
-- 
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: Socket.IO and Clojure?

2013-07-20 Thread Anand Prakash
This is an awesome discussion. Hope this leads to some good frameworks in 
the community.

I was looking at Socket.IO webpage and they seem to support the following:
Websocket, Adobe Flash Socket, AJAX long polling, AJAX multipart streaming, 
Forever Iframe, JSONP polling.

I understand some people are not comfortable with Websockets, because if 
the early stage of this technology.
So there are two time of use-cases:
a. pseudo real time - e.g. chat apps - they should all be fine with polling 
and long poll is an optimization.
b. real-time - e.g. multi player games, stock ticker etc - they would need 
some kind of socket.

To answer Sean's question - I understand there are benefits with the 
socket.io client library. However you said that you do not want to go for 
Websockets. So if that is the case, isn't AJAX long polling sufficient for 
you. If that is the case then no client side library is required. You just 
need to keep polling from the client. It's server's choice with it wants 
return right away or implement long-poll.
I am new to this space - so just try to make sure if I am missing something 
obvious.

Thanks
Anand


On Friday, July 19, 2013 2:08:38 PM UTC-7, Christopher Martin wrote:
>
> Shameless plug: I recently shared a Clojure library for WebSockets and 
> HTTP Kit: http://cljwamp.us 
>
> It provides some features similar to Socket.IO in regards to 
> pubsub/multiplexing events, and uses the WAMP spec which has several 
> multi-platform options: http://wamp.ws/implementations
>
> While clj-wamp does not support long polling, a separate solution could 
> potentially run along side it (since HTTP Kit itself supports long polling) 
> though I haven't tried this yet.
>
> This library probably isn't a good option for Sean (the OP), but might be 
> of interest for those looking into WebSockets with HTTP Kit.
>
> Cheers,
> ~Christopher Martin
>
> On Friday, July 19, 2013 1:33:51 PM UTC-4, c...@bitemyapp.com wrote:
>>
>> 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 (not 
>> multiplatform). It's not going to win you more than you'll pay in bugs and 
>> performance issues in the long run.
>>
>>

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




Re: Interest in a Full Featured Clojure Blog Engine

2013-07-20 Thread Timothy Washington
On Sat, Jul 20, 2013 at 1:13 AM, James Ashley wrote:

>
> 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 yet again, and...yeah.
> It's been kind of a "This is a fairly interesting project to introduce
> yourself to the language, but is it *really* worth doing yourself?" thing
> for me.
>
> For me, the answer (so far) has been "That looks fun, and I'd like to be a
> contributor, but I just don't have time to tackle it now...maybe next
> weekend."
>
> So, anyway, before I disagree below, I'll add a basic +1. (For whatever my
> lurker n00b opinion might be worth).


Too right. I get this way too.



> On Friday, July 19, 2013 2:53:30 PM UTC-5, frye wrote:
>
>> 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 unified. Plus, a function, like export, could
>> also be a URL. So I wouldn't want to tie core resources to the concept of
>> Http URLs. Even though they may map neatly to stefon's actions. Thoughts ?
>>
>
> Isn't that basically the point to a URL?
> Especially when you consider the basic REST principles? *Someone* will
> want a RESTful blog eventually. Even if that's "just" a plugin, keeping
> those ideas in mind from the beginning seems like a wise practice. I
> haven't worked on a project yet where anyone ever wished that we hadn't
> invested in that up front. Though it's been far more common that we didn't,
> so it's mostly been a matter of trying to deal with the pain of replicating
> it later.
>
> I don't actually have a clue what you have in mind for stefon's actions.
> So maybe I'm actually agreeing with you.
>
> I apologize if this isn't coherent...it's been a long, brutal day. I saw
> this thread this morning, and this is the first chance I've had to respond
> (after I'm totally exhausted).
>

So wrt the core domain models and CRUD+ library functions. I want that to
be something that a user can load up in her repl, and start adding and
manipulating content. Wrapped around that will be the core service layer,
with an identifier very much resembling a resource. That's what I'm
imagining the plug-in layer would expose. Plugged into that core service,
could be a Web UI component, who's RESTful locations should map neatly to
the actions / locations / whatever, that the core service exposes. So for
that core service, I'll probably be taking cues from REST as an
architectural style.



> Regards,
> James
>

Cheers
Tim :)

-- 
-- 
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: Socket.IO and Clojure?

2013-07-20 Thread Christopher Martin
Shameless plug: I recently shared a Clojure library for WebSockets and HTTP 
Kit: http://cljwamp.us 

It provides some features similar to Socket.IO in regards to 
pubsub/multiplexing events, and uses the WAMP spec which has several 
multi-platform options: http://wamp.ws/implementations

While clj-wamp does not support long polling, a separate solution could 
potentially run along side it (since HTTP Kit itself supports long polling) 
though I haven't tried this yet.

This library probably isn't a good option for Sean (the OP), but might be 
of interest for those looking into WebSockets with HTTP Kit.

Cheers,
~Christopher Martin

On Friday, July 19, 2013 1:33:51 PM UTC-4, c...@bitemyapp.com wrote:
>
> 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 (not 
> multiplatform). It's not going to win you more than you'll pay in bugs and 
> performance issues in the long run.
>
>

-- 
-- 
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: Socket.IO and Clojure?

2013-07-20 Thread Anand Prakash
BTW one more thing. If I am building anything serious. Anything which might 
be user facing and could potentially be used by even thousands of users, I 
would never consider Socket.IO. I just feel that it's a super hack which 
tries to do too many things with no guarantees on anything.

On Saturday, July 20, 2013 3:50:31 PM UTC-7, Anand Prakash wrote:
>
> This is an awesome discussion. Hope this leads to some good frameworks in 
> the community.
>
> I was looking at Socket.IO webpage and they seem to support the following:
> Websocket, Adobe Flash Socket, AJAX long polling, AJAX multipart 
> streaming, Forever Iframe, JSONP polling.
>
> I understand some people are not comfortable with Websockets, because if 
> the early stage of this technology.
> So there are two time of use-cases:
> a. pseudo real time - e.g. chat apps - they should all be fine with 
> polling and long poll is an optimization.
> b. real-time - e.g. multi player games, stock ticker etc - they would need 
> some kind of socket.
>
> To answer Sean's question - I understand there are benefits with the 
> socket.io client library. However you said that you do not want to go for 
> Websockets. So if that is the case, isn't AJAX long polling sufficient for 
> you. If that is the case then no client side library is required. You just 
> need to keep polling from the client. It's server's choice with it wants 
> return right away or implement long-poll.
> I am new to this space - so just try to make sure if I am missing 
> something obvious.
>
> Thanks
> Anand
>
>
> On Friday, July 19, 2013 2:08:38 PM UTC-7, Christopher Martin wrote:
>>
>> Shameless plug: I recently shared a Clojure library for WebSockets and 
>> HTTP Kit: http://cljwamp.us 
>>
>> It provides some features similar to Socket.IO in regards to 
>> pubsub/multiplexing events, and uses the WAMP spec which has several 
>> multi-platform options: http://wamp.ws/implementations
>>
>> While clj-wamp does not support long polling, a separate solution could 
>> potentially run along side it (since HTTP Kit itself supports long polling) 
>> though I haven't tried this yet.
>>
>> This library probably isn't a good option for Sean (the OP), but might be 
>> of interest for those looking into WebSockets with HTTP Kit.
>>
>> Cheers,
>> ~Christopher Martin
>>
>> On Friday, July 19, 2013 1:33:51 PM UTC-4, c...@bitemyapp.com wrote:
>>>
>>> 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 (not 
>>> multiplatform). It's not going to win you more than you'll pay in bugs and 
>>> performance issues in the long run.
>>>
>>>

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




Re: Interest in a Full Featured Clojure Blog Engine

2013-07-20 Thread Timothy Washington
Cool. I'm very open to any help you can offer. Right now, I'm working
through:


   - if / how to attach assets (images, etc) to .rtf or .md file formats (see
   
here
   )
   - how to cleanly model entity relationships, beyond just nested maps; I
   like the Datomic schema approach, and am wondering if:


   1. I can just use their entity relationship approach as an in-memory
  library
  2. later take those entity relationships, and spit out i) relational
  data ii) mongo data, etc (not just using SQL as Datomic's storage, but
  having a 3rd party client be able to read the output data structure )


   - what I should use to model workflow; possibly
lamina
   ?
   - what's the best interface & messages to pass between the core service
   and plug-ins; I'm thinking of the
nreplprotocol, but I need to
work out:


   1. communication between plug-ins
  2. way to list possible actions (namespace qualify action names)
  3. way to publish actions
  4. way for core service to listen for messages from a plug-in
  5. way to pass binary data (asset(s)) between stefon and plug-in


I think the next week or so will be investigating this list. It represents
most of the hurdles I see in getting a successful core / plug-in
architecture running. Insight or expertise on any of these points is very
welcome.


Cheers

Tim Washington
Interruptsoftware.ca / Bkeeping.com



On Sat, Jul 20, 2013 at 1:31 PM, Manuel Paccagnella <
manuel.paccagne...@gmail.com> wrote:

> Interesting +1
>
> I've slammed together some quick and dirty Clojure code and wrote my own
> little blog engine (I'll not link the repo, the code is... well
> quick&dirty: I needed something running quickly). But it has the bare
> minimum and I didn't find any real feature complete blog engine as the one
> you are proposing. An engine designed with a "clojuresque" vision behind
> its architecture (simple, modular, extensible, and made of composable
> pieces) would be very interesting to see come to life.
>
> I'll read through the comments and hopefully add something when this
> headache will give me a break. I'm about to begin writing a prototype
> system for my dayjob, but I'd like to help you in this endeavour (I hope
> I'll have the time to do that).
>
> Cheers,
> Manuel
>
>

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




Introducing a new SQL migration library for clojure / jdbc

2013-07-20 Thread Chris Kuttruff
When starting a project to create a clojure blog with 
ring/compojure/hiccup, I quickly found myself looking for an SQL migration 
library to use.

There are some interesting projects out there, but I found myself wanting 
the following features:

   - A standard up/down migration method setup (so I could execute multiple 
   migrate/rollback statements within a clojure file)
   - The ability to execute arbitrary SQL (including creation of 
   triggers/stored procedures)
   - A generic structure to support as many databases as possible
   - A simple create method (to generate migration files)

I have used other migration setups (eg: rails), and was looking for 
something similar in terms of features and simplicity of usage.

The following leiningen plugin is my attempt to accomplish the 
aforementioned objectives as simply as possible:

https://github.com/ckuttruff/clj-sql-up

I am new to clojure / leiningen, so any suggestions / feedback would be 
much appreciated.  It's still very much a work in progress; I plan to add 
many more tests, clean up some of the repetition/inelegance, and make 
various aspects more generic.

Thanks for your time and consideration; I hope this library can be of use 
to others.

-Chris

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




Re: Introducing a new SQL migration library for clojure / jdbc

2013-07-20 Thread Plínio Balduino
Thank you, Chris

I think it will be very useful for my next project.

Regards

Plínio

On Sat, Jul 20, 2013 at 7:19 PM, Chris Kuttruff  wrote:

> When starting a project to create a clojure blog with
> ring/compojure/hiccup, I quickly found myself looking for an SQL migration
> library to use.
>
> There are some interesting projects out there, but I found myself wanting
> the following features:
>
>- A standard up/down migration method setup (so I could execute
>multiple migrate/rollback statements within a clojure file)
>- The ability to execute arbitrary SQL (including creation of
>triggers/stored procedures)
>- A generic structure to support as many databases as possible
>- A simple create method (to generate migration files)
>
> I have used other migration setups (eg: rails), and was looking for
> something similar in terms of features and simplicity of usage.
>
> The following leiningen plugin is my attempt to accomplish the
> aforementioned objectives as simply as possible:
>
> https://github.com/ckuttruff/clj-sql-up
>
> I am new to clojure / leiningen, so any suggestions / feedback would be
> much appreciated.  It's still very much a work in progress; I plan to add
> many more tests, clean up some of the repetition/inelegance, and make
> various aspects more generic.
>
> Thanks for your time and consideration; I hope this library can be of use
> to others.
>
> -Chris
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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: Proposed change to let-> syntax

2013-07-20 Thread Korny Sietsma
It'd be better, when coming up with great ideas, if you didn't reply to
15-month-old threads as if they were recent! It makes for very confusing
reading in most mail clients. Better to start a new thread, if you feel
like the discussion is still relevant.

- Korny
On 19 Jul 2013 22:28, "Daniel Dinnyes"  wrote:

> 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 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 these get, and keeps it physically obvious what
>> is
>> > considered The Core.
>>
>> https://github.com/clojure/**core.incubator
>>
>> Cheers,
>> Michał
>>
>  --
> --
> 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: Interest in a Full Featured Clojure Blog Engine

2013-07-20 Thread Chris Allen
http://github.com/bitemyapp/neubite/

Could probably use a WYSIWYG editor, beyond that, pretty serviceable.

On Thursday, July 18, 2013 7:24:06 AM UTC-7, frye wrote:
>
> Hello, 
>
> I'm thinking of how to build a composable blogging engine in Clojure. 
> There have been a few attempts at this, with 
> cow-blogand 
> my-blog . But these seem to be 
> abandoned, and not heavily used. Vijay Kiran, last year, even wrote a 
> series of blog posts (see 
> here)
>  
> about building a blog engine. As far as a list of posts goes, the data 
> structure for each record was simple: 
>
>- title
>- content
>- status
>- created-date
>- published-date
>- author 
>
>
> I think this is the most basic thing you could do, to get running. But I'm 
> thinking of approaching the feature set of 
> Wordpress. 
> So I'm thinking of the Data Structure(s) of features like: 
>
>- Web UI component; wyswyg editor, themes  
>- Server component; embeddable in Compojure or Pedestal 
>- Database component; 
>- raw data structures, txt, rtf, images, audio, videos, documents 
>   - adapters for Datomic, SQL(Postgres, etc), NoSQL (Mongo, etc)
>   - tags / categories for content 
>- Authentication & Authorization; OpenID 
>- Workflow component; preview, collaboration & editor review  
>- Commenting component; default or an external comments service, like 
>disqus  or discourse 
>- Administration Console
>- Plug-in support  
>- Import / Export 
>- Multi-lang / Internationalization 
>
>
> I know that I currently wish I had a Clojure weblog engine that I could 
> stick into a site I'm building. If there's already something available, 
> I'll obviously just use that. But otherwise, is this something that would 
> be interesting to people? 
>
>
> Thanks 
>
> Tim Washington 
> Interruptsoftware.ca / Bkeeping.com 
> 416.843.9060 
>
>  

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