Re: What non-deprecated Clojure Web libraries to use?

2013-10-28 Thread Manuel Paccagnella


Il giorno lunedì 28 ottobre 2013 04:12:50 UTC+1, Christopher Allen ha 
scritto:

You can use Korma with Stuart Sierra's workflow just fine.
>
> Really? Nice! Last time I tried I didn’t managed to get it to work 
properly. 

What happens to an open connection binded to a Var (via defdb) when the ns 
gets reloaded? Or maybe I should use korma.db/get-connection explicitly in 
the system starting phase?

Thank you for your feedback.

On Sunday, October 27, 2013 5:07:02 PM UTC-7, Manuel Paccagnella wrote:
>>
>> Il giorno lunedì 28 ottobre 2013 00:30:06 UTC+1, Alexander Hudek ha 
>> scritto:
>>
>> http://www.luminusweb.net/ gives a reasonable starting setup. The only 
>>> thing I would recommend doing differently is to use clojure/java.jdbc or 
>>> honeysql instead of korma for an sql dsl.
>>>
>> I agree. Korma is quite interesting as a DSL, but currently 
>> usesVars 
>> under the hood to manage connections and this doesn’t play well with 
>> dynamic workflows as the 
>> oneby 
>> Stuart Sierra.
>>
>> Personally I’ve used just 
>> clojure.java.jdbc(
>> here  is a micro-tutorial that 
>> I’ve written for it) that is going under an API overhaul to make 
>> connections management more explicit and functional. If you need an SQL 
>> generation library you could look at Honey 
>> SQL. 
>>
>>
>> Hope it helps,
>>
>> Manuel 
>>
>> PS: You could also take a look at the new book Web Development in 
>> Clojureby 
>> the author of 
>> Luminus .
>>
>

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


Re: How to change map in doseq ?

2013-10-28 Thread Alan Forrester
On 28 October 2013 05:23, Jiaqi Liu  wrote:

>> 2013/10/28 Jiaqi Liu 
>>>
>>> i really don't get it.
>>> Any suggestion??
>>
>>
>> Clojure data structures are immutable. clojure.core/assoc
>> produces a new data structure instead of changing the one you have.
>>
>> You can use an atom if you need to update a map from doseq
>> but more likely you want to use the actual value assoc returns
>> and/or clojure.core functions for manipulating collections,
>> such as clojure.core/reduce.
>>
>> See http://clojure-doc.org/articles/language/core_overview.html,
>> http://clojure-doc.org/articles/language/collections_and_sequences.html
>> and
>> http://clojure-doc.org/articles/language/concurrency_and_parallelism.html
>> --
>> MK
>>
>> http://github.com/michaelklishin
>> http://twitter.com/michaelklishin
>
> Thanks for your suggests~
> The above piece of code is just for test.
>
> The practical problem i want to solve is that
> -->read a very big log file (each line is like that : "user id, latitude,
> longitude, timeStamp")
> -->statistic the number of each user (store in a map like that { id1 100 ,
> id2 200, id3 150 })
> -->sorted the map by values and get the top-N user id
>
> the main code of the former 2 steps is :
> 
> (let [ id-num {} ];;as your suggestion , here should use atom
>(with-open [rdr   (the file...)]
>   (doseq  [line (line-seq rdr)]
>  (let [params(split each line with "," )
> id   (params 0)]
>(if  (id-num id)
> (do  inc the value )
> (do  add new  k-v )
> )
> ...
> I don't want to load the total file into memory, too big.
> So referencing the suggestion from internet , i am using line-seq & doseq to
> deal with the big log file lazily.
> Is that right way to use clojue to deal this problem?
>
> Any suggestions will be grateful!!!

doseq isn't lazy and it doesn't return anything, it is meant to be
used solely for side effects.

for returns a lazy sequence.

See http://clojuredocs.org/clojure_core.

Alan

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


ANN: Rush Hour - an example Clojure architecture

2013-10-28 Thread Michael Drogalis
Hi everyone,

I'm happy to announce the Rush Hour platform - highly realistic traffic 
simulations
done with a careful, exemplar architecture all in Clojure.

GitHub platform page:

https://github.com/MichaelDrogalis/rush-hour

Blog post about the architecture:

http://michaeldrogalis.tumblr.com/post/65274692089/clojure-understood-the-rush-hour-platform

-- Michael Drogalis

-- 
-- 
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: Fast path to having fun with ClojureScript

2013-10-28 Thread Julien Eluard
Hi David,

awesome to see all those recent improvements in the ClojureScript compiler! 
Thanks for the hard work.

Compilation is super fast in optimizations :none mode. A dumb change will be 
compiled in below a second. Now the same change in optimizations :simple takes 
30 s.
Is that expected? Is it worth my time to investigate that?

Also I am not entirely clear when the output-dir property should be used and 
how it interacts with output-to and source-map. Could you clarify that?

Thanks,
Julien

Le lundi 28 octobre 2013 01:25:31 UTC-3, David Nolen a écrit :
> Given the source map improvements to ClojureScript, now is a good time to 
> present a newbie friendly guide to hacking with ClojureScript. Emphasis on no 
> fuss and getting as quickly as possible to productive experimentation:
> 
> 
> 
> http://swannodette.github.io/2013/10/27/the-essence-of-clojurescript/

-- 
-- 
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: [ClojureScript] ANN: ClojureScript 0.0-1978

2013-10-28 Thread Tim Visher
Nice! Incremental compilation of whitespace optimizations + source
maps are now working for me!

On Sun, Oct 27, 2013 at 9:32 PM, David Nolen  wrote:
> ClojureScript, the Clojure compiler that emits JavaScript source code.
>
> README and source code: https://github.com/clojure/clojurescript
>
> New release version: 0.0-1978
>
> Leiningen dependency information:
>
> [org.clojure/clojurescript "0.0-1978"]
>
> Changes:
> * tools.reader 0.7.10
>
> Enhancements:
> * Significantly better source map support - should work with or without
> Closure optimizations and should work with incremental compilation across
> JVM runs. If you haven't tried the source map feature before, now's a good
> time :)
>
> Bug fixes:
> CLJS-638: Keyword invoke is inconsistent with clojure
> CLJS-632: use tools.reader's *alias-map* for tracking aliases instead of
> Clojure namespaces
> CLJS-471: prevent empty regexps from causing compiler errors
> CLJS-628: *cljs-file* not bound when compiling to stdout
> CLJS-634: do not call getPath on a null value
> CLJS-635: Clojure consistent implementations of -rseq
> CLJS-608: Stop re-seq after reaching end of string
> CLJS-591: source relative path for source map
> CLJS-617: double evaluation of ^not-native type-hinted expressions
>
> --
> Note that posts from new members are moderated - please be patient with your
> first post.
> ---
> You received this message because you are subscribed to the Google Groups
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.

-- 
-- 
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: [ClojureScript] Re: Fast path to having fun with ClojureScript

2013-10-28 Thread David Nolen
On Mon, Oct 28, 2013 at 9:05 AM, Julien Eluard wrote:

> Compilation is super fast in optimizations :none mode. A dumb change will
> be compiled in below a second. Now the same change in optimizations :simple
> takes 30 s.
> Is that expected? Is it worth my time to investigate that?
>

:simple was never fast especially from a cold start, and if you have source
maps enabled it's going to be even slower as we need to merge two source
maps. All this applies to :advanced as well. I just ran a :simple test and
after a couple of runs, it takes about 4 seconds for recompile of a trivial
file. Without :source-map, cold start takes 15 seconds, and after a couple
of runs recompile takes ~1.7s on my machine.

Happy to take patches that close the gap, however nothing immediately comes
to mind that could improve the situation at least for auto builds - we
cache source map information in memory. Of course we might be doing
something silly and that would require some investigation.


> Also I am not entirely clear when the output-dir property should be used
> and how it interacts with output-to and source-map. Could you clarify that?
>
> Thanks,
> Julien


:output-to generates the entry point file regardless of optimization level.
:output-dir options will construct the incremental compilation cache
directory - I would probably set it explicitly regardless of :optimization
level.

David

-- 
-- 
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: [ClojureScript] Re: Fast path to having fun with ClojureScript

2013-10-28 Thread Julien Eluard
Thanks that's clearer now. Somehow I understood that output-to was supposed to 
be relative to output-dir.

One thing that prevents me to use optimizations :none is that the generated js 
are not as straightforward to use as with others optimizations: you need to 
manually include some js files (at least goog/base.js) and call goog.require.
Is that something that could be automatically added to the entry point js?

Thanks,
Julien

-- 
-- 
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: Fast path to having fun with ClojureScript

2013-10-28 Thread Deniz Kurucu
Haven't tested source maps before, works perfectly !


On Mon, Oct 28, 2013 at 6:25 AM, David Nolen  wrote:

> Given the source map improvements to ClojureScript, now is a good time to
> present a newbie friendly guide to hacking with ClojureScript. Emphasis on
> no fuss and getting as quickly as possible to productive experimentation:
>
> http://swannodette.github.io/2013/10/27/the-essence-of-clojurescript/
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

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


ANN: core.matrix 0.13.1

2013-10-28 Thread Mike Anderson
New version of core.matrix now available.

This release brings quite a lot of changes including:

- Many performance optimisations: this should be noticeably faster than 
previous releases for many operations
- The shape of a scalar is now defined to be nil. This seems to work better 
for people who want to distinguish scalars from 0-dimensional arrays (which 
continue to have a shape of [])
- Improved broadcasting support
- emin and emax functions (to find the minimum and maximum elements in an 
array respectively)
- zero-filled array constructors (zero-vector, zero-matrix and zero-array)
- Lots of fixes for various edge cases, especially around scalar and nil 
handling
- NDArray is now loaded lazily, to minimise startup time issues

As usual available from Clojars or GitHub:
- https://clojars.org/net.mikera/core.matrix
- https://github.com/mikera/core.matrix


-- 
-- 
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: Fast path to having fun with ClojureScript

2013-10-28 Thread David Nolen
Great to hear.


On Mon, Oct 28, 2013 at 6:53 AM, Deniz Kurucu  wrote:

> Haven't tested source maps before, works perfectly !
>
>
> On Mon, Oct 28, 2013 at 6:25 AM, David Nolen wrote:
>
>> Given the source map improvements to ClojureScript, now is a good time to
>> present a newbie friendly guide to hacking with ClojureScript. Emphasis on
>> no fuss and getting as quickly as possible to productive experimentation:
>>
>> http://swannodette.github.io/2013/10/27/the-essence-of-clojurescript/
>>
>> --
>> --
>> 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: get fn and not-found

2013-10-28 Thread Alex Baranosky
Or a shorter variant of the sentinel approach:

(let [r (get a-map :b ::unfound)]
  (if (= r ::unfound)
(my-foo)
r))


On Sun, Oct 27, 2013 at 2:57 PM, Cedric Greevey  wrote:

> (get a-map :b my-foo) will result in the function object itself being
> returned if :b is not found. If you want it to be called only in the event
> of not found, you need either
>
> (if (contains? a-map :b) (a-map :b) (my-foo)) -- which may perform the
> lookup twice -- or
>
> (if-let [r (a-map :b)] r (my-foo)) -- which does not, but treats a {:b
> nil} entry as the same as absence of :b -- or
>
> (let [sentinel (Object.)
>   r (get a-map :b sentinel)]
>   (if (identical? r sentinel)
> (my-foo)
> r)) -- which is longer and more complex, but calls my-foo (and returns
> what it returns) if and only if :b is genuinely absent from the map (like
> the first solution above) and performs the lookup only once (like the
> second solution above). If this has to be done in a tight loop, the extra
> efficiency over the second solution may be worth it, but you'll want to
> avoid repeatedly creating and discarding the sentinel object as well,
> resulting in something like
>
> (def {^:private} sentinel (Object.))
>
> ...
>
> (defn ...
> ...
>   (loop ...
> ...
> (let [r (get a-map :b sentinel)]
>   (if (identical? r sentinel)
> (my-foo)
> r)) ... ) ... )
>
>
>
> On Sun, Oct 27, 2013 at 1:00 PM, Ryan  wrote:
>
>> Silly me, thank you for your replies guys!
>>
>> One more question though, what if my-foo had parameters?
>>
>> Ryan
>>
>>
>> On Sunday, October 27, 2013 6:55:34 PM UTC+2, Luc wrote:
>>
>>> You are getting my-foo evaluated, remove the parens around it.
>>>
>>> Luc P.
>>>
>>>
>>> > Hello,
>>> >
>>> > I am trying to understanding why is this happening:
>>> >
>>> > > (defn my-foo [] (println "Why do I get printed?"))
>>> > > #'sandbox4724/my-foo
>>> > > > (get {:b 1} :b (my-foo))
>>> > > Why do I get printed?
>>> > > 1
>>> > > >
>>> >
>>> >
>>> > Shouldn't (my-foo) only be called in case the key isn't found? Why am
>>> I
>>> > seeing the above behavior instead?
>>> >
>>> > Thank you for your time,
>>> >
>>> > Ryan
>>> >
>>> > --
>>> > --
>>> > 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.
>>>
>>> >
>>> --
>>> 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 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/

Re: Surprising behaviour related to records, protocols and AOT

2013-10-28 Thread Kevin Downey
I don't know about the rest of this thread, but loom seems to suffer
from what I've outlined in
http://dev.clojure.org/jira/browse/CLJ-322?focusedCommentId=32246&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-32246
pulling in the interface that the protocol generates instead of the
protocol.

On 10/26/13, 5:42 PM, Aysylu Greenberg wrote:
> I was wondering if anybody has found a solution to this problem. I'm 
> experiencing the same issue in this project . 
> If you disable aot (this 
> line), 
> the tests start failing with a similar error message.
> 
> Thanks,
> Aysylu
> 
> On Thursday, April 18, 2013 8:27:53 AM UTC-4, Ragnar Dahlén wrote:
>>
>> Thank you for your explanation. I also suspect there is some subtle
>> issue with the class file being used by the different constructors.
>>
>> However, I would be surprised if this behaviour is intended, and that 
>> the 'hackery' you proposed is the only, and prefered way of solving this.
>>
>> To better illustrate the core issue, I updated the example slightly
>> as follows:
>>
>> Premise: 
>> defrecordissue.arecord and defrecordissue.protocol constitute some
>> library.
>>
>> 1. defrecordissue.arecord defines a record type, and a function that
>>will return an instance of the record:
>>
>> (ns defrecordissue.arecord)
>>
>> (defrecord ARecord [])
>>
>> (defn make-record
>>   []
>>   (->ARecord))
>>
>> 2. defrecordissue.protocol defines a protocol, and extends it to the
>>record type defined in 1. It also defines a public function
>>intended to be used by libraries:
>>
>> (ns defrecordissue.aprotocol
>>   (:require [defrecordissue.arecord])
>>   (:import [defrecordissue.arecord ARecord]))
>>  
>> (defprotocol AProtocol
>>   (afn [this]))
>>  
>> (extend-protocol AProtocol
>>   ARecord
>>   (afn [this] 42))
>>
>> (defn some-public-fn
>>   []
>>   (afn (defrecordissue.arecord/make-record)))
>>
>> 3. defrecordissue.consumer is a consumer of the library, knows
>>nothing of any protocols or records, but only wants to call a
>>function thats part of the public api:
>>
>> (ns defrecordissue.consumer
>>   (:require [defrecordissue.aprotocol]))
>>  
>> (defrecordissue.aprotocol/some-public-fn)
>>
>> This fails with the same root cause.
>>
>> I've created a new branch for this in the GitHub repo.
>>
>> https://github.com/ragnard/defrecordissue/tree/more-realistic
>>
>> /Ragge
>>
>> On Thursday, 18 April 2013 12:19:35 UTC+1, Andrew Sernyak wrote:
>>>
>>> I guess extend-type does changes only to generated java class and the var 
>>> defrecordissue.arecord->ARecord 
>>> contains the 'old' version of ARecord constructor. Obviously it would be 
>>> weird for defprotocol to change the variable in another namespace. 
>>> Especially when you can extend a record from anywhere.
>>>
>>> So If you want to create a record that implements your protocol via var 
>>> from record namespace, you should do some hackery to update that variable. 
>>> I've done a pull-request for you, but using direct constructor will be more 
>>> idiomatic
>>>
>>> ;
 ; this won't work unless you update manualy a variable ->ARecord in the 
 namespace
 ;
 ;(defrecordissue.aprotocol/afn (defrecordissue.arecord/->ARecord))
 ; 
 ; like
 (defmacro from-ns[nmsps & body] 
   "launches body from namespace"
   `(binding 
  [*ns* (find-ns ~nmsps)] 
(eval
   (quote (do ~@body)
 (from-ns 'defrecordissue.arecord 
  (import '(defrecordissue.arecord.ARecord))
  (alter-var-root 
('->ARecord (ns-publics 'defrecordissue.arecord)) 
(fn[x] (fn[] (new ARecord)
 (println  (defrecordissue.aprotocol/afn 
 (defrecordissue.arecord/->ARecord)))
 ; 42
>>>
>>>
>>> ndrw 
>>>
>>
> 


-- 
And what is good, Phaedrus,
And what is not good—
Need we ask anyone to tell us these things?



signature.asc
Description: OpenPGP digital signature


Re: get fn and not-found

2013-10-28 Thread Dave Ray
... or the no-sentinel find-based approach:

(if-let [[_ v] (find a-map :b)]
  v
  (my-foo))

Cheers,

Dave



On Mon, Oct 28, 2013 at 9:08 AM, Alex Baranosky <
alexander.barano...@gmail.com> wrote:

> Or a shorter variant of the sentinel approach:
>
> (let [r (get a-map :b ::unfound)]
>   (if (= r ::unfound)
> (my-foo)
> r))
>
>
> On Sun, Oct 27, 2013 at 2:57 PM, Cedric Greevey wrote:
>
>> (get a-map :b my-foo) will result in the function object itself being
>> returned if :b is not found. If you want it to be called only in the event
>> of not found, you need either
>>
>> (if (contains? a-map :b) (a-map :b) (my-foo)) -- which may perform the
>> lookup twice -- or
>>
>> (if-let [r (a-map :b)] r (my-foo)) -- which does not, but treats a {:b
>> nil} entry as the same as absence of :b -- or
>>
>> (let [sentinel (Object.)
>>   r (get a-map :b sentinel)]
>>   (if (identical? r sentinel)
>> (my-foo)
>> r)) -- which is longer and more complex, but calls my-foo (and
>> returns what it returns) if and only if :b is genuinely absent from the map
>> (like the first solution above) and performs the lookup only once (like the
>> second solution above). If this has to be done in a tight loop, the extra
>> efficiency over the second solution may be worth it, but you'll want to
>> avoid repeatedly creating and discarding the sentinel object as well,
>> resulting in something like
>>
>> (def {^:private} sentinel (Object.))
>>
>> ...
>>
>> (defn ...
>> ...
>>   (loop ...
>> ...
>> (let [r (get a-map :b sentinel)]
>>   (if (identical? r sentinel)
>> (my-foo)
>> r)) ... ) ... )
>>
>>
>>
>> On Sun, Oct 27, 2013 at 1:00 PM, Ryan  wrote:
>>
>>> Silly me, thank you for your replies guys!
>>>
>>> One more question though, what if my-foo had parameters?
>>>
>>> Ryan
>>>
>>>
>>> On Sunday, October 27, 2013 6:55:34 PM UTC+2, Luc wrote:
>>>
 You are getting my-foo evaluated, remove the parens around it.

 Luc P.


 > Hello,
 >
 > I am trying to understanding why is this happening:
 >
 > > (defn my-foo [] (println "Why do I get printed?"))
 > > #'sandbox4724/my-foo
 > > > (get {:b 1} :b (my-foo))
 > > Why do I get printed?
 > > 1
 > > >
 >
 >
 > Shouldn't (my-foo) only be called in case the key isn't found? Why am
 I
 > seeing the above behavior instead?
 >
 > Thank you for your time,
 >
 > Ryan
 >
 > --
 > --
 > 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.

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

eval-after-load

2013-10-28 Thread Phillip Lord

I want to add some additional configuration after I have loaded a
library. Is there anything equivalent to eval-after-load in emacs, which
enables me to do something after a namespace has been loaded? Or a file?

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: ANN: Rush Hour - an example Clojure architecture

2013-10-28 Thread Armando Blancas
Good work. Thanks for putting this out.

On Monday, October 28, 2013 6:03:54 AM UTC-7, Michael Drogalis wrote:
>
> Hi everyone,
>
> I'm happy to announce the Rush Hour platform - highly realistic traffic 
> simulations
> done with a careful, exemplar architecture all in Clojure.
>
> GitHub platform page:
>
> https://github.com/MichaelDrogalis/rush-hour
>
> Blog post about the architecture:
>
>
> http://michaeldrogalis.tumblr.com/post/65274692089/clojure-understood-the-rush-hour-platform
>
> -- Michael Drogalis
>

-- 
-- 
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: What non-deprecated Clojure Web libraries to use?

2013-10-28 Thread Chris Kuttruff
Separate from DSLs like Korma, etc.  I have written a simple library for 
doing database migrations with clojure (clj-sql-up ( 
https://github.com/ckuttruff/clj-sql-up )).  There are also other libraries 
still maintained along these lines (drift, migratus, ragtime, etc.)

Hopefully one of these will be useful for your project.


On Sunday, October 27, 2013 10:43:21 AM UTC-7, Scott M wrote:
>
> Ring seems well maintained, but Noir and Compojure are marked deprecated.
>
> Can anyone lay out a Clojure Web library "stack" (up to templating) that 
> is current and maintained?
>
> Any and all sagacious wisdom greatly appreciated - thanks! 
>
> - Scott
>

-- 
-- 
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: What non-deprecated Clojure Web libraries to use?

2013-10-28 Thread Alexander Hudek
I've run into problems with it in a few areas:

1) Bundled connection pooling. You can disable it or change it, but it 
takes work. Bundling seems against the idea of keeping libraries and 
dependencies small and composable.

2) Default behaviour of delete can be inefficient. It returns the entire 
deleted object rather than just a count of rows deleted. If you are 
deleting big binary columns, this can be a problem. Again, you can disable 
this. At the time I encountered it I had to read through the code to figure 
out how. 

3) Some queries get translated to incorrect SQL. This is what made us 
switch away. Korma was in part a response to clojureql. Chris found 
clojureql to be doing too much magic in it's dsl->sql translation and 
wanted a more 1:1 mapping to sql. However, korma doesn't go far enough in 
some cases. When it goes wrong, you might be faced with hours of debugging 
as I was. (The problem queries involved aggregates and joins.) I realized 
that I could write the sql in one minute and so just switched to straight 
jdbc. 

It is incredibly hard to write a clean sql dsl due to differences in how 
various database drivers work, and also due to how complex sql itself is. 
It's worth noting that you can always selectively fall back to jdbc if you 
encounter any of these issues. Korma uses jdbc itself and works well with 
it. We instead mix jdbc with light honeysql usage.

On Sunday, October 27, 2013 8:03:26 PM UTC-4, Paul Samways wrote:
>
> Oh? What are the benefits of using those over Korma? I've been more than 
> happy with it up to now.
>
>
> On Mon, Oct 28, 2013 at 10:30 AM, Alexander Hudek 
> 
> > wrote:
>
>> http://www.luminusweb.net/ gives a reasonable starting setup. The only 
>> thing I would recommend doing differently is to use clojure/java.jdbc or 
>> honeysql instead of korma for an sql dsl.
>>
>> On Sunday, October 27, 2013 1:43:21 PM UTC-4, Scott M wrote:
>>>
>>> Ring seems well maintained, but Noir and Compojure are marked deprecated.
>>>
>>> Can anyone lay out a Clojure Web library "stack" (up to templating) that 
>>> is current and maintained?
>>>
>>> Any and all sagacious wisdom greatly appreciated - thanks! 
>>>
>>> - Scott
>>>
>>  -- 
>> -- 
>> 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: eval-after-load

2013-10-28 Thread Cedric Greevey
Doesn't simply putting some executable forms at the end of the namespace's
source code do that? e.g.

(ns foo
  ...)

(defn ...)

(def ...)

(defn ...)

...

(do-something!)



On Mon, Oct 28, 2013 at 1:05 PM, Phillip Lord
wrote:

>
> I want to add some additional configuration after I have loaded a
> library. Is there anything equivalent to eval-after-load in emacs, which
> enables me to do something after a namespace has been loaded? Or a file?
>
> 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.
>

-- 
-- 
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: Fast path to having fun with ClojureScript

2013-10-28 Thread Leif
Wow, source maps make things much more pleasant.  Time to give 
clojurescript another shot, I think.

But I was under the impression that clojurescript insulated us from 
javascript's more distasteful behaviors.  The numeric functions seem to 
have the original anything-goes zany semantics.  Is there a list somewhere 
of "Javascript gotchas that you still have to worry about in Clojurescript"?

Thanks to all the clojurescript devs,
Leif

On Monday, October 28, 2013 12:25:31 AM UTC-4, David Nolen wrote:
>
> Given the source map improvements to ClojureScript, now is a good time to 
> present a newbie friendly guide to hacking with ClojureScript. Emphasis on 
> no fuss and getting as quickly as possible to productive experimentation:
>
> http://swannodette.github.io/2013/10/27/the-essence-of-clojurescript/
>

-- 
-- 
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: Fast path to having fun with ClojureScript

2013-10-28 Thread Cedric Greevey
On Mon, Oct 28, 2013 at 10:53 PM, Leif  wrote:

> I was under the impression that clojurescript insulated us from
> javascript's more distasteful behaviors.
>

Such as "turning it on indiscriminately for all web sites instead of using
NoScript will get you hacked"? :)

-- 
-- 
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: Surprising behaviour related to records, protocols and AOT

2013-10-28 Thread Aysylu Greenberg
Thank you for the link, but I don't think what you outlined there is the 
same as what I have. I'm referring to records by class and protocols 
defined in the namespace, so I think my situation is different.

On Monday, October 28, 2013 12:08:52 PM UTC-4, red...@gmail.com wrote:
>
> I don't know about the rest of this thread, but loom seems to suffer 
> from what I've outlined in 
>
> http://dev.clojure.org/jira/browse/CLJ-322?focusedCommentId=32246&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-32246
>  
> pulling in the interface that the protocol generates instead of the 
> protocol. 
>
> On 10/26/13, 5:42 PM, Aysylu Greenberg wrote: 
> > I was wondering if anybody has found a solution to this problem. I'm 
> > experiencing the same issue in this project <
> https://github.com/aysylu/loom>. 
> > If you disable aot (this line<
> https://github.com/aysylu/loom/blob/master/project.clj#L9>), 
> > the tests start failing with a similar error message. 
> > 
> > Thanks, 
> > Aysylu 
> > 
> > On Thursday, April 18, 2013 8:27:53 AM UTC-4, Ragnar Dahlén wrote: 
> >> 
> >> Thank you for your explanation. I also suspect there is some subtle 
> >> issue with the class file being used by the different constructors. 
> >> 
> >> However, I would be surprised if this behaviour is intended, and that 
> >> the 'hackery' you proposed is the only, and prefered way of solving 
> this. 
> >> 
> >> To better illustrate the core issue, I updated the example slightly 
> >> as follows: 
> >> 
> >> Premise: 
> >> defrecordissue.arecord and defrecordissue.protocol constitute some 
> >> library. 
> >> 
> >> 1. defrecordissue.arecord defines a record type, and a function that 
> >>will return an instance of the record: 
> >> 
> >> (ns defrecordissue.arecord) 
> >> 
> >> (defrecord ARecord []) 
> >> 
> >> (defn make-record 
> >>   [] 
> >>   (->ARecord)) 
> >> 
> >> 2. defrecordissue.protocol defines a protocol, and extends it to the 
> >>record type defined in 1. It also defines a public function 
> >>intended to be used by libraries: 
> >> 
> >> (ns defrecordissue.aprotocol 
> >>   (:require [defrecordissue.arecord]) 
> >>   (:import [defrecordissue.arecord ARecord])) 
> >>   
> >> (defprotocol AProtocol 
> >>   (afn [this])) 
> >>   
> >> (extend-protocol AProtocol 
> >>   ARecord 
> >>   (afn [this] 42)) 
> >> 
> >> (defn some-public-fn 
> >>   [] 
> >>   (afn (defrecordissue.arecord/make-record))) 
> >> 
> >> 3. defrecordissue.consumer is a consumer of the library, knows 
> >>nothing of any protocols or records, but only wants to call a 
> >>function thats part of the public api: 
> >> 
> >> (ns defrecordissue.consumer 
> >>   (:require [defrecordissue.aprotocol])) 
> >>   
> >> (defrecordissue.aprotocol/some-public-fn) 
> >> 
> >> This fails with the same root cause. 
> >> 
> >> I've created a new branch for this in the GitHub repo. 
> >> 
> >> https://github.com/ragnard/defrecordissue/tree/more-realistic 
> >> 
> >> /Ragge 
> >> 
> >> On Thursday, 18 April 2013 12:19:35 UTC+1, Andrew Sernyak wrote: 
> >>> 
> >>> I guess extend-type does changes only to generated java class and the 
> var defrecordissue.arecord->ARecord 
> >>> contains the 'old' version of ARecord constructor. Obviously it would 
> be 
> >>> weird for defprotocol to change the variable in another namespace. 
> >>> Especially when you can extend a record from anywhere. 
> >>> 
> >>> So If you want to create a record that implements your protocol via 
> var 
> >>> from record namespace, you should do some hackery to update that 
> variable. 
> >>> I've done a pull-request for you, but using direct constructor will be 
> more 
> >>> idiomatic 
> >>> 
> >>> ; 
>  ; this won't work unless you update manualy a variable ->ARecord in 
> the 
>  namespace 
>  ; 
>  ;(defrecordissue.aprotocol/afn (defrecordissue.arecord/->ARecord)) 
>  ; 
>  ; like 
>  (defmacro from-ns[nmsps & body] 
>    "launches body from namespace" 
>    `(binding 
>   [*ns* (find-ns ~nmsps)] 
> (eval 
>    (quote (do ~@body) 
>  (from-ns 'defrecordissue.arecord 
>   (import '(defrecordissue.arecord.ARecord)) 
>   (alter-var-root 
> ('->ARecord (ns-publics 'defrecordissue.arecord)) 
> (fn[x] (fn[] (new ARecord) 
>  (println  (defrecordissue.aprotocol/afn 
>  (defrecordissue.arecord/->ARecord))) 
>  ; 42 
> >>> 
> >>> 
> >>> ndrw 
> >>> 
> >> 
> > 
>
>
> -- 
> And what is good, Phaedrus, 
> And what is not good— 
> Need we ask anyone to tell us these things? 
>
>

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

Fast path to having fun with ClojureScript

2013-10-28 Thread David Nolen
Absolutely not true with respect to numeric functions. In JS the behavior
is *defined* in CLJS not defined and may warn or even throw in the future.

On Monday, October 28, 2013, Leif wrote:

> Wow, source maps make things much more pleasant.  Time to give
> clojurescript another shot, I think.
>
> But I was under the impression that clojurescript insulated us from
> javascript's more distasteful behaviors.  The numeric functions seem to
> have the original anything-goes zany semantics.  Is there a list somewhere
> of "Javascript gotchas that you still have to worry about in Clojurescript"?
>
> Thanks to all the clojurescript devs,
> Leif
>
> On Monday, October 28, 2013 12:25:31 AM UTC-4, David Nolen wrote:
>>
>> Given the source map improvements to ClojureScript, now is a good time to
>> present a newbie friendly guide to hacking with ClojureScript. Emphasis on
>> no fuss and getting as quickly as possible to productive experimentation:
>>
>> http://swannodette.github.io/**2013/10/27/the-essence-of-**clojurescript/
>>
>  --
> --
> 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: get fn and not-found

2013-10-28 Thread Mars0i
This is essentially the same as some of the other solutions, but more 
succinct:

(or (get a-map :b) (println "Oh no!"))

-- 
-- 
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: get fn and not-found

2013-10-28 Thread Ryan
Thank you all for your answers :)

Ryan

On Tuesday, October 29, 2013 7:40:41 AM UTC+2, Mars0i wrote:
>
> This is essentially the same as some of the other solutions, but more 
> succinct:
>
> (or (get a-map :b) (println "Oh no!"))
>
>

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