Re: ANN: ClojureScript release 0.0-1798

2013-06-28 Thread buze3000
Hey David,

just noticed this exception when switching back to :whitespace 
optimizations but still having the :source-map entry active:

https://www.refheap.com/16171

After removing the :source-map from the project.clj compilation failed with 
this exception:

https://www.refheap.com/16172

After running `lein cljsbuild clean` everything went back to normal.

Cheers,
Gerrit


Am Mittwoch, 26. Juni 2013 13:35:55 UTC+2 schrieb David Nolen:
>
> That's great to hear. Will update documentation in the appropriate places.
>
>
> On Wed, Jun 26, 2013 at 4:01 AM, >wrote:
>
>> Not sure why my previous post was deleted but anyway.
>>
>> Yeah, the source map didn't work as I've seen on some screenshots in 
>> tutorials, but the line numbers alone were good enough and very useful for 
>> finding that incompatible line.
>>
>> Documentation would definitely help as crawling through the commits 
>> trying to find a usage and then reading the lein-cljsbuild source to figure 
>> out if it can be enabled like that is a bit tedious :)
>>
>> Gerrit
>>
>> Am Mittwoch, 26. Juni 2013 05:11:23 UTC+2 schrieb David Nolen:
>> > I recall it adding a significant amount of time to advanced compilation 
>> so I'm not sure that's such a good idea as a default. But documenting and 
>> advertising its existence in the proper places seems like a good idea.
>> >
>> >
>> >
>> > David
>> >
>> >
>> >
>> > On Tue, Jun 25, 2013 at 11:07 PM, Brandon Bloom  
>> wrote:
>> >
>> > Even if it's horribly broken, maybe we should default it to on for 
>> advanced builds anyway? It's not like anything can be harder to debug than 
>> raw advanced compilation output. Besides, we might get some more interest 
>> and contributions if it *feels* like it's close!
>> >
>> >
>> >
>> > On Tuesday, June 25, 2013 7:37:28 PM UTC-4, David Nolen wrote:
>> >
>> > Wow, really? I didn't really consider it usable yet as we don't emit 
>> quite enough information for mapping symbols.
>> >
>> >
>> >
>> >
>> >
>> > On Tue, Jun 25, 2013 at 7:14 PM,   wrote:
>> >
>> >
>> > Thanks a lot for the source map support. Made it possible for me to 
>> find the cause of my broken advanced compiled cljs. Without the source map 
>> I was totally lost...
>> >
>> >
>> >
>> >
>> >
>> > In case anybody wonders how to enable it:
>> >
>> >
>> >
>> > Just add a :source-map "path/to/js/folder/source-map-name.js.map" key 
>> value pair to the :compiler map of your :cljsbuild map.
>> >
>> >
>> >
>> > --
>> >
>> >
>> > --
>> >
>> > 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 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 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 

Re: Detecting login and logout using friend

2013-06-28 Thread Steve Buikhuizen
I'll answer my own question here for future reference value.

I found a much cleaner way was to create a wrapper type (deftype) for the 
ring session store impl. It is a simple delegating wrapper but it sees the 
correct cookies, regardless of the servlet container.

It has the disadvantage of not having access to the ring request so 
recording user-agent etc is not possible. I solved this by using middleware 
to record that in a subsequent request. 

Here's what the wrapper looks like, feedback is welcome if you have it...

(deftype SessionStoreWrapper [store]

  rss/SessionStore

  (read-session [_ session-key]

(rss/read-session store session-key))

  (write-session [_ session-key data]

(let [key-written (rss/write-session store session-key data)]

  ;; ::session-recorded means middleware below has upserted user-agent, 
ip-address etc

  (when (and (not (::session-attributes-recorded data)) (
:cemerick.friend/identity data))

(let [current-auth (get-in data [:cemerick.friend/identity :current]
)

  user-id (get-in data [:cemerick.friend/identity 
:authentications current-auth :id])] 

  (debug "upserting session: " key-written " -> " user-id)

  (try 

 (session/upsert-session user-id key-written nil nil :logged-in)

  (catch Throwable t

(error t "record login failed")

  key-written))

  (delete-session [_ session-key]

(debug "logging out: " session-key)

(try 

  (session/logout-session session-key)

  (catch Throwable t

(error t "record logout failed")))

(rss/delete-session store session-key)))

-- 
-- 
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: I'm starting to wonder if I'm the only person using clooj ...

2013-06-28 Thread Rich Morin
On Jun 27, 2013, at 21:53, Arthur D. Edelstein wrote:
> Thanks again to both of you for your comments, suggestions, and bug
> reports.  Cedric's recent observations on clooj are very helpful and I
> do hope to fix some of the problems soon.  Sorry I've been unable to
> maintain clooj at a reasonable pace.


Like Lee, I have neither the time nor the skills to maintain and extend
Clooj.  However, I have been very interested in it since I attended the
talk at baclojure some time back.  I like many of the ideas and really
want to see IDE tools that have shallow learning curves, embrace online
documentation, etc.  So, please count me as another interested party.

That said, I'm also very interested in Light Table, which appears to be
developing rapidly into an open framework for IDE experimentation.  So,
I'm wondering whether it might be easier and more productive (over the
long term) to create some "simple" LT add-ons than to maintain Clooj.

One possible benefit of this approach is that it might fit in nicely
with the work that is being done on Codeq: perhaps Codeq could be used
to cache and augment some of the information that Clooj provides.

In any case, kudos to Arthur for creating something novel and cool...

-r

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

Software system design, development, and documentation


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




Re: Looking for Clojure freelancers

2013-06-28 Thread Peter Taoussanis
Hi Xavi, thanks for getting in touch. Really sorry for taking forever to
get back to you about this!

I've got your details on file now (thanks for that!). Will get in touch if
any projects come up for which I think I could use you. In that case I'll
send you an email with the project details (what I need, what the timeframe
is, payment info, etc.) - and you can get back to me if you're interested.

All the best, cheers!


On 5 June 2013 04:57, xavi  wrote:

> Hi Peter,
>
> (I'm going to follow your suggestion and reply publicly.)
>
> I would be interested in collaborating with you. You'll find my contact
> details and a summary of my experience in xavi.caballe.pro .
>
> I come from the Rails world (I'm also an ex-Objective-C, ex-Java, and
> ex-Perl developer). I still work with Rails but my current language of
> choice is Clojure.
>
> My main open-source contribution is noir-auth-app, a base web app with
> authentication, https://github.com/xavi/noir-auth-app . This is a
> byproduct of a side-project that I'm developing in Clojure. Also, recently
> I worked for a month in an all-Clojure shop doing the full-stack
> development (Clojure + ClojureScript + Datomic) of a new feature.
>
> I'm more a generalist and I am happy working both in the back-end and the
> front-end. As for databases, I'm comfortable with SQL, but with Clojure
> I've only worked with MongoDB and Datomic for now.
>
> I'm based in Barcelona and my rate is €25/hr but I'm open to negotiate it.
>
> Cheers!
>
> Xavi Caballé
> http://xavi.caballe.pro
>
>
> On Monday, June 3, 2013 1:38:20 PM UTC+2, Peter Taoussanis wrote:
>>
>> Hi all,
>>
>> From time to time I have need for one or two extra hands (or, would that
>> be pairs of hands?) on larger projects. Specifically, am looking for
>> Clojure developers that'd be interested in occasional adhoc/freelance
>> development work.
>>
>> Most of my work is on the web application side, but it can vary.
>>
>> What I'd like to ask is this: if anyone's interested, drop me an email 
>> (*ptaoussanis
>> at taoensso.com*) with some basic info including:
>>
>>- Contact details (would prefer an international telephone number
>>also if possible).
>>- Your experience / informal CV (open-source stuff is my preferred
>>reference, especially if it's Clojure-based).
>>- Any particular areas of interest/expertise (e.g. you especially
>>want to work with Datomic, backend services, Clojurescript, whatever).
>>- Your rate + how negotiable it'd be and/or how it'd scale with
>>longer-term jobs.
>>
>> I can then keep your details on file and give an occasional shout if
>> something comes up that I could potentially use you for.
>>
>> Whole thing'd be about as informal as it gets: terms will vary based on
>> the particular job, but I'll include all of that in the email so you can
>> decide if/when something grabs your fancy.
>>
>> Cheers!
>>
>> - Peter (taoensso.com )
>>
>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Clojure" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/DNWXn8gi-Wg/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
*Peter Taoussanis*
ptaoussa...@gmail.com
taoensso.com 

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




Re: Pure/deterministic functions, as values in the compiler

2013-06-28 Thread Chris Bilson
emporas  writes:

emporas  writes:

> Now that the practice of applying collision resistant hashes (ie
> unique strings), to save multiple
> versions of structures with the possibility of overlapping, is
> becoming less deficient thanks to better
> hardware, i am wondering if there is a compiler in lisp or anything
> else, that has the ability to save
> multiple versions of functions, that operate only on their arguments,
> better known as deterministic or
> pure functions.

[...]

> Does anyone know if there is any work in that area, such as compilers,
> academic papers or am i horribly disguided?

At one of our Seajure[1] meetings, we did something very vaguely like
what you're talking about, "metaverse"[2].

It works at the namespace level, by defining a new `ns' macro and . This was
one of my favorite "wow..." moments at Seajure, so I remember it well. I
love working in a language where how something as core as namespaces
works is open for discussion.


---

[1]: Seattle Clojure Users Group, http://seajure.github.io/
[2]: https://github.com/Seajure/metaverse

-- 
-- 
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: New Fuzzy Matching Library - Fuzzy Matcher

2013-06-28 Thread Smit Shah
Hey there,

Thank you so much for all the feedback, I really appreciate that you took 
the time to review you my code!

I have made few changes since then let me address them,

1)  I am aware of the bottom up dynamic algorithm for edit distance (using 
two dimensional array as a table), I just didn't know enough Clojure 
implement something like that (without mutation). That's why I picked the 
top down algorithm with memoization because it was functional and easier to 
implement in Clojure.

I agree with your points, unbounded memo would just not work in a long 
running program/process as it will eat up all the memory. To tackle that I 
have used a memoized with LU strategy for now (with 5k threshold value). 

https://github.com/Who828/fuzzy_matcher/commit/9643ad245f13d07e8e5b213b8597127d8f5d1913

I am grateful for the code example you have shown me, I will go over it 
this weekend and change my algorithm to the bottom up dynamic programming 
version. It would be a great opportunity for me to learn more about Clojure 
as well :)


2) Yes, I don't know what I was thinking when I implemented that search 
function. I took your advice and refactored it,

https://github.com/Who828/fuzzy_matcher/commit/33c1e0b0e6c4c9ba376b9df14a04ed22a3b526c1

Please have a look.

Again thank you so much for the feedback, please let me know if you have 
more feedback or any API/algorithm request for the library.

On Thursday, 27 June 2013 23:09:09 UTC+5:30, Jim foo.bar wrote:
>
>  Hi again,
>
> I see you have implemented your 'search' fn like this:
>
>   
>
> (defn search [word lst & {:keys [n rank] :or {n 15 rank 2}}]
>   "Get a list of words based on the minimum distance"
>   (let [ranked-words (apply hash-map
> (mapcat (fn [x] [x (edit-distance word x)]) lst))]
> (take n (keys (sort-by val < (filter #(<= (second %) rank)
>   
> ;   ranked-words))
>
>
>
>
>
>
> You must have been very tired when you wrote this, weren't you? I bet if 
> you sit down with a clean head you'll find a much simpler way of doing 
> this...many people will hopefully agree...allow me to poke your brain :)
>
> Forget the above fn for a second...fundamentally, given a string and a 
> list of other strings you're looking *to keep only the strings* (from the 
> list) whose edit-distance (with respect to that first string) is lower or 
> equal to some tolerance value. If we generalise it a bit,  you're looking 
> to *filter* in, all the elements that match some predicate.  I'm not 
> giving you the answer but I hope it's pretty obvious now that it is 
> half-a-line of code :)
>
> I would perhaps add that the '(take n...' is not needed there as it is the 
> client's job to consume whatever he needs, but if you consider it 
> nitpicking, well, I can see your point... :)
>
> this is all in the spirit of wanting to help...
>
> Jim
>
>
>
>
> On 27/06/13 10:55, Jim wrote:
>  
> Hi Smit,
>
> I hope you don't mind a couple of comments :)
>
> I had a look at your edit-distance implementation and you've not followed 
> the recommended approach found in various textbooks (dynamic-programming) 
> and that's probably why you resorted to memoization...
>
> You see, trying your code without memoization does not perform very 
> well...In fact, for strings larger than 8-9 characters your code needs 
> nearly 10 seconds!!! Also, unrestricted memoization is not really a viable 
> option here. If you were to do any serious work (on a large corpus for 
> instance), you'll find that your memory will keep increasing up to the 
> point where your heap will fill up...
>
>
> So, I can suggest 2 things for you...if you want to keep the 'naive' 
> levenhstein-distance version,  a more clever memoization strategy is what I 
> 'd go for in order to avoid filling up your cache in a real 
> program...However, if you want to do it the right way, which will get rid 
> of your memoization needs, I suggest you look at my hotel_nlp project, in 
> the 'algorithms' namespace: 
>
>  
> https://github.com/jimpil/hotel-nlp/blob/master/src/hotel_nlp/algorithms/levenshtein.clj
>
> One thing that you might find confusing is these 2 let bindings:
>
> m (inc (count s1)) ; do not skip the last character
> n (inc (count s2))  ; do not skip the last character
>
> I'm only doing that because my 'matrix' fn uses 'range' which excludes the 
> upper limit...I guess I could change that to be more evident...
>
> even without memoization, the dynamic-programming solution can do two 
> 16-character-long strings in just over 1ms which is pretty sweet... :)
>
> hope that helps,
>
> Jim 
>  
>
>
> On 27/06/13 05:59, Smit Shah wrote:
>  
> Hey folks, 
>
>  This is my first post on the mailing list, I would like to introduce 
> myself. I have been love with Lisp since I started reading SICP, the way 
> you express problems and decompose them it's just amazing. I always wanted 
> to build a real world application in Lisp but I never got around it 

Re: [ClojureScript] Re: ANN: ClojureScript release 0.0-1798

2013-06-28 Thread David Nolen
Thanks for the report! Please file a ticket for this in JIRA and we'll look
into it.


On Fri, Jun 28, 2013 at 3:13 AM, buze3000 wrote:

> Hey David,
>
> just noticed this exception when switching back to :whitespace
> optimizations but still having the :source-map entry active:
>
> https://www.refheap.com/16171
>
> After removing the :source-map from the project.clj compilation failed
> with this exception:
>
> https://www.refheap.com/16172
>
> After running `lein cljsbuild clean` everything went back to normal.
>
> Cheers,
> Gerrit
>
>
> Am Mittwoch, 26. Juni 2013 13:35:55 UTC+2 schrieb David Nolen:
>>
>> That's great to hear. Will update documentation in the appropriate places.
>>
>>
>> On Wed, Jun 26, 2013 at 4:01 AM,  wrote:
>>
>>> Not sure why my previous post was deleted but anyway.
>>>
>>> Yeah, the source map didn't work as I've seen on some screenshots in
>>> tutorials, but the line numbers alone were good enough and very useful for
>>> finding that incompatible line.
>>>
>>> Documentation would definitely help as crawling through the commits
>>> trying to find a usage and then reading the lein-cljsbuild source to figure
>>> out if it can be enabled like that is a bit tedious :)
>>>
>>> Gerrit
>>>
>>> Am Mittwoch, 26. Juni 2013 05:11:23 UTC+2 schrieb David Nolen:
>>> > I recall it adding a significant amount of time to advanced
>>> compilation so I'm not sure that's such a good idea as a default. But
>>> documenting and advertising its existence in the proper places seems like a
>>> good idea.
>>> >
>>> >
>>> >
>>> > David
>>> >
>>> >
>>> >
>>> > On Tue, Jun 25, 2013 at 11:07 PM, Brandon Bloom 
>>> wrote:
>>> >
>>> > Even if it's horribly broken, maybe we should default it to on for
>>> advanced builds anyway? It's not like anything can be harder to debug than
>>> raw advanced compilation output. Besides, we might get some more interest
>>> and contributions if it *feels* like it's close!
>>> >
>>> >
>>> >
>>> > On Tuesday, June 25, 2013 7:37:28 PM UTC-4, David Nolen wrote:
>>> >
>>> > Wow, really? I didn't really consider it usable yet as we don't emit
>>> quite enough information for mapping symbols.
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > On Tue, Jun 25, 2013 at 7:14 PM,   wrote:
>>> >
>>> >
>>> > Thanks a lot for the source map support. Made it possible for me to
>>> find the cause of my broken advanced compiled cljs. Without the source map
>>> I was totally lost...
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > In case anybody wonders how to enable it:
>>> >
>>> >
>>> >
>>> > Just add a :source-map "path/to/js/folder/source-map-**name.js.map"
>>> key value pair to the :compiler map of your :cljsbuild map.
>>> >
>>> >
>>> >
>>> > --
>>> >
>>> >
>>> > --
>>> >
>>> > 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 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 clo...@googlegroups.com
>>> Note that posts from new members are moderated - please be patient with
>>> your first post.
>>> To unsubscrib

Re: Latest JOGL with Clojure in Eclipse?

2013-06-28 Thread Andrew Voron
I dont know if I miss something, but after "lein deps" and trying to import 
NewtFacroty for ex. , clojure says me about absence of 
gluegen-rt-2.0.0-rc11-natives-windows-amd64.jar. All start working when I 
put this jar and native dlls into 
\.m2\repository\org\clojars\toxi\gluegen-rt\2.0.0-rc11\

I thought that all should work out of the box after "lein deps", but may be 
I do something wrong

-- 
-- 
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: Detecting login and logout using friend

2013-06-28 Thread Chas Emerick
Rather than looking at session changes (which may not capture all 
authentications, e.g. requests carrying HTTP Basic creds), why not a utility 
that composes workflow fns, squirting authentication events out the side?  Your 
app is entirely responsible for logouts (you're either calling friend/logout*, 
or using friend/logout middleware), so that should be trivial to do without 
touching the session as well.

Cheers,

- Chas

On Jun 28, 2013, at 4:25 AM, Steve Buikhuizen wrote:

> I'll answer my own question here for future reference value.
> 
> I found a much cleaner way was to create a wrapper type (deftype) for the 
> ring session store impl. It is a simple delegating wrapper but it sees the 
> correct cookies, regardless of the servlet container.
> 
> It has the disadvantage of not having access to the ring request so recording 
> user-agent etc is not possible. I solved this by using middleware to record 
> that in a subsequent request. 
> 
> Here's what the wrapper looks like, feedback is welcome if you have it...
> 
> (deftype SessionStoreWrapper [store]
> 
>   rss/SessionStore
> 
>   (read-session [_ session-key]
> 
> (rss/read-session store session-key))
> 
>   (write-session [_ session-key data]
> 
> (let [key-written (rss/write-session store session-key data)]
> 
>   ;; ::session-recorded means middleware below has upserted user-agent, 
> ip-address etc
> 
>   (when (and (not (::session-attributes-recorded data)) 
> (:cemerick.friend/identity data))
> 
> (let [current-auth (get-in data [:cemerick.friend/identity :current])
> 
>   user-id (get-in data [:cemerick.friend/identity 
> :authentications current-auth :id])] 
> 
>   (debug "upserting session: " key-written " -> " user-id)
> 
>   (try 
> 
> (session/upsert-session user-id key-written nil nil :logged-in)
> 
>   (catch Throwable t
> 
> (error t "record login failed")
> 
>   key-written))
> 
>   (delete-session [_ session-key]
> 
> (debug "logging out: " session-key)
> 
> (try 
> 
>   (session/logout-session session-key)
> 
>   (catch Throwable t
> 
> (error t "record logout failed")))
> 
> (rss/delete-session store session-key)))
> 
> 
> -- 
> -- 
> 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: I'm starting to wonder if I'm the only person using clooj ...

2013-06-28 Thread Lee Spector

On Jun 28, 2013, at 4:53 AM, Rich Morin wrote:
> 
> That said, I'm also very interested in Light Table, which appears to be
> developing rapidly into an open framework for IDE experimentation.  So,
> I'm wondering whether it might be easier and more productive (over the
> long term) to create some "simple" LT add-ons than to maintain Clooj.

Yeah -- I shouldn't have said that "nothing else in the ecosystem can touch" 
Clooj's combination of functionality and usability because I do think that 
Light Table is in the neighborhood and it's certainly super cool in many other 
ways. 

When I've considered switching to it in the past, which I think I do every 
couple of months, I've been really impressed but had a hard time seeing how to 
do some less-cool but more ordinary things... like maybe getting unadorned text 
output? Maybe something about dealing with projects? It's possible that I 
haven't given it enough time, and I know I was thinking that it seems to be 
developing quickly so I'd check back again soon...

 -Lee

-- 
-- 
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: Clojure generates unnecessary and slow type-checks

2013-06-28 Thread Mikera
On Thursday, 20 June 2013 08:45:47 UTC+1, Jason Wolfe wrote:
>
> On Saturday, June 15, 2013 4:37:06 AM UTC-7, Mikera wrote:
>>
>> On Friday, 14 June 2013 18:15:34 UTC+1, Jason Wolfe wrote:
>>
>>> Hey Mikera, 
>>>
>>> I did look at core.matrix awhile ago, but I'll take another look. 
>>>
>>> Right now, flop is just trying to make it easy to write *arbitrary* 
>>> array operations compactly, while minimizing  the chance of getting 
>>> worse-than-Java performance.  This used to be very tricky to get right 
>>> when flop was developed (against Clojure 1.2); the situation has 
>>> clearly improved since then, but there still seem to be some 
>>> subtleties in going fast with arrays in 1.5.1 that we are trying to 
>>> understand and then automate. 
>>>
>>> As I understand it, core.matrix has a much more ambitious goal of 
>>> abstracting over all matrix types.  This is a great goal, but I'm not 
>>> sure if the protocol-based implementation can give users any help 
>>> writing new core operations efficiently (say, making a new array with 
>>> c[i] = a[i] + b[i]^2 / 2) -- unless there's some clever way of 
>>> combining protocols with macros (hmmm). 
>>>
>>
>> A longer term objective for core.matrix could be to allow compiling such 
>> expressions. Our GSoC student Maik Schünemann is exploring how to represent 
>> and optimised mathematical expressions in Clojure, and in theory these 
>> could be used to compile down to efficient low-level operations. API could 
>> look something like this:
>>
>> ;; define an expression
>> (def my-expression (expression [a b] (+ a (/ (* b b) 2
>>
>> ;; compile the expression for the specified matrix implementation A
>> (def func (compile-expression A my-expression)). 
>>
>> ;; now computation can be run using the pre-compiled, optimised function
>> (func A B)
>>
>> In the case that A is a Java double array, then perhaps the flop macros 
>> could be the engine behind generating the compiled function?
>>
>>  
>>
>>> I just benchmarked core.matrix/esum, and on my machine in Clojure 
>>> 1.5.1 it's 2.69x slower than the Java version above, and 1.62x slower 
>>> than our current best Clojure version.
>>>
>>
>> Great - happy to steal your implementation :-) 
>>
>> Other core.matrix implementations are probably faster BTW: vectorz-clj is 
>> pure Java and has esum for the general-purpose Vector type implemented in 
>> exactly the same way as your fast Java example. Clatrix executes a lot of 
>> operations via native code using BLAS.
>>
>
> I should follow up on this and clarify that core.matrix's esum is in fact 
> as fast as Java -- I apologize for the false statement (I was unaware that 
> new versions of leiningen disable advanced JIT optimizations by default, 
> which lead to the numbers I reported).
>
> Nevertheless, I hope there may be room for interesting collaboration on 
> more complex operations, or code gen as you mentioned.  I'll follow up 
> later when we're a bit further along.
>  
>

Great thanks for confirming, I was getting worried :-)

On the topic of code gen, we've been thinking a bit about how to represent 
expressions in the expresso project, and are developing a few potential use 
case API examples.

https://github.com/clojure-numerics/expresso/wiki/User-API-examples

If anyone has any additional use cases to think about, then please throw 
them in!
 

-- 
-- 
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: Adding implicit indexing to Clojure lists and arrays?

2013-06-28 Thread Mikera
Mike or mikera is fine :-)

If you wanted to provide this kind of functionality, I'd normally suggest 
doing it with a protocol. Something like:

(defprotocol PWrappedIndex
  (get-wrapped [coll index]))

(extend-protocol PWrappedIndex
 clojure.lang.Indexed
   (get-wrapped [coll index] (nth coll (mod index (count coll)

(get-wrapped [0 1 2 3 4 5 6 7 8 9] -2)
=> 8

This is incidentally the same technique that core.matrix uses to extend a 
common matrix API to arbitrary matrix types.

On Thursday, 27 June 2013 23:00:48 UTC+1, Greg Slepak wrote:
>
> Thanks Mike (or do you go by "Mikera" as your email alias suggests?),
>
> I think you make very good points, so I withdraw my request.
>
> I'm curious though... Just as a learning experience, would it be possible 
> to "tack on" such syntax implicit indexing and slicing using Clojure's 
> extend-type function?
>
> Thanks,
> Greg
>
> On Jun 27, 2013, at 6:45 AM, Mikera > 
> wrote:
>
> I agree that negative indexing (and presumably also modulo indexing for 
> the upper index?) is very useful. Stuff like this comes up all the time in 
> core.matrix
>
> However I don't think it makes sense as a standard feature in Clojure's 
> low-level data constructs for several reasons:
> a) It's a breaking change for people who are handling out-of-bounds cases
> b) In new code it will mask out-of-bounds errors, which can conceal some 
> nasty bugs
> c) Cramming more implicit features into existing constructs is a bad idea 
> in general: explicit is better
> d) It probably adds a small performance overhead. Not worth making 
> everyone pay a cost for one special case feature
>
> This kind of thing is IMHO better handled by either wrapping the vector in 
> a function, or creating some kind of extra collection wrapper that provides 
> the negative indexing functionality.
>
> On Thursday, 27 June 2013 04:19:24 UTC+1, Michael-Keith Bernard 
> (SegFaultAX) wrote:
>
>> Vectors and maps are already functions of their indices and keys, 
>> respectively. I don't really think it makes sense for other sequence types 
>> (seqs, lists, etc.) because they aren't naturally associative in the same 
>> way. Finally, there isn't a Clojure form I'm aware of that allows negative 
>> indices in the same way eg Python does, but I for one would find that 
>> incredibly useful.
>>
>
>> On Wednesday, June 26, 2013 8:01:02 PM UTC-7, Greg Slepak wrote:
>>>
>>> There is one feature that I really miss from newLISP and seems like it 
>>> could be a natural extension to Clojure, and that is implicit indexing for 
>>> lists and arrays.
>>>
>>> Clojure already has something similar in its use of keywords to act as 
>>> functions that look themselves up in a map.
>>>
>>> This is basically the same concept, but using numbers instead. Implicit 
>>> indexing creates a really elegant syntax for finding elements and ranges in 
>>> a list or array. Here's an example:
>>>
>>> > (setf mylist '(a b c d e f g))
>>> (a b c d e f g)
>>> > (mylist 0)
>>> a
>>> > (mylist -1)
>>> g
>>> > (0 3 mylist)
>>> (a b c)
>>>
>>>
>>> Has this been considered already? Would this be something that could be 
>>> added to the language syntax?
>>>
>>> Thanks for your consideration!
>>>
>>> Sincerely,
>>> Greg
>>>
>>
> -- 
> -- 
> 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: I'm starting to wonder if I'm the only person using clooj ...

2013-06-28 Thread Gary Trakhman
I wanted to try out 0.4.1 on my desktop, is there a trick to getting it to
run on windows?  It errored out with something that looked like
OSX-specific AWT usage.  I can look at it more deeply some time.


On Fri, Jun 28, 2013 at 10:06 AM, Lee Spector wrote:

>
> On Jun 28, 2013, at 4:53 AM, Rich Morin wrote:
> >
> > That said, I'm also very interested in Light Table, which appears to be
> > developing rapidly into an open framework for IDE experimentation.  So,
> > I'm wondering whether it might be easier and more productive (over the
> > long term) to create some "simple" LT add-ons than to maintain Clooj.
>
> Yeah -- I shouldn't have said that "nothing else in the ecosystem can
> touch" Clooj's combination of functionality and usability because I do
> think that Light Table is in the neighborhood and it's certainly super cool
> in many other ways.
>
> When I've considered switching to it in the past, which I think I do every
> couple of months, I've been really impressed but had a hard time seeing how
> to do some less-cool but more ordinary things... like maybe getting
> unadorned text output? Maybe something about dealing with projects? It's
> possible that I haven't given it enough time, and I know I was thinking
> that it seems to be developing quickly so I'd check back again soon...
>
>  -Lee
>
> --
> --
> 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: I'm starting to wonder if I'm the only person using clooj ...

2013-06-28 Thread Plinio Balduino
Hi there

I sent a pull request fixing this Apple lib issue.

https://github.com/arthuredelstein/clooj/pull/119

I'm not in Clooj list and never heard about before, but it sounds like an 
awesome project.

Regards

Plínio

On Thursday, June 27, 2013 11:05:56 PM UTC-3, Cedric Greevey wrote:
>
> I'm starting to wonder if I'm the only person using clooj ... the clooj 
> list is very quiet lately, and I'm getting the uncomfortable feeling that 
> my notes and bug reports are falling on deaf ears.
>  

-- 
-- 
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: I'm starting to wonder if I'm the only person using clooj ...

2013-06-28 Thread Gary Trakhman
Happens on linux too:
gary@gary-dell:~/dev$ java -jar ~/Downloads/clooj-0.4.1-standalone.jar
#
java.lang.ClassNotFoundException: com.apple.eawt.FullScreenUtilities
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:188)
at clooj.core$startup$fn__323.invoke(core.clj:753)
at clooj.core$startup.invoke(core.clj:753)
at clooj.core$_main.doInvoke(core.clj:778)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at clojure.lang.AFn.applyToHelper(AFn.java:159)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clooj.core.main(Unknown Source)



On Fri, Jun 28, 2013 at 11:49 AM, Plinio Balduino wrote:

> Hi there
>
> I sent a pull request fixing this Apple lib issue.
>
> https://github.com/arthuredelstein/clooj/pull/119
>
> I'm not in Clooj list and never heard about before, but it sounds like an
> awesome project.
>
> Regards
>
> Plínio
>
>
> On Thursday, June 27, 2013 11:05:56 PM UTC-3, Cedric Greevey wrote:
>>
>> I'm starting to wonder if I'm the only person using clooj ... the clooj
>> list is very quiet lately, and I'm getting the uncomfortable feeling that
>> my notes and bug reports are falling on deaf ears.
>>
>  --
> --
> 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: I'm starting to wonder if I'm the only person using clooj ...

2013-06-28 Thread Plínio Balduino
Yup. It's the same problem. That lib is only available on OSX.

On Fri, Jun 28, 2013 at 1:04 PM, Gary Trakhman  wrote:
> Happens on linux too:
> gary@gary-dell:~/dev$ java -jar ~/Downloads/clooj-0.4.1-standalone.jar
> #
> java.lang.ClassNotFoundException: com.apple.eawt.FullScreenUtilities
> at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:188)
> at clooj.core$startup$fn__323.invoke(core.clj:753)
> at clooj.core$startup.invoke(core.clj:753)
> at clooj.core$_main.doInvoke(core.clj:778)
> at clojure.lang.RestFn.invoke(RestFn.java:397)
> at clojure.lang.AFn.applyToHelper(AFn.java:159)
> at clojure.lang.RestFn.applyTo(RestFn.java:132)
> at clooj.core.main(Unknown Source)
>
>
>
> On Fri, Jun 28, 2013 at 11:49 AM, Plinio Balduino 
> wrote:
>>
>> Hi there
>>
>> I sent a pull request fixing this Apple lib issue.
>>
>> https://github.com/arthuredelstein/clooj/pull/119
>>
>> I'm not in Clooj list and never heard about before, but it sounds like an
>> awesome project.
>>
>> Regards
>>
>> Plínio
>>
>>
>> On Thursday, June 27, 2013 11:05:56 PM UTC-3, Cedric Greevey wrote:
>>>
>>> I'm starting to wonder if I'm the only person using clooj ... the clooj
>>> list is very quiet lately, and I'm getting the uncomfortable feeling that my
>>> notes and bug reports are falling on deaf ears.
>>
>> --
>> --
>> 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.
>
>

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




[UPDATE] sublime-lispindent, clojure indenting for sublime text 2/3

2013-06-28 Thread Jonathan Fischer Friberg
Hi,

This is a message to announce that sublime-lispindent has recently received
an update. If you don't know what it is, check out the github page:
https://github.com/odyssomay/sublime-lispindent

The updates are:

* Improved string/comment handling. Previously, lispindent tried to guess
whether something was inside a string/comment or not. The biggest problems
came in the form of semicolons inside strings (which easily arises when
writing clojurescript) combined with the fact that clojure strings can span
multiple lines. The new implementation uses the syntax itself (from the
editor) to determine where strings/comments are. This is not without it's
own problems - if a string is not highlighted as a string, lispindent will
not consider it being a string.

* Activate lispindent on syntax - if the file is using clojure syntax,
lispindent is used for indenting. Previously only the file ending
determined if lispindent was used or not.

* Vintage integration. Vintage is a vim-like mode for sublime text and
comes with it's own shortcuts for reindenting etc. Previously it would use
the default indentation, but now it uses lispindent instead.

That's about it, I hope you enjoy using lispindent! :)

If you have any problems, do not hesitate to open an issue on github:
https://github.com/odyssomay/sublime-lispindent

Jonathan

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




core.async

2013-06-28 Thread Rich Hickey
I've blogged a bit about the new core.async library:

http://clojure.com/blog/2013/06/28/clojure-core-async-channels.html

Please try it out.

Thanks,

Rich

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




Re: core.async

2013-06-28 Thread David Nolen
Excellent!

I've been playing around the ClojureScript support ... needs work ... but
already A-M-A-Z-I-N-G.

David


On Fri, Jun 28, 2013 at 3:06 PM, Rich Hickey  wrote:

> I've blogged a bit about the new core.async library:
>
> http://clojure.com/blog/2013/06/28/clojure-core-async-channels.html
>
> Please try it out.
>
> Thanks,
>
> Rich
>
>  --
> --
> 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: core.async

2013-06-28 Thread Nahuel Greco
Very nice! Selectable channels FTW.

Btw, are you aware of the Erlang selective-receive model? Is often very
overlooked but it showed big advantages over unfiltered channels. See this:
http://www.erlang.se/euc/05/1500Wiger.ppt

Saludos,
Nahuel Greco.


On Fri, Jun 28, 2013 at 4:06 PM, Rich Hickey  wrote:

> I've blogged a bit about the new core.async library:
>
> http://clojure.com/blog/2013/06/28/clojure-core-async-channels.html
>
> Please try it out.
>
> Thanks,
>
> Rich
>
>  --
> --
> 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: core.async

2013-06-28 Thread Nahuel Greco
I forgot the second Ulf Wiger link, related to the previous one:
http://www.infoq.com/presentations/Death-by-Accidental-Complexity

Saludos,
Nahuel Greco.


On Fri, Jun 28, 2013 at 4:46 PM, Nahuel Greco  wrote:

> Very nice! Selectable channels FTW.
>
> Btw, are you aware of the Erlang selective-receive model? Is often very
> overlooked but it showed big advantages over unfiltered channels. See this:
> http://www.erlang.se/euc/05/1500Wiger.ppt
>
> Saludos,
> Nahuel Greco.
>
>
> On Fri, Jun 28, 2013 at 4:06 PM, Rich Hickey  wrote:
>
>> I've blogged a bit about the new core.async library:
>>
>> http://clojure.com/blog/2013/06/28/clojure-core-async-channels.html
>>
>> Please try it out.
>>
>> Thanks,
>>
>> Rich
>>
>>  --
>> --
>> 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.




Records won't round-trip through edn.

2013-06-28 Thread Cedric Greevey
(defrecord MyRecord [x y])
(require '(clojure [edn :as e]))
(e/read-string (pr-str (MyRecord. 'foo 42)))

=> RuntimeException No reader function for tag user.MyRecord
clojure.lang.EdnReader$TaggedReader.readTagged (EdnReader.java:739)


Is there some incantation that will make records round-trip successfully,
like an (add-record-to-edn MyRecord) or something that could easily be used
to implement such? The clojure.edn documentation says something about
default-readers and a :readers key, but says nothing about the arguments
received by such a function or how to associate one with a particular
record name (though {'user/MyRecord (fn [something] something)} and
{:user/MyRecord (fn [something] something)} both seem like plausible
templates), and a search for ":readers" at the linked edn.org documentation
page draws a blank.

Or is it that something other than pr-str should be used to *write* records
that are to be read in with the edn reader? If so, it's not clear what.
There's no write or write-string in clojure.edn, or indeed anything public
other than read and read-string, and the documentation for the latter two
don't refer one to any function in any namespace specifically designed for
outputting objects to edn format, thus implying that pr-str ought to
suffice.

I can work around this by serializing records as maps with an added key or
something, then converting them back later -- something like

(map #(cond
 (instance? MyRecord %) (assoc (into {} %) ::record :MyRecord)
 (instance? OtherRecord %) (assoc (into {} %) ::record :OtherRecord)
 ...
 :else %) output)

used with walk to massage output for pr-str and

(map #(if-let [rtype (::record %)]
 (condp = rtype
   :MyRecord (MyRecord. (:key1 %) (:key2 %))
   :OtherRecord (OtherRecord. (:key3 %) (:keyx %) (:keyy %))
   ...)
 %) input)

to massage the input obtained from e/read, but that seems awkward and
requires manually adding clauses in both closures for each additional
record type that needs to be supported down the line. That doesn't strike
me as being "the Clojure way", where it's *usually* possible to avoid
having to add cond clauses in half a dozen different places (or even just
two) to add things, and keep all those conds in sync, if your code is
structured idiomatically.

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




Re: core.async

2013-06-28 Thread Alex Baranosky
Very cool stuff.

One point of feedback though: I thought Clojure Core had done a great job
of avoiding a Haskell-like symbol-heavy.  I might've been mis-informed, but
I thought this tendency to avoid  symbol-heavy naming was intentional.  For
example, instead of `-?>` in 1.5 we got `some->`. I thought it was a great
compromise for readability.  In core.async, we've got a lot more symbols.
 Are people in love with names like `!!`, or is there room for
rethinking the naming?

Best,
Alex

On Fri, Jun 28, 2013 at 12:50 PM, Nahuel Greco  wrote:

> I forgot the second Ulf Wiger link, related to the previous one:
> http://www.infoq.com/presentations/Death-by-Accidental-Complexity
>
> Saludos,
> Nahuel Greco.
>
>
> On Fri, Jun 28, 2013 at 4:46 PM, Nahuel Greco  wrote:
>
>> Very nice! Selectable channels FTW.
>>
>> Btw, are you aware of the Erlang selective-receive model? Is often very
>> overlooked but it showed big advantages over unfiltered channels. See this:
>> http://www.erlang.se/euc/05/1500Wiger.ppt
>>
>> Saludos,
>> Nahuel Greco.
>>
>>
>> On Fri, Jun 28, 2013 at 4:06 PM, Rich Hickey wrote:
>>
>>> I've blogged a bit about the new core.async library:
>>>
>>> http://clojure.com/blog/2013/06/28/clojure-core-async-channels.html
>>>
>>> Please try it out.
>>>
>>> Thanks,
>>>
>>> Rich
>>>
>>>  --
>>> --
>>> 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.
>
>
>

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




Re: core.async

2013-06-28 Thread Brandon Bloom
> Are people in love with names like `!!`, or is there room for 
rethinking the naming?

These operators are important and common enough to justify being *syntax* 
in Go, which is pretty minimal on syntax overall.

Personally, I think the names are pretty good.

-- 
-- 
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: lein repl and missing yank

2013-06-28 Thread Manuel Sugawara
On Thu, Jun 27, 2013 at 10:50 AM, Manuel Sugawara  wrote:

> On Wed, Jun 26, 2013 at 6:51 PM, Phil Hagelberg  wrote:
>
>> On Wednesday, June 26, 2013 3:26:58 PM UTC-7, Manuel Sugawara wrote:
>> > Am working on a linux terminal with the REPL (as in lein repl) and the
>> C-y binding does not work (yank-command, or paste).
>>
>> Definitely a bug that it's not working. Can you report it on the reply
>> project?
>>
>
> Thanks, Looking at jline source code suggests that is a missing feature.
> Just sent a message to the group to confirm this. Will report back.
>

After a further inspection in the jline code this *is* a missing feature.
Just sent a pull request to fix that. Mean time, happy with my patched
version.

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




Re: lein repl and missing yank

2013-06-28 Thread Jonathan Fischer Friberg
Should pasting be part of jline? Am I the only one that finds that really
odd?

In my opinion, pasting should be part of the terminal - and it is. Standard
shortcuts are ctrl+shift+v for gnome-terminal (and I assume other modern
terminals, but I don't really know). The old standard is middle-click for
copy/pasting in linux. This works for example in xterm.

Jonathan


On Sat, Jun 29, 2013 at 3:52 AM, Manuel Sugawara
wrote:

> On Thu, Jun 27, 2013 at 10:50 AM, Manuel Sugawara <
> manuel.sugaw...@gmail.com> wrote:
>
>> On Wed, Jun 26, 2013 at 6:51 PM, Phil Hagelberg  wrote:
>>
>>> On Wednesday, June 26, 2013 3:26:58 PM UTC-7, Manuel Sugawara wrote:
>>> > Am working on a linux terminal with the REPL (as in lein repl) and the
>>> C-y binding does not work (yank-command, or paste).
>>>
>>> Definitely a bug that it's not working. Can you report it on the reply
>>> project?
>>>
>>
>> Thanks, Looking at jline source code suggests that is a missing feature.
>> Just sent a message to the group to confirm this. Will report back.
>>
>
> After a further inspection in the jline code this *is* a missing feature.
> Just sent a pull request to fix that. Mean time, happy with my patched
> version.
>
> Regards,
> 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.
>
>
>

-- 
-- 
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: Is there a better way to update a map atom?

2013-06-28 Thread Greg
Can anyone explain the relationship between swap! and reset! ?

Why is using swap! in this example "safe" and using reset! not?

I've tried searching google for comparisons of the two but can't find anything, 
and the documentation doesn't help much.

Thanks,
Greg

On Jan 21, 2013, at 6:22 PM, Stephen Compall  wrote:

> On Jan 21, 2013 3:28 PM, "Jim - FooBar();"  wrote:
> > ...or you can go all the way, skipping reset! completely:
> >
> > (swap! game-objects (fn [objects] (reduce-kv #(assoc % %2 (update-object 
> > %3)) {} objects) ))
> 
> Which also has the benefit of being safe, unlike any reset!-based update.
> 
> --
> Stephen Compall
> If anyone in the MSA is online, you should watch this flythrough.
> 
> 
> -- 
> 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 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: lein repl and missing yank

2013-06-28 Thread Phil Hagelberg
On Friday, June 28, 2013 7:17:14 PM UTC-7, Jonathan Fischer Friberg wrote:
> Should pasting be part of jline? Am I the only one that finds that really 
odd?

jLine is a port of readline to the JVM. readline supports a kill ring, so 
jLine should too. That's different from the terminal performing pasting 
since all that can do is insert the primary selection, it can't handle 
history or inserting text that you've just killed.

-Phil

-- 
-- 
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: Latest JOGL with Clojure in Eclipse?

2013-06-28 Thread Greg
If you haven't considered LWJGL as an alternative to JOGL, I highly recommend 
it. I remember preferring it over JOGL when I compared them some years ago. 
Many popular game engines use it (like jMonkeyEngine).

http://www.lwjgl.org/
http://mybuddymichael.com/writings/using-lwjgl-from-clojure.html

On Dec 5, 2012, at 5:41 AM, "Andrew P. Lentvorski, Jr."  
wrote:

> Anybody have some advice for me about the latest JOGL(2.0 rc11) with Clojure 
> on Eclipse?  I'm running Eclipse Juno SR1 with Counterclockwise on OS X 
> 10.6.8.
> 
> The JOGL tutorial sets up by creating a JOGL project that you then make new 
> Java projects depend upon.  This works fine for Java and seems to be 
> considered the "official" way of making things go with Eclipse and Java.  I 
> can create a new Java project, add the JOGL project to the Java Build Path, 
> set up OpenGL and draw a basic triangle.  The project finds all the 
> dependencies and everything runs.
> 
> This doesn't seem to work for Clojure for some reason.  I could post specific 
> errors, but given that I'm a clojure newbie, I figured I should probably take 
> a further step back since I'm likely to be barking up the wrong tree 
> completely.  So, my question is:
> 
> What is the proper way to get JOGL running under Clojure on Eclipse?
> 
> Thanks.
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To 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: Detecting login and logout using friend

2013-06-28 Thread Steve Buikhuizen
Thanks Chas, since my current solution "ain't broke" I'll leave it as is 
for now.

However, the moment I need to change it, I'll try your suggestion and will 
post the code here as well.

-- 
-- 
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: Is there a better way to update a map atom?

2013-06-28 Thread Greg
OK, I've found something that shows how these two work when used in the 
implementation of a generator:

https://gist.github.com/daveray/1263503

I think I understand what the problem is now:

(reset! id (inc @id))

There's a "time gap" in between the dereference of 'id' and its assignment back 
to 'id' (after being incremented).

With swap!, no such problem exists, because it's an atomic operation where 
there is no such "time gap" between dereferencing, applying a function, and 
setting the new value. That all takes place in on magical atomic moment.

If I've got this wrong, please let me know!

Cheers,
Greg

On Jun 28, 2013, at 11:19 PM, Greg  wrote:

> Can anyone explain the relationship between swap! and reset! ?
> 
> Why is using swap! in this example "safe" and using reset! not?
> 
> I've tried searching google for comparisons of the two but can't find 
> anything, and the documentation doesn't help much.
> 
> Thanks,
> Greg
> 
> On Jan 21, 2013, at 6:22 PM, Stephen Compall  
> wrote:
> 
>> On Jan 21, 2013 3:28 PM, "Jim - FooBar();"  wrote:
>> > ...or you can go all the way, skipping reset! completely:
>> >
>> > (swap! game-objects (fn [objects] (reduce-kv #(assoc % %2 (update-object 
>> > %3)) {} objects) ))
>> 
>> Which also has the benefit of being safe, unlike any reset!-based update.
>> 
>> --
>> Stephen Compall
>> If anyone in the MSA is online, you should watch this flythrough.
>> 
>> 
>> -- 
>> 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 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: core.async

2013-06-28 Thread Brandon Bloom
> CSP proper is amenable to certain kinds of automated correctness analysis.
> No work has been done on that front for core.async as yet.

Although a far cry from Go's race 
detector, 
Go did ship with one feature that is helpful for preventing a certain class 
of bugs: explicit restriction to a send-only or receive-only channel via 
constraining conversion or assignment. 
See http://golang.org/ref/spec#Channel_types

Although Go utilizes the type system to accomplish this at compile time, 
core.async could achieve the same effect at runtime. Essentially, there 
could be two conversion functions for wrapping a channel in a read-only or 
write-only proxy object.

I'm not sure if this is actually useful, but I'm curious: Has this been 
considered?

On Friday, June 28, 2013 3:06:47 PM UTC-4, Rich Hickey wrote:
>
> I've blogged a bit about the new core.async library:
>
> http://clojure.com/blog/2013/06/28/clojure-core-async-channels.html
>
> Please try it out.
>
> Thanks,
>
> Rich
>
>

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