[ANN] HugSQL 0.4.0 release

2016-02-15 Thread Curtis Summers
I'm happy to announce the 0.4.0 release of HugSQL.

HugSQL is a Clojure library for embracing SQL in your projects.

This release focuses on composability features.  Specifically, we now
have Clojure
Expressions <http://www.hugsql.org/#using-expressions> providing the full
power of Clojure within your SQL templates.  We also have Snippets
<http://www.hugsql.org/#using-snippets> to create partial SQL statements
that can be composed into larger queries.

http://www.hugsql.org/


Changes from 0.3.x to 0.4.0

   - Escape colon in SQL (issue #13
   <https://github.com/layerware/hugsql/issues/13>)
   - def-db-fns-from-string & def-sql-fns-from-string (issue #16
   <https://github.com/layerware/hugsql/issues/16>)
   - Added several functions that operate on individual SQL statements,
   which are useful at the REPL or for one-off composing.  (See Other
   Useful Functions <http://www.hugsql.org/#using-other-fns>)
   - Specify a function as private and other metadata (issue #17
   <https://github.com/layerware/hugsql/issues/17>)
   - Better support for Returning Execute and Insert w/ Return Keys (See Insert
   Usage <http://www.hugsql.org/#using-insert>) (issues #8
   <https://github.com/layerware/hugsql/issues/8> and #15
   <https://github.com/layerware/hugsql/issues/15>)
   - Clojure Expressions <http://www.hugsql.org/#using-expressions>
   - Snippets <http://www.hugsql.org/#using-snippets>
   - Parameter Name Deep-Get <http://www.hugsql.org/#deep-get-param-name>
   for drilling down into parameter data
   - Better docs & tests

A big thank you to those of you who submitted suggestions and bugs during
this cycle.  HugSQL is better because of your input.

What is HugSQL?  HugSQL...


   -
   - is of the opinion that SQL is the right tool for the job when working
   with a relational database.
   - uses simple conventions in your SQL files to define (at compile time)
   database functions in your Clojure namespace, creating a clean separation
   of Clojure and SQL code.
   - supports runtime replacement of SQL Value Parameters (e.g., where id =
   :id), SQL Identifiers (i.e. table/column names), and SQL Keywords. You can
   also implement your own parameter types.
   - features Clojure Expressions and Snippets providing the full
   expressiveness of Clojure and the composability of partial SQL statements
   when constructing complex SQL queries.
   - has protocol-based adapters supporting multiple database libraries and
   ships with adapters for clojure.java.jdbc (default) and clojure.jdbc

Thanks!

Curtis Summers

-- 
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/d/optout.


Re: [ANN] 0.3.0 HugSQL release

2015-11-12 Thread Curtis Summers
Colin,

I've added an issue to explore composable features for a future HugSQL
release:

https://github.com/layerware/hugsql/issues/12

All ideas welcome!  Thanks!

On Wed, Nov 11, 2015 at 11:40 PM, Robin Heggelund Hansen <
skinney...@gmail.com> wrote:

> Fantastic release Curtis. This is an awesome work!
>
> --
> 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/1vezOq3Ro78/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/d/optout.


Re: [ANN] 0.3.0 HugSQL release

2015-11-11 Thread Curtis Summers
Colin,

This is a great question, and I concede that the compose-ability of
HoneySQL (and other DSLs) is almost always going to best HugSQL for the
simple reason that a Lisp is a better tool for composing than SQL is.

You could feasibly accomplish some composable queries by using HugSQL's Raw
SQL parameter type <http://www.hugsql.org/#param-sql>.  That seems a bit
clunky to me at scale, and I'm not sure I'd recommend it.

HugSQL is a month old, and I'm open to adding additional features that
would improve HugSQL's composable abilities.  This might include something
like SQL snippet functions and snippet parameter types.  All feedback is
welcome!

Thanks,

Curtis



On Wed, Nov 11, 2015 at 8:09 PM, Colin Yates  wrote:

> Congrats Curtis - this looks great.
>
> I do have one question: you compare in http://www.hugsql.org/#faq-dsls
> HugSQL with HoneySQL, however, the one killer feature that I use HoneySQL
> for is composable queries - or rather building up the Clojure data map
> through composition before rendering it as SQL. Is there an equivalent
> capability in HugSQL?
>
> As a trivial example, I need to be able to add joins to the query in
> response to the filters the user passes through. Equally, I will apply a
> “top X” if the user has specified that in their request and so on.
>
> Please don’t read this as ‘Honey SQL can do this, you can’t na na nana na’
> :-) It isn’t, simply asking for clarity as that comment in the page bought
> the two into comparison.
>
> Thanks, and again, congratulations!
>
> On 12 Nov 2015, at 00:51, Curtis Summers 
> wrote:
>
> I'm happy to announce the 0.3.0 release of HugSQL.
>
> HugSQL is a Clojure library for embracing SQL in your projects.
>
> This is a significant release because of the new documentation site:
>
> http://www.hugsql.org/
>
> Recent changes from 0.2.x to 0.3.0 include:
>
>- New doc site!
>- Comparison to Yesql (on doc site) - this was requested by many
>- Example application as source for doc examples (*The Princess Bride*
>themed!)
>- Tuple List Parameter Type for multi-record insert support
>- Pass-through options to the underlying database library (e.g.,
>:as-arrays?)
>- Defer adapter selection as late as possible
>- Added on-exception to HugsqlAdapter protocol to allow
>implementations to redirect exceptions (helps with usage in core.async
>channels)
>- Error checks for sql file existence, parameter mismatch errors
>- Minor bug fixes
>
> I'd like to give special thanks to Robin Heggelund Hansen, who jumped in
> early on filing issues, writing code, and making good suggestions for this
> very new project.  Robin is also the author of the HugSQL Adapter for
> postgres.async <https://github.com/Skinney/hugsql-async>.
>
> What is HugSQL?  HugSQL...
>
>- takes the position that SQL is the right tool for the job when
>working with a relational database.
>- uses simple conventions in your SQL files to define (at compile
>time) database functions in your Clojure namespace, creating a clean
>separation of Clojure and SQL code.
>- supports run-time replacement of SQL Value Parameters (e.g., where
>id = :id), SQL Identifiers (i.e. table/column names), and SQL Keywords. You
>can also implement your own parameter types.
>- has protocol-based adapters supporting multiple database libraries
>and ships with adapters for clojure.java.jdbc (default) and clojure.jdbc
>
>
> Thanks!
>
> Curtis Summers
>
> --
> 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/d/optout.
>
>
> --
> 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/grou

[ANN] 0.3.0 HugSQL release

2015-11-11 Thread Curtis Summers
I'm happy to announce the 0.3.0 release of HugSQL.

HugSQL is a Clojure library for embracing SQL in your projects.

This is a significant release because of the new documentation site:  

http://www.hugsql.org/

Recent changes from 0.2.x to 0.3.0 include:

   - New doc site!
   - Comparison to Yesql (on doc site) - this was requested by many
   - Example application as source for doc examples (*The Princess Bride* 
   themed!)
   - Tuple List Parameter Type for multi-record insert support
   - Pass-through options to the underlying database library (e.g., 
   :as-arrays?)
   - Defer adapter selection as late as possible
   - Added on-exception to HugsqlAdapter protocol to allow implementations 
   to redirect exceptions (helps with usage in core.async channels)
   - Error checks for sql file existence, parameter mismatch errors
   - Minor bug fixes

I'd like to give special thanks to Robin Heggelund Hansen, who jumped in 
early on filing issues, writing code, and making good suggestions for this 
very new project.  Robin is also the author of the HugSQL Adapter for 
postgres.async <https://github.com/Skinney/hugsql-async>.

What is HugSQL?  HugSQL...

   - takes the position that SQL is the right tool for the job when working 
   with a relational database.
   - uses simple conventions in your SQL files to define (at compile time) 
   database functions in your Clojure namespace, creating a clean separation 
   of Clojure and SQL code.
   - supports run-time replacement of SQL Value Parameters (e.g., where id 
   = :id), SQL Identifiers (i.e. table/column names), and SQL Keywords. You 
   can also implement your own parameter types.
   - has protocol-based adapters supporting multiple database libraries and 
   ships with adapters for clojure.java.jdbc (default) and clojure.jdbc


Thanks!

Curtis Summers

-- 
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/d/optout.


Re: [ANN] a HugSQL adapter for postgres.async

2015-11-04 Thread Curtis Summers
Author of HugSQL here.  

Yes, I'm working on a new docs site for HugSQL since the README is getting 
a bit long, and it will have a Yesql comparison as Robin stated.  I think 
Robin's list if fairly accurate.  I may approach it from the design goals 
point-of-view along with usage differences in the docs.

(For the record, I like Yesql and have it in production.  HugSQL grew out 
of a recent project where I needed to replace parameters specifying SQL 
identifiers (table names/column names) and SQL keywords--which is beyond 
the normal value parameter replacement offered in Yesql.)

Stay tuned.  I'll announce the next HugSQL release on this list when it is 
ready.

Thanks,

Curtis

On Wednesday, November 4, 2015 at 5:28:04 PM UTC-6, Robin Heggelund Hansen 
wrote:
>
> The author of HugSQL is working on documentation now, and I believe he 
> will include a decent comparison to YeSQL in the process.
>

-- 
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/d/optout.


[ANN] HugSQL 0.1.1 - Embrace SQL

2015-10-21 Thread Curtis Summers
I'm happy to announce a new library for working with SQL in your Clojure 
projects: 

*HugSQL*

https://github.com/layerware/hugsql

HugSQL takes the position that SQL is the right tool for the job when 
working with a relational database. Embrace SQL!

At a glance, HugSQL:

   - uses simple conventions in your SQL files to define (at compile time) 
   database functions in your Clojure namespace, creating a clean separation 
   of Clojure and SQL code.
   - supports run-time replacement of SQL value parameters (e.g., where id 
   = :id), SQL identifiers (i.e. table/column names), raw SQL keywords, and 
   your own parameter types.
   - has protocol-based adapters supporting multiple database libraries and 
   ships with adapters for clojure.java.jdbc (default) and clojure.jdbc


This library is still in early development, and at this point I'm looking 
for feedback, rough-edges, your particular use cases, etc.

See the README for clojar install information: 
https://github.com/layerware/hugsql


Thanks,

Curtis Summers


-- 
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/d/optout.


Re: [ClojureScript] Re: ANN: ClojureScript 0.0-2301, Transducers!

2014-08-09 Thread Curtis Summers
The issue is resolved for me also.  Thanks!

--Curtis


On Sat, Aug 9, 2014 at 10:18 AM, Paul Burt  wrote:

> On Saturday, 9 August 2014 16:03:57 UTC+1, Rick B  wrote:
> > There was a cache issue for the maven-metadata.xml and the possibly the
> jar files for 0.0-2301 and 0.0-2307. We have purged our CDN cache for those
> files which should have resolved it. If not, please let us know.
>
> The issue is resolved for me now. Thanks!
>
> --
> Note that posts from new members are moderated - please be patient with
> your first post.
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "ClojureScript" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojurescript/ghpbnZKjx3w/unsubscribe.
> To unsubscribe from this group and all its topics, 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/d/optout.


Re: [ClojureScript] Re: ANN: ClojureScript 0.0-2301, Transducers!

2014-08-09 Thread Curtis Summers
I think this may be a cache issue with the central repo.  I can both see the 
file via browsing and they are in the index for me, but the actual jar file 
brings up a 404:

http://repo1.maven.org/maven2/org/clojure/clojurescript/0.0-2307/clojurescript-0.0-2307.jar

However, appending a junk query string on the url correctly downloads the jar:

http://repo1.maven.org/maven2/org/clojure/clojurescript/0.0-2307/clojurescript-0.0-2307.jar?cache-is-broken

It looks like this is being served up via varnish cache.  The jar url is 
somehow cached as a 404.  Depending on your location and the various central 
repo caches, you may be seeing different results (e.g., the index not listing 
the versions).

Anybody know who to contact at central repo?

--Curtis


On Saturday, August 9, 2014 6:00:47 AM UTC-5, Nicola Mometto wrote:
> I can confirm, there seem to be problem fetching clojurescript versions
> 
> 0.0-2301 and 0.0-2307.
> 
> 
> 
> Browsing the Central repo the files are there:
> 
> http://repo1.maven.org/maven2/org/clojure/clojurescript/0.0-2301/
> 
> http://repo1.maven.org/maven2/org/clojure/clojurescript/0.0-2307/
> 
> 
> 
> But the maven-metadata.xml file hasn't indexed them:
> 
> http://repo1.maven.org/maven2/org/clojure/clojurescript/maven-metadata.xml
> 
> 
> 
> 
> 
> Frank Versnel writes:
> 
> >
> 
> > Hi David,
> 
> >
> 
> > Leiningen couldn't find this version on clojars/maven central. Any other 
> > repository I might need to add to get access to super early clojurescript 
> > builds?
> 
> >
> 
> > Cheers,
> 
> > Frank

-- 
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/d/optout.


Re: Leiningen profile problem

2014-07-28 Thread Curtis Summers
Paul,

Leiningen can isolate the target-paths by profile if you use :target-path 
in your project.clj with the %s in it.  

Per the sample project.clj file (
https://github.com/technomancy/leiningen/blob/master/sample.project.clj):

  ;; All generated files will be placed in :target-path. In order to avoid
  ;; cross-profile contamination (for instance, uberjar classes interfering
  ;; with development), it's recommended to include %s in in your custom
  ;; :target-path, which will splice in names of the currently active profiles.
  :target-path "target/%s/"




--Curtis


On Monday, July 28, 2014 12:40:45 PM UTC-5, Paul Butcher wrote:
>
> Ah! I thought that Leiningen put class files in different places for 
> different profiles, but it looks like I was mistaken.
>
> Thanks for the EDN hint - that sounds like a good way to go.
>
> Cheers!
>
> --
> paul.butcher->msgCount++
>
> Silverstone, Brands Hatch, Donington Park...
> Who says I have a one track mind?
>
> http://www.paulbutcher.com/
> LinkedIn: http://www.linkedin.com/in/paulbutcher
> Skype: paulrabutcher
>
> Author of Seven Concurrency Models in Seven Weeks: When Threads Unravel
> http://pragprog.com/book/pb7con
>
> On 28 July 2014 at 18:01:16, Thomas Heller (th.h...@gmail.com 
> ) wrote:
>
>  Your issue is probably due to AOT compilation, uberjar aot compiles 
> everything and leaves alot of class files in your target directory (aka 
> classpath). When you run your app afterwards the class file is used instead 
> of the clj file since the .class file is "newer". When you run lein clean 
> those .class files are removed and the classloader then looks for the clj 
> file.
>
> I'd recommend keeping a config file (can be EDN) and just having a 
> development and production version instead of using different code. You can 
> either use a command line argument to choose which config to load or use 
> leinigen profiles and resource paths so only include the one you want.
>
> HTH,
> /thomas
>
> On Monday, July 28, 2014 3:45:51 PM UTC+2, Paul Butcher wrote: 
>>
>>  Oops - I originally sent this to the ClojureScript group, which 
>> probably wasn’t the best place. Apologies to those who subscribe to both 
>> lists for the spam:
>>  
>>  I’m clearly misunderstanding something fundamental about how Leiningen 
>> profiles work. I’d appreciate help fixing my understanding.
>>
>> I’m trying to create a Ring server that behaves differently when in 
>> production or development mode. I’ve checked a minimal cut-down version of 
>> my server into GitHub here:
>>
>>  https://github.com/paulbutcher/profile-problem
>>
>> There are two different versions of config.clj. The production version 
>> looks like this:
>>
>>   (ns problem.config)
>>  (def production true)
>>  
>> And the development version like this: 
>>
>>   (ns problem.config)
>>  (def production false)
>>  
>> The profiles section of project.clj adds the appropriate one of these to 
>> source-paths depending on which profile is active:
>>
>> :profiles {:production {:source-paths ["production/src"]}
>>   :dev {:source-paths ["dev/src"]}
>>   :uberjar [:production {:aot :all}]}
>>  
>> Finally, the server prints a message during startup:
>>
>>  (println "Starting in" (if config/production "production" "development")
>>  "mode"))
>>
>> This all works fine - if I run “lein ring server-headless” or “lein 
>> with-profile dev server-headless”, I see “Starting in development mode” and 
>> if I run “lein with-profile production server-headless”, I see “Starting in 
>> production mode”.
>>
>> So far so good.
>>
>> The problem arises after I run “lein ring uberjar”. The uberjar works 
>> exactly as I would expect (it runs in production mode). But if I then run 
>> “lein ring server-headless” or “lein with-profile dev server-headless” in 
>> my project directory, instead of seeing “Starting in development mode”, I 
>> see “Starting in production mode”.
>>
>> Running “lein clean” sorts the problem out, but I worry that I’m missing 
>> something fundamental that’s going to bite me at some point…
>>
>> Thanks in advance...
>>  
>>  --
>> paul.butcher->msgCount++
>>
>> Silverstone, Brands Hatch, Donington Park...
>> Who says I have a one track mind?
>>
>>  http://www.paulbutcher.com/
>> LinkedIn: http://www.linkedin.com/in/paulbutcher
>> Skype: paulrabutcher
>>
>> Author of Seven Concurrency M

Re: reloading enlive templates

2014-07-03 Thread Curtis Summers
I'm using ring.middleware.force-reload to always reload the namespaces that 
reference my enlive templates.  (only in dev, of course)

https://github.com/citizenparker/ring-middleware-force-reload


Hope that helps,

Curtis

On Wednesday, July 2, 2014 3:14:16 PM UTC-5, Sven Richter wrote:
>
> Hi,
>
> I am trying to reload my enlive templates with a watcher, how it was 
> suggested in this issue: https://github.com/cgrand/enlive/issues/6
>
> I am calling this function of start of my application:
>
>(watcher/watcher ["resources/"]
> (watcher/rate 50) ; poll every 50ms
> (watcher/on-change (fn [file] (do (println "file 
>changed: " file)
>  ;(use 'de.sveri.clj.adspread 
>:reload) ;as soon as I uncomment this, the anonymous function is not 
> called 
>anymore
>
>
> But just like I stated in the comment, as soon as I try to reload a 
> namespace the anonymous function is not executed anymore, whereas without 
> the (use ...) call it gets executed on file change.
> I also tried to call (reload 'namespace) but that did not work either.
>
> Any ideas on how to fix this or make enlive templates reload on change?
>
> Best Regards,
> Sven
>

-- 
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/d/optout.


Re: alternative syntax for Clojure? Haskell?

2014-04-05 Thread Curtis Gagliardi
It's a sincere no from me, but I can tell you I've met plenty of 
non-clojurites/lispers who sneer at lisp it seems solely due to the 
parentheses.  It seems misguided to me though.

On Saturday, April 5, 2014 1:14:36 PM UTC-7, Travis Wellman wrote:
>
> Francois Rey,
>
> Yes I've been following that project. They're going for purity, which 
> means reimplementing a lot of standard java stuff in Frege. Cool project, 
> but what I really want is Clojure. Everything Clojure without the parens. 
> So you'd get lists, and homoiconicity, and all the Clojure libs, but it 
> would look different.
>
> Part of posting here is to gauge whether, if I wrote such a thing to 
> scratch my own itch, anyone else would like it. So far I'm getting a pretty 
> sincere "no" it seems. It's partially a bad survey because the people here 
> are the people who like it here.
>
> Greg, Xtext is new to me, I'll look at it. Antlr is used in a project I'm 
> getting paid for right now, so I might try that.
>
> Gary, I think this is the essence of the maintainability problem. The 
> terseness of Clojure is pleasurable to the programmer, and they don't 
> compensate with documentation or longer function names. What you get is a 
> short statement that requires detangling levels of macros and abstractions 
> to understand. Honestly I wish programmers had to pay $20 to write a macro. 
> Macros are great but should very very rarely be used. Granted none of this 
> would be fundamentally changed with a new syntax, but I feel like if one 
> didn't begin a line with a paren, one might begin more lines instead of 
> nesting deeper; I could easily be wrong about that.
>
> Travis
>

-- 
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/d/optout.


Re: Latest web framework for clojure

2014-02-26 Thread Curtis Gagliardi
If you're interested in the url-generation and data-based routing, there 
are some Compojure competitors like Bidi which have those features without 
bringing on something as large as Pedestal: https://github.com/juxt/bidi 
(the readme has a nice comparison chart). 

On Tuesday, February 25, 2014 11:57:18 PM UTC-8, Jan Herich wrote:
>
> It depends also on your requirements. For example if you want your app to 
> work in many 
> deployment scenarios (standalone Jetty  or Tomcat, J2EE web containers...) 
> and you may 
> have to use servlet 3.0 API asynchronous features, nothing beats pedestal 
> currently.
>
> The concept of interceptors is little harder to grok then simple ring 
> handlers (which are reused
> to the greatest possible extent anyway), but they really make sense and 
> truly decomplect
> execution order, unlike traditional ring wrapping handlers.
>
> The routing systems is also more transparent (data based) then Compojure 
> macro routing
> and the url generation facility is nice.
>
> Sometimes i hear people say that pedestal is "unclojurish" and complex, 
> but i think they
> just don't get the difference between complex and easy. Overall, i think 
> that pedestal 
> represents core clojure philosophy better then any other clojure server 
> side framework.
>
> Dňa streda, 26. februára 2014 2:13:30 UTC+1 Aravindh S napísal(-a):
>>
>> Hi All,
>>I have been reading clojure for sometime now. I am at a point where I 
>> want to learn a web framework. I see many options available for clojure 
>> where few are built upon others. So if I am to learn one, which framework 
>> does the community recommend? 
>>
>> Thanks
>> Aravindh.S
>>
>

-- 
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: Refactoring as an nREPL middleware

2014-02-08 Thread Curtis Gagliardi
Thanks, I'll definitely take a look at those libraries, I actually didn't 
do too much searching for prior art, I'll have to start now. 

You're dead on with whitespace and reader macros being a problem. I know I 
heard of someone working on trying to build a clojure formatter, so maybe 
something like that will come to fruition, otherwise I was just going to 
return something formatted in a super basic way and punt that problem to 
the user.  The reader macros though is a bigger problem that I have no idea 
how to deal with.  I ran into that with the cycle-privacy refactor.  If you 
try to read '(def ^:private a), you always get back '(def a).  I ended up 
evaling the form and calling meta on it to get the privacy, but that felt 
wrong and now that you point out #_, it's clear it's not going to work in a 
lot of cases.  I'll have to take a look at clj.tools.analyzer, thought I 
was hoping there might be some way to just turn off reader macros.  I think 
I might make a separate list post and see if anyone has ideas there. 

On Friday, February 7, 2014 3:10:49 PM UTC-8, John Hume wrote:
>
> I haven't attempted any code manipulation, just analysis and indexing, but 
> I embarked on a similar idea here: 
> https://github.com/duelinmarkers/insfactor and here: 
> http://github.com/duelinmarkers/insfactor.el. (Nothing Vim-related there, 
> the similar part is trying to put as much as possible of the smarts into 
> the same JVM as the project.) It indexes a simple clojure project and 
> provides a find-usages command, the idea being that find-usages is the 
> first useful step toward rename-var and move-var commands. (I say "simple" 
> because it still barfs on some common stuff, including defprotocol, IIRC.)
>
> Focusing on what you're doing in http://github.com/cgag/nrepl-refactor, 
> the mess I came upon and backed away from when I initially played with 
> transforming code in Clojure is that the forms are easy to manipulate but 
> formatting is hard to maintain. There are also several non-whitespace bits 
> of source that the reader will hide away from you (including comments and 
> #_ forms) but that a proper refactoring tool won't clobber.
>
> If you haven't already, you might take a look at 
> https://github.com/cgrand/sjacket.
>
> I've been hoping that the new 
> https://github.com/clojure/tools.analyzer<https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fclojure%2Ftools.analyzer&sa=D&sntz=1&usg=AFQjCNGdQqvOgv4UWDokQ46-YhCAp7AqLQ>
>  work 
> will support some of what source manipulation tools are likely to need, but 
> I haven't looked into it. For example, one hassle with 
> jvm.tools.analyzer (at least the now outdated version I've been using) is 
> that the reader doesn't provide line and column metadata in many places 
> where you'd expect to find it. Another is that it can only show you the 
> post-macro-expansion view of the world.
>
>
>
> On Fri, Feb 7, 2014 at 3:51 PM, Curtis Gagliardi 
> 
> > wrote:
>
>> Hey everyone, I just wanted to get some feedback on whether or not this 
>> is a good idea.  I've seen clj-refactor.el recommended a decent amount, but 
>> as a dyed-in-the-wool take-no-prisoners vim user, I can't use it.  I've 
>> always thought it was weird that refactoring was so tightly coupled to 
>> editors and IDEs, so I thought I'd try writing some refactors as an nrepl 
>> middleware, that would ideally be able to be used across editors.  I've 
>> only re-implemented the threading and some of the cycling refactors from 
>> clj-refactor.el, but it's to the point where I'm going to investigate 
>> actually integrating with vim or light table.  I've never written any 
>> plugins for either of these editors so I might discover there are good 
>> reasons I haven't seen refactoring done as a client/server type thing.  
>> Anyway, the code is here: https://github.com/cgag/nrepl-refactor , if 
>> anyone has any has any feedback I'd love to hear it, and if anyone has 
>> vimscript or lighttable plugin experience and wants to help, that'd be 
>> great as well.
>>
>> Curtis
>>
>> -- 
>> 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 receiv

Refactoring as an nREPL middleware

2014-02-07 Thread Curtis Gagliardi
Hey everyone, I just wanted to get some feedback on whether or not this is 
a good idea.  I've seen clj-refactor.el recommended a decent amount, but as 
a dyed-in-the-wool take-no-prisoners vim user, I can't use it.  I've always 
thought it was weird that refactoring was so tightly coupled to editors and 
IDEs, so I thought I'd try writing some refactors as an nrepl middleware, 
that would ideally be able to be used across editors.  I've only 
re-implemented the threading and some of the cycling refactors from 
clj-refactor.el, but it's to the point where I'm going to investigate 
actually integrating with vim or light table.  I've never written any 
plugins for either of these editors so I might discover there are good 
reasons I haven't seen refactoring done as a client/server type thing.  
Anyway, the code is here: https://github.com/cgag/nrepl-refactor , if 
anyone has any has any feedback I'd love to hear it, and if anyone has 
vimscript or lighttable plugin experience and wants to help, that'd be 
great as well.

Curtis

-- 
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: standard indentation tool

2014-01-28 Thread Curtis Gagliardi
It'd be cool to build a frormatter as an nrepl middleware and get 
consistent indents across editors and not have to hardcode custom 
indentations for macros. 

On Monday, January 27, 2014 8:47:31 PM UTC-8, bob wrote:
>
> Hi All,
>
> Should clojure have a standard format tool like go lang, it will waste 
> time.
>
> 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 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: [Large File Processing] What am I doing wrong?

2014-01-27 Thread Curtis Gagliardi
If ordering isn't important, I'd just dump them all into a set instead of 
manually checking whether or or not you already put the url into a set. 


On Sunday, January 26, 2014 10:46:46 PM UTC-8, danneu wrote:
>
> I use line-seq, split, and destructuring to parse large CSVs.
>
> Here's how I'd approach what I think you're trying to do:
>
> (with-open [rdr (io/reader (io/resource csv :encoding "UTF-16"))]
> (let [extract-url-hash (fn [line]
>  (let [[_ _ _ url & _] (str/split line 
> #"\t")]
>[(m/md5 url) url]))]
>   (->> (drop 1 (line-seq rdr))
>(map extract-url-hash)
>(into {}
>
> https://gist.github.com/danneu/8644022
>
> On Tuesday, January 21, 2014 12:55:00 AM UTC-6, Jarrod Swart wrote:
>>
>> I'm processing a large csv with Clojure, honestly not even that big (~18k 
>> rows, 11mb).  I have a list of exported data from a client and I am 
>> de-duplicating URLs within the list.  My final output is a series of 
>> vectors: [url url-hash].
>>
>> The odd thing is how slow it seems to be going.  I have tried 
>> implementing this as a reduce, and finally I thought to speed things up I 
>> might try a "with-open and a loop-recur".  It doesn't seem to have done 
>> much in my case.  I know I am doing something wrong I'm just not sure what 
>> yet.  The best I can do is about 4 seconds, which may only seem slow 
>> because I implemented it in python first and it takes a half second to 
>> finish.  Still this is one of the smaller files I will likely deal with so 
>> I'm worried that as the files grow it may get too slow.
>>
>> The code is here on ref-heap for easy viewing: 
>> https://www.refheap.com/26098
>>
>> Any advice is appreciated.
>>
>

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


Re: How to handle configuration in Clojure?

2014-01-17 Thread Curtis Gagliardi
I've been using carica (https://github.com/sonian/carica) and have config 
map like {:dev <...> :prod <...>} and just using a single environmental 
variable to determine which of those config maps to use. 

On Friday, January 17, 2014 5:06:31 AM UTC-8, Malcolm Sparks wrote:
>
> There's also Jig : https://github.com/juxt/jig
>
> Jig's recommendation is for configuration to be held in EDN files.
>
> I much prefer EDN over environment variables. Environment variables feel 
> awkward when there you have lots of configuration, usually in the form of a 
> tree.
>
> Usually it makes sense to have one configuration file per environment. 
> That can make it hard to keep configuration files up to date, so judicious 
> use of the #=() Clojure reader macro can allow you to programmatically 
> deviate from a default configuration - often the delta from a default 
> configuration is more informative. There are more details in Jig's 
> README.md file.
>
> I agree with the comments against using dynamic vars. They reduce the 
> ability to reason about functions and are precarious when dealing with 
> threads - binding conveyance is tricky and small mistakes can lead to 
> elusive bugs.
>
> I pass configuration as a single argument into types/records that declare 
> lifecycle methods. I have found this pattern to serve me well in over a 
> dozen projects. Since stumbling on this pattern I have had no need to 
> resort to dynamic vars for environment config, and my projects have been 
> smaller, more reliable and easier to reason about.
>
>
> On Tuesday, January 14, 2014 9:04:45 AM UTC, James Trunk wrote:
>>
>> Thanks for all the great links and ideas you have all posted, now I have 
>> plenty of reading and thinking to do!
>>
>> > I am curious about what you mean by 'thread safety'.
>> Perhaps "thread safety" is the wrong term, but what I meant was the 
>> limitations dynamic binding introduces around thread dispatching, which 
>> Stuart Sierra explains in this blog 
>> post
>> .
>>
>> Cheers,
>> James
>>
>> On Monday, January 13, 2014 7:10:38 PM UTC+1, Stefan Kanev wrote:
>>>
>>> On 13/01/14, James Trunk wrote: 
>>> > The downsides to dynamic vars seem to be: hiddenness, thread safety, 
>>> and 
>>> > more complex tests (binding before each test). 
>>>
>>> I am curious about what you mean by 'thread safety'.  As far as I know, 
>>> dynamic variables are thread-local, which means that they are 
>>> thread-safe, at least to some extend.  I assume you mean something 
>>> specific? 
>>>
>>> -- 
>>> Stefan Kanev  ¦  @skanev  ¦  http://skanev.com/ 
>>> If a program manipulates a large amount of data, it does so in a small 
>>> number 
>>> of ways. 
>>>
>>

-- 
-- 
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: RESTful API Auth with Friend and Liberator

2014-01-17 Thread Curtis Gagliardi
Exactly the kind of article I was going to looking for in a few days, 
excellent.

On Friday, January 17, 2014 1:27:10 PM UTC-8, Sam Ritchie wrote:
>
>  Hey guys,
>
> Those of you working on webapps might find this interesting:
>
>
> http://sritchie.github.io/2014/01/17/api-authentication-with-liberator-and-friend/
>
> Enjoy!
> -- 
> Sam Ritchie (@sritchie)
> Paddleguru Co-Founder
> 703.863.8561
> www.paddleguru.com
> Twitter  // 
> Facebook
>  

-- 
-- 
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: Good learning resources for Clojure novice but with a long background i programming, both OO and some Fp?

2014-01-10 Thread Curtis Gagliardi
I also want to second watching all of Rich Hickey's talks, especially "are 
we there yet" and "simple made easy", they really help you get the 
philosophies behind the language.  For me, I found myself agreeing with all 
the principles of simplicity he talks about, and it increased both my 
motivation to the learn the language and my understanding of why it is the 
way it is.  

On Friday, January 10, 2014 11:20:47 AM UTC-8, Curtis Gagliardi wrote:
>
> I really think Clojure Programming is the best Clojure book out there.  If 
> you read that thing most (or all) of the way through, you'll have a very 
> solid understanding of Clojure.  
>
> On Friday, January 10, 2014 4:52:53 AM UTC-8, christian jacobsen wrote:
>>
>> I have +10 years experience of OO programming (C++, C# and a little Java) 
>> and a couple of years of FP programming (mainly F#, some Scala and a little 
>> Haskell). 
>> Are there any resources for learning Clojure that are particular good for 
>> someone with the above background?
>>
>

-- 
-- 
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: Good learning resources for Clojure novice but with a long background i programming, both OO and some Fp?

2014-01-10 Thread Curtis Gagliardi
I really think Clojure Programming is the best Clojure book out there.  If 
you read that thing most (or all) of the way through, you'll have a very 
solid understanding of Clojure.  

On Friday, January 10, 2014 4:52:53 AM UTC-8, christian jacobsen wrote:
>
> I have +10 years experience of OO programming (C++, C# and a little Java) 
> and a couple of years of FP programming (mainly F#, some Scala and a little 
> Haskell). 
> Are there any resources for learning Clojure that are particular good for 
> someone with the above background?
>

-- 
-- 
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] DACOM: A skeleton app, Leiningen template for Datomic, Compojure, and Om

2014-01-10 Thread Curtis Gagliardi
That's my stack right now, I'll have to check this out and take notes, see 
what we're doing differently.  This is all pretty uncharted territory it 
seems.  Thanks for putting this out there.

On Thursday, January 9, 2014 9:06:34 PM UTC-8, Kevin Bell wrote:
>
> A Leiningen template featuring all of the most popular Clojure 
> technologies that all of the coolest kids are using:
>
> sample project repo 
>
> or
>
> `lein new dacom my-project`
>

-- 
-- 
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: Om, a ClojureScript binding to Facebook's React

2014-01-06 Thread Curtis Gagliardi
I watched a few talks from facebook people about React and was impressed, 
lots of talk about the simplicity of just rerendering everything and pure 
functions.  I think this is the first time I've been excited about a 
javascript framework, looking forward to trying it out with Om. 

On Sunday, January 5, 2014 9:05:06 PM UTC-8, David Pidcock wrote:
>
> Ha! Just saw your Sortable example popup in Git! 
>
> Very cool. 
>
>
>
> On Thursday, January 2, 2014 4:00:45 PM UTC-8, David Pidcock wrote: 
> > Very nice. Relatively easy to follow.  Basically it's re-implementing 
> the drag-list behaviour  in React.  I had thought to re-use some existing 
> code, provided I could inform React that the DOM was changing. (This is the 
> approach used by the example in the fiddler, albeit with jquery instead of 
> goog.closure as the UI manipulation library) 
> > 
> > 
> > I'm very interested to see what you do with this, in Om. 
> > This example is complex enough that following along would most likely 
> fill in the conceptual gaps for me, that the TODO example lacks. 
> > 
> > 
> > Again - inspiring work..  
> > 
> > 
> > -- David 
> > 
> > 
> > On Monday, December 30, 2013 10:02:37 PM UTC-8, David Nolen wrote: 
> > 
> > From a React dev: 
> > 
> > https://www.khanacademy.org/preview/content/items/xfa03b103 
> > 
> > 
> https://github.com/Khan/perseus/blob/master/src/widgets/orderer.jsx#L6-L439 
> > 
> > 
> > 
> > 
> > I'm sure this can be adapted for Om. I may write up a simpler Om example 
> in the future. 
> > 
> > 
> > David 
> > 
> > 
> > 
> > On Tue, Dec 31, 2013 at 12:43 AM, David Pidcock  
> wrote: 
> > 
> > 
> > On Thursday, December 19, 2013 11:12:12 AM UTC-8, David Nolen wrote: 
> > 
> > > Enjoy, 
> http://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/ 
> > 
> > > 
> > 
> > > 
> > 
> > > 
> > 
> > > David 
> > 
> > 
> > 
> > I've been playing around with some basics. I'm still a relative n00b 
> when it comes to functional programming, and I've never looked at React 
> before. 
> > 
> > 
> > 
> > Very cool stuff. 
> > 
> > 
> > 
> > I managed to get Om+React to display a list of items that are sorted by 
> a given key, and I have a content-editable span which updates the state of 
> the owner with new value of that key for a given item, and voila! the list 
> item moves to the correct position. (as expected) 
> > 
> > 
> > 
> > 
> > Now here's the tricky part... 
> > 
> > I want to implement a drag-list, where I can drag-drop items into a new 
> position, and update the key based on the new position. I have that 
> algorithm working in a different project (using goog.DragListGroup) , but 
> React does not like you to manipulate the DOM outside it's knowledge. 
> > 
> > 
> > 
> > 
> > I found this : 
> > 
> > 
> https://groups.google.com/forum/#!searchin/reactjs/sortable/reactjs/mHfBGI3Qwz4/rXSr-1QUcKwJ
>  
> > 
> > 
> > 
> > which lead to 
> > 
> > http://jsfiddle.net/LQxy7/ 
> > 
> > 
> > 
> > Unfortunately,  I can't get this to work with Om. I am having trouble 
> navigating the data structures. 
> > 
> > 
> > 
> > How are "props" created/accessed? I followed the TodoMVC example, but 
> that seems to be using "state", which I am given to understand should be 
> kept as high in the hierarchy as possible (per the React recommendations). 
>  I tried something like  (:value (om/get-props this)) from within IRender, 
> but that doesn't work. Also : (om/get-props this [:items] )  (following the 
> idiom established by get-state. 
> > 
> > 
> > 
> > 
> > I'm probably missing something obvious, so I thought I'd pop in here to 
> see if there's someone who can point me in the right direction. 
> > 
> > 
> > 
> > 
> > 
> > -- 
> > 
> > 
> > -- 
> > 
> > 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 bec

Re: Seeking remote Clojure work

2014-01-04 Thread Curtis Gagliardi
I'm also interested in Clojure contract work (though local would be fine if 
it's in SF), do we have any sort of place/list for Clojure jobs or is the 
supply low enough that this list is the main place?

On Saturday, January 4, 2014 9:39:38 AM UTC-8, Iro Wright wrote:
>
> Thanks for the tip Marcus.
>
> On Friday, January 3, 2014 1:52:03 AM UTC-5, Marcus Blankenship wrote:
>>
>> Iro, you might check out Cognitect…
>>
>> http://cognitect.com/jobs
>>
>>
>> On Jan 2, 2014, at 2:38 PM, Iro Wright  wrote:
>>
>> Anyone out there hiring remotely for contract, part time, or full time?
>> Please leave an email address - I'll reply with my resume and GitHub 
>> handle.
>>
>> Thanks
>>
>> -- 
>> -- 
>> 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.
>>
>>
>> Marcus Blankenship
>> \\\ Partner, Problem Solver, Linear Thinker
>> \\\ 541.805.2736 \ @justzeros \ skype:marcuscreo
>>  
>>

-- 
-- 
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 do I serve clojure pages with nginx

2013-12-18 Thread Curtis Gagliardi
I don't know how to configure an init script, but I just run the command 
`java -jar mywebserver.jar` in a tmux session manually and then detach.

For how to setup an uberjar to run a web server, there's a nice tutorial on 
clojure-doc.  You just need to make sure you have your :main class 
specified in project.clj and have :gen-class on the right files.   Check 
out the deploy your webapp section: 
http://clojure-doc.org/articles/tutorials/basic_web_development.html 

On Wednesday, December 18, 2013 2:35:11 PM UTC-8, Curtis Gagliardi wrote:
>
> I build an uberjar of a web server that uses jetty with compojure and run 
> it on port 3000, then I have nginx configured to proxy it like so:
>
> https://gist.github.com/cgag/8031034
>

-- 
-- 
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 do I serve clojure pages with nginx

2013-12-18 Thread Curtis Gagliardi
I build an uberjar of a web server that uses jetty with compojure and run 
it on port 3000, then I have nginx configured to proxy it like so:

https://gist.github.com/cgag/8031034

-- 
-- 
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 The Joy if Clojure up to date?

2013-11-30 Thread Curtis Gagliardi
I just want to second the recommendation of Clojure Programming as a first 
book before you dive into JoC (2nd edition).

On Saturday, November 30, 2013 2:43:08 PM UTC-8, Sean Corfield wrote:
>
> +1 for Manning's MEAP approach - I've bought most of my Manning books 
> through the early access program over the years. 
>
> Also +1 for JoC not really being a beginner's book. I generally 
> recommend Clojure Programming (Emerick, Carper, Grand) as a first 
> book. Programming Clojure 2nd ed is good too. I expect Clojure in 
> Action 2nd ed to be worthwhile (I liked the 1st ed but it appeared 
> just after 1.3 hit and a lot of the examples in the book no longer 
> worked properly - Manning knew the book would be out of date at 
> release so I was disappointed they didn't listen to people who 
> suggested they delay release until it could be updated to 1.3). 
>
> FWIW, JoC was my first Clojure book - but I had a solid background in 
> both Lisp and FP, although I hadn't done much with either for many, 
> many years... 
>
> Buy as many of the latest editions as you can afford :) 
>
> Sean 
>
> On Sat, Nov 30, 2013 at 10:59 AM, John Mastro 
> > 
> wrote: 
> > Manning (the publisher) has an interesting early-access program called 
> MEAP. I used it to buy [1] electronic access to both the first edition and 
> the second edition (the in-progress version immediately, plus the final 
> version when it's released). I've been very happy with the arrangement. 
> > 
> > [1] http://www.manning.com/fogus2/ 
> > 
> > - John 
> > 
> >> On Nov 30, 2013, at 10:34 AM, Mars0i > 
> wrote: 
> >> 
> >> Amazon claims that the publication date of the second edition is Feb. 
> 28, 2014. 
> > 
> > -- 
> > -- 
> > 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. 
>
>
>
> -- 
> Sean A Corfield -- (904) 302-SEAN 
> An Architect's View -- http://corfield.org/ 
> World Singles, LLC. -- http://worldsingles.com/ 
>
> "Perfection is the enemy of the good." 
> -- Gustave Flaubert, French realist novelist (1821-1880) 
>

-- 
-- 
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] Slamhound 1.5.0 + screencast + Vim plugin

2013-11-30 Thread Curtis Gagliardi
Great screencast, thanks.  Will definitely check this release out, I tried 
it a few months ago and failed to get it to run.  Looks really promising 
though.  

On Friday, November 29, 2013 8:14:36 PM UTC-8, guns wrote:
>
> Hello, 
>
> I am happy to announce version 1.5.0 of Slamhound, technomancy's amazing 
> ns rewriting tool. 
>
> ;; ~/.lein/profiles.clj 
> {:user {:dependencies [[slamhound "1.5.0"]]}} 
>
> This is a *major* bugfix release. If you've tried Slamhound in the past 
> and felt frustrated, now is a great time to give it another try. 
>
> If you're unfamiliar with Slamhound, I've posted a short screencast 
> here: 
>
> https://vimeo.com/80650659 
>
> Many thanks to Phil Hagelberg for allowing me to take the reins for this 
> release. 
>
> Enhancements since the last version include: 
>
> - Greatly improved detection and disambiguation of missing ns 
>   references. Slamhound is now much better at DWIM. 
>
> - References in the existing ns form are always preferred over other 
>   candidates on the classpath. 
>
> - Mass-referred namespaces (via :use or :refer :all) are preserved 
>   as (:require [my.ns :refer :all]). Simply remove it from the ns 
>   form to get a vector of explicit refers. 
>
> - File comment headers, ns metadata maps, docstrings, and :require 
>   flags (:reload et al), are correctly preserved. 
>
> - Multiple options per require libspec are emitted correctly. 
>   e.g. (:require [clojure.test :as t :refer [deftest]]) 
>
> - Classes created via defrecord/deftype etc are correctly found. 
>
> - Capitalized vars that shadow class names are no longer ignored. 
>
> A full changelog is available here: 
>
> https://github.com/technomancy/slamhound/blob/master/CHANGES 
>
> Finally, for Vim users there is a new plugin for Slamhound integration: 
>
> https://github.com/guns/vim-slamhound 
>
> It was always easy to use Slamhound from fireplace.vim, but now it's 
> just a Pathogen infect away. 
>
> Cheers, 
>
> guns 
>

-- 
-- 
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: quick macro review

2013-11-29 Thread Curtis Gagliardi
Beautiful, thanks guys.

On Thursday, November 28, 2013 10:26:05 PM UTC-8, Alex Baranosky wrote:
>
> This also works, I believe:
>
> (defmacro migrate [& migration-syms]
>   (let [migration-vars (for [sym migration-syms]
>`(var ~sym))]
> `(migrate* ~@migration-vars)))
>
>
> On Thu, Nov 28, 2013 at 5:22 PM, juan.facorro 
> 
> > wrote:
>
>> Hi Curtis,
>>
>> The *apply* is unnecessary if you use *unquote-splice* (*~@*), also 
>> instead of the *into* and *for* usage you could just *map* over the list 
>> of symbols.
>>
>> Here's how I would do it:
>>
>> (defmacro migrate [& syms]
>>   `(migrate* ~@(map (partial list 'var) syms)))
>>
>> (macroexpand-1 '(migrate a b c)) 
>>
>> ;= (user/migrate* (var a) (var b) (var c))
>>
>>
>> Hope it helps,
>>
>> Juan
>>
>> On Friday, November 29, 2013 5:26:14 AM UTC+8, Curtis Gagliardi wrote:
>>>
>>> I wrote a macro last night and got the feeling I did what I did in a 
>>> suboptimal way.
>>>
>>> I have have a migration function that I stole from technomancy that 
>>> takes in the vars of migration functions: 
>>> (migrate #'create-db #'add-users-table #'etc)
>>>
>>> It uses the name of the var from the metadata to record which migrations 
>>> have been run.  I wanted to try to make it so you didn't have to explicitly 
>>> pass in the vars, and just have the migrate function call var for you.  
>>> I've since decided this is a bad idea but I wrote the macro anyway just for 
>>> fun.  My first question is: could this be done without a macro?  I didn't 
>>> see how since if you write it as a function, all you recieve are the actual 
>>> functions and not the vars, but I thought I'd ask to be sure.  Assuming you 
>>> did have to write a macro, does this implementation seem reasonable?  I 
>>> felt strange about using (into [] ...).  
>>>
>>> https://www.refheap.com/21335
>>>
>>> Basically I'm trying to get from (migrate f g h) to (migrate* (var f) 
>>> (var g) (var h)), I'm not sure I'm doing it right.
>>>
>>> Thanks,
>>> Curtis.
>>>
>>  -- 
>> -- 
>> 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.


quick macro review

2013-11-28 Thread Curtis Gagliardi
I wrote a macro last night and got the feeling I did what I did in a 
suboptimal way.

I have have a migration function that I stole from technomancy that takes 
in the vars of migration functions: 
(migrate #'create-db #'add-users-table #'etc)

It uses the name of the var from the metadata to record which migrations 
have been run.  I wanted to try to make it so you didn't have to explicitly 
pass in the vars, and just have the migrate function call var for you.  
I've since decided this is a bad idea but I wrote the macro anyway just for 
fun.  My first question is: could this be done without a macro?  I didn't 
see how since if you write it as a function, all you recieve are the actual 
functions and not the vars, but I thought I'd ask to be sure.  Assuming you 
did have to write a macro, does this implementation seem reasonable?  I 
felt strange about using (into [] ...).  

https://www.refheap.com/21335

Basically I'm trying to get from (migrate f g h) to (migrate* (var f) (var 
g) (var h)), I'm not sure I'm doing it right.

Thanks,
Curtis.

-- 
-- 
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 do you configure your Ring apps?

2013-09-08 Thread Curtis Gagliardi
I do basically exactly what Christopher Allen described.

On Saturday, September 7, 2013 4:53:25 PM UTC-7, Alexandr Kurilin wrote:
>
> I'm curious to find out how you folks decided to organize configuration 
> for your Ring applications, assuming you also use configuration management 
> like Puppet/Ansiblet etc to deploy them.
>
> So far I've been using a combination of daemontools' envdir (through 
> runit) + weavejester's environ for 
> things like db address, db password, cookie secret keys, logging level 
> etc. Each one is an individual file in root-only folder that runit envdirs 
> from.
>
> I honestly can't decide whether a single configuration file (YAML, EDN, 
> whatever) would be more appropriate for this scenario or if I should go 
> ahead and continue keeping each configuration value in its own file and use 
> env to load them.
>
> What are people's thoughts on this? Any reason why one or the other would 
> be better, or is there an even better option out there I'm not considering?
>

-- 
-- 
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 and freelancing

2013-09-08 Thread Curtis Gagliardi
It's definitely suitable for the web.  I've been using it for my own 
personal web projects for a while.  I've never done any significant 
freelancing work, though I'm very interested in it.  I'm curious though if 
clients are open to having their stuff built in a rather niche language 
where they might have trouble finding people once you leave the project.  I 
get the feeling lots of people are out there specifically looking for rails 
devs, but not many looking specifically for Clojure.  Would definitely be 
interested on hearing anyone's experience doing non-full-time work with 
Clojure.  

On Sunday, September 8, 2013 1:31:13 PM UTC-7, Mateusz Dobek wrote:
>
> Is Clojure good choice for one-man-webdevelopment-team?
>
> I switched form Ruby on Rails, and now I'm learing Clojure.  It seems to 
> be really powerfull language, but will it suits for web? 
> Wanna give it a try in Pedestal framework.
>

-- 
-- 
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: Screencast: understanding the thread-first and thread-last macros

2013-09-04 Thread Curtis Gagliardi
This is a pretty good demo of light table as well for people who haven't 
really been keeping up with it lately.  
On Wednesday, September 4, 2013 8:42:06 AM UTC-7, Jernau wrote:
>
> Hi everyone,
>
> I made a screencast about Clojure's *thead-first* (->) and *thread-last* 
> (->>) 
> macros:
>
> http://www.youtube.com/watch?v=qxE5wDbt964
>
> If you already have a good understanding of these macros then I'd 
> recommend skipping it, but hopefully newcomers to Clojure might learn 
> something useful.
>
> Cheers, 
> James
>

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


Re: evaluation order in loading file/project (with leiningen)

2013-09-03 Thread Curtis Summers
If you're defining functions depending on yet-to-be-defined functions, you 
may need to use the "declare" macro.

So, you may need to loop through your data with declare first, and then 
proceed with the definitions.

http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/declare

Curtis

On Monday, September 2, 2013 12:04:39 PM UTC-5, Erebus Mons wrote:
>
>
> Is there a (recommended) way of enforcing that a certain function has 
> already been evaluated  when another one is called? 
>
>
>

-- 
-- 
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: [Proposal] Simplified 'ns' declaration

2013-08-06 Thread Curtis Summers
I agree that wildcards make it "easy" (in the nearness sense), but from a 
long-term maintainability standpoint, I'd prefer to have explicit imports 
as is.  When I'm reading your code a year from now and need to look-up the 
docs on a class, wildcards make me (and anyone else in the future) have to 
do that look-up every time.  It's almost the same argument as to why (:use) 
is a bad idea--you're dumping a bunch of symbols into your namespace.  So, 
you're trading some upfront ease for some long-term simplicity.

Yes, lots of Java tutorials are of no help in this endeavor :(  (Again, see 
the parallel in the Clojure world with so much "getting started/example" 
code showing :use instead of :require).

-Curtis


The argument for wildcards is very simple.  Go to just about any Java 
tutorial, for example:

>
> http://docs.oracle.com/javase/tutorial/displayCode.html?code=http://docs.oracle.com/javase/tutorial/2d/images/examples/LoadImageApp.java
>
> The sample code starts off with a dozen wildcard imports.  If I want to 
> try to use these techniques in Clojure, I have absolutely no idea which 
> specific classes to require.  This creates a tremendous obstacle to 
> consuming Java libraries.  This has affected me personally on several 
> occasions, preventing me from successfully figuring out how to use some 
> Java library from Clojure.
>
> Maybe it's not ideal if Clojure has to walk the classpath, but the 
> alternative is that I have to manually walk the classpath and jars myself 
> with no idea what I'm looking for.  Surely it's better for this to be 
> handled through an automated process.
>  

-- 
-- 
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: map from list of maps

2013-07-25 Thread Curtis Gagliardi
You can use whatever functions you want with juxt:

user=> (into {}  (map (juxt #(% "a") #(% "b")) [{"a" "blah" "b" "ack"} {"a" 
"red" "b" "blue"}]))
{"blah" "ack", "red" "blue"}


On Thursday, July 25, 2013 2:55:18 PM UTC-7, Brian Craft wrote:
>
> Ah, interesting. Only works for keys that are functions.
>
> On Thursday, July 25, 2013 2:48:10 PM UTC-7, Gary Trakhman wrote:
>>
>> user> (into {}  (map (juxt :a :b) [{:a "blah" :b "ack"} {:a "red" :b 
>> "blue"}]))
>> {"blah" "ack", "red" "blue"}
>>
>>
>>
>> On Thu, Jul 25, 2013 at 5:34 PM, Brian Craft  wrote:
>>
>>> Is there a better way to do this, making a map of certain keys from a 
>>> list of maps?
>>>
>>> > (apply hash-map (mapcat (fn [x] [(x :a) (x :b)]) [{:a "blah" :b "ack"} 
>>> {:a "red" :b "blue"}]))
>>> {"red" "blue", "blah" "ack"}
>>>
>>> -- 
>>> -- 
>>> 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: In what OS do you code?

2013-06-17 Thread Curtis Gagliardi
Linux Mint everywhere, but any distro is fine as long as I can run a tiling 
window manager (i3) and vim on it.

People complaining about the hassle really should give Ubuntu/Mint or one 
of the other really user focused distros a try if they haven't recently, 
it's really not very difficult anymore.

On Friday, June 14, 2013 6:46:37 AM UTC-7, Erlis Vidal wrote:
>
> Hi, 
>
> I'm a bit curious to know in what OS do you code. Do you prefer iOS, 
> Linux, Windows? Why is that? Because the tools? The environment? 
>
> 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 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] lein-pedantic is now deprecated

2013-05-31 Thread Curtis Gagliardi
Another +1 for those features.

On Wednesday, May 29, 2013 6:25:22 PM UTC-7, Nelson Morris wrote:
>
> Good news everybody! As of leiningen 2.2.0 using `lein deps :tree` will 
> perform version checks and version range detection. Therefore, I have 
> deprecated lein-pedantic.  I appreciate all of the users of the plugin that 
> found it useful.
>
> I believe there are two pieces of functionality that do not currently have 
> a replacement:
> 1) ability to fail the task when a "bad" dependency resolution happens
> 2) exact instructions of what to place in project.clj to make things work
>
> If you are interested in these, please let me know here, and I'll see 
> about adding them in a future leiningen release.
>
> -
> Nelson Morris
>

-- 
-- 
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: Why is this code so slow?

2013-02-03 Thread Curtis Gagliardi
Was on clojure 1.4, just tried on 1.5.0-RC4 and its a few hundred 
miliseconds faster in its own 
function.  

4921.78197 msecs vs  5251.267893 msecs

On Sunday, February 3, 2013 11:52:11 AM UTC-6, Curtis Gagliardi wrote:
>
> >>For some reason, by splitting out the inner loop into a function 
> >>shaved 6 more seconds (from 34s to 28s) on my low-config 32-bit 
> >>laptop: 
>
> Pulling every-d? out into it's own function slowed things down a few 
> seconds for me.  Strange stuff.

-- 
-- 
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: Why is this code so slow?

2013-02-03 Thread Curtis Gagliardi
>>For some reason, by splitting out the inner loop into a function 
>>shaved 6 more seconds (from 34s to 28s) on my low-config 32-bit 
>>laptop: 

Pulling every-d? out into it's own function slowed things down a few 
seconds for me.  Strange stuff.

-- 
-- 
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: Why is this code so slow?

2013-02-02 Thread Curtis Gagliardi
I took your version Feng and used rem instead of mod and added a type hint 
and got down from:
23217.321626 => 11398.389942

No idea where to go from here though.  I'm surprised there's such a 
difference even not using any sort of collection.

(defn smallest-multiple-of-1-to-n-hinted-rem
  [^long n]
  (loop [i n]
(if (loop [d 2]
  (cond (> d n) true
(not= 0 (rem i d)) false
:else (recur (inc d
  i
  (recur (inc i

-- 
-- 
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: Migrate from IDEs to emacs or vim (already experienced with it) ?

2013-02-02 Thread Curtis Gagliardi
I've been using vim pretty exclusively for the last 5 years or so, but in 
the last few weeks I've been using emacs with evil mode and I couldn't be 
happier.  It's a beautiful thing to have emacs extreme extensibility with 
vim's vastly superior keybindings.  I have my config here if you're 
interested https://github.com/cgag/dotfiles/blob/master/.emacs

Still, if you don't want to deal with emacs, vim is definitely viable. 
 Vimclojure is a pain to get set up, but once you do it's solid.  Foreplay 
is definitely worth checking out, but I couldn't stand not having a real 
repl buffer personally.

-- 
-- 
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: screencast: friend and creating a login form

2013-01-30 Thread Curtis Gagliardi
Definitely agree that it'd have helped when I was first starting to use 
friend.  I spent a lot of time reading his source.  If you plan on doing 
more about friend it'd definitely be good to show how to authorize a 
specific user rather than just at the role level, as well as something 
about how to redirect after logging in use ::redirect-on-auth?.  Both those 
things took me a while to figure out.

Keep it up, I'm look forward to seeing more of them.

On Tuesday, January 29, 2013 2:55:13 PM UTC-6, Nelson Morris wrote:
>
> I've released a screencast on friend and using its interactive-form 
> workflow to create a login form. 
> http://www.clojurewebdevelopment.com/videos/friend-interactive-form 
>
> I've got more in various stages of completion, so I'd be interested in 
> hearing feedback. 
>
> Thanks, 
> Nelson Morris 
>

-- 
-- 
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: Blog Post: "The Magic of Macros: Lighting-Fast Templating in ClojureScript"

2013-01-26 Thread Curtis Gagliardi
Great use of macros, and I found Chris Granger's protocol commit 
enlightening as well, thanks.

On Tuesday, January 22, 2013 12:45:34 PM UTC-6, Aria Haghighi wrote:
>
> Hi all,
>
>   I've done a follow-up post on the Prismatic blog about our dommy, our 
> ClojureScript templating library. We added some macros to parse nested 
> vector data structures at compile time
> into direct DOM creation code. The resulting speedup is pretty dramatic 
> about 5x, bring ClojureScript templating to roughly 3x faster than a jQuery 
> baseline. This is a trick I know Hiccup and some other libraries do but I 
> thought it might be worth document/explaining this kind of application of 
> macros. 
>
>
> http://blog.getprismatic.com/blog/2013/1/22/the-magic-of-macros-lighting-fast-templating-in-clojurescript
>
> Thanks, Aria
>

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




Re: Clojure Recursion (loop-recur) Questions

2012-11-27 Thread Curtis
Thank you Andy - This was fabulously helpful - I really appreciate 
your explanation.

Would you permit me to include your answer in a blog post about the above 
question?



On Monday, November 19, 2012 6:25:30 PM UTC-8, Andy Fingerhut wrote:
>
> If you are familiar with tail recursion, then loop/recur this is Clojure's 
> way to achieve tail recursion.
>
> http://en.wikipedia.org/wiki/Tail_call
>
> The general tail call optimization mechanism as implemented in the 
> programming language Scheme, for example, means that tail-position calls 
> must not consume additional stack, and must effectively work like a goto 
> appropriate muddling of stack frames to pass the parameters to the new 
> function (which might be a recursive call, or could be to a different 
> function).  Whether the tail call is recursive or not, the return address 
> of the original calling function doesn't change after the goto.
>
> Clojure's loop/recur only implements tail recursion, not general tail-call 
> optimization.  tail recursion is far more commonly used in languages that 
> have it than the general tail-call optimization to arbitrary functions.
>
>
> Specifically on your questions about the return address, suppose function 
> foo calls function bar, and bar has the loop/recur inside of it.  At the 
> time when foo first calls bar, it saves a return address inside of foo so 
> that when bar returns, it continues in foo just after where the call to bar 
> was.
>
> loop/recur never touches that return address.   It stays there the whole 
> time.
>
> The loop is effectively a target label for a goto, and one or more 
> occurrences of recur inside of it simply rebind the loop variable values, 
> and goot the loop's target label.  Anything deeper down on the stack is not 
> changed, and there is no pushing or popping of any return addresses.  Just 
> a goto.
>
>
> Rich would have liked to implement general tail recursion in Clojure. 
>  Here are a couple of relevant excerpts from Rich Hickey's "Clojure for 
> Lispers" talk, transcript here:
>
>
> http://jafingerhut.github.com/clojure-info/clojure-for-lispers-transcript.txt
>
> Clojure does not have tail call optimization.  Not because I'm against
> it.  I'm all for it.  It's something I had to trade off in being on
> the JVM.  However, I was just at the JVM languages summit, and tail
> call optimization, every language designer who cam up there said "tail
> call optimization, tail call optimization".  And they've heard it, and
> hopefully it will come in a future VM, hopefully soon.
>
> You've seen
> languages... SISC Scheme does tail calls in the JVM, right.  It does
> it with this whole other infrastructure.  They're calling scheme is
> nothing like Java's, right?  You have to pass additional things, or
> trampoline, or whatever.  Clojure does none of that.  Clojure has
> pedal to the metal calling conventions that match Java's, so I don't
> have tail recursion, because you can't do that unless the JVM does
> that.
>
> Andy
>
>
>
> On Nov 19, 2012, at 4:38 PM, Curtis wrote:
>
> Clojure Koans - Recursion
>
> (defn recursive-reverse [coll]
>   (loop [coll coll
>  acc '() ]
>  (if (= (count coll) 0)
> acc
>(recur (rest coll) (cons (first coll) acc))
>  )
>   )
> )
>
> I struggled with this one for a while - I don’t want to admit it, but 
> honestly even though i have been coding since I was 16 years old - there 
> are still many areas where I am rusty or weak.
>
> There is actually a surprising amount of low level concepts operating in a 
> list recursive reverse in clojure.
>
>- tail-call recursion
>- accumulator
>- loop construct
>
> I have some questions about how this “special form”  
> loop<http://clojure.org/special_forms#Special%20Forms--(loop%20%5Bbindings*%20%5D%20exprs*)>
>  operates 
> with recur<http://clojure.org/special_forms#Special%20Forms--(recur%20exprs*)>
>
> I think I need to make sure that I always remember the following :
>
>- the arity of the recur call must match the arity of the loop form
>- recur must be in the tail position.
>
> I’m not sure how this loop / recur mechanism is implemented in the JVM - I 
> imaging that the binding created by ‘loop’ is associated with registers 
> that are overwritten as part of the call to ‘recur’. The documentation says 
> the bindings are rebound on call of recur in parallel and the execution of 
> recur - is done in order.
>
> My questions are
>
>- Is recur causing some kind of local jump after each binding?
>- What happens with the r

Re: Current status of Clojure on Android?

2012-11-27 Thread Curtis Gagliardi
How do you use clojurescript on android?  SL4A?  How does it compare to a 
native app?  I'm looking to try to write an android app but want to avoid 
java, but it sounds like clojure isn't really ready for production on 
android.

On Monday, November 26, 2012 8:14:07 PM UTC-6, Herwig Hochleitner wrote:
>
> 2012/11/26 John Gabriele >
>
>> What are currently the main limitations in creating and running
>> Clojure programs on Android? (Does some limited subset of Clojure
>> work? Does the bytecode that Clojure produces run on Dalvik?)
>>
>
> Clojure on Android is alive and well as far as I'm aware. I'm not 
> currently using it, but last time I checked, even eval, hence the REPL 
> worked. 
> Mr. Solano Gómez pulled that off by dexing the dex utility for use on 
> android.
>
> The main drawback is startup time, which is a couple of seconds on my 
> Galaxy Nexus.
>
> Therefore, and because of portability, I write my current android project 
> in ClojureScript.
>  
>
>> Is it currently possible to write your Android app in Java but then
>> call out to app code written in Clojure?
>>
>
> Same as with Clojure on the JVM. Google's work to making Dalvik compliant 
> really pays off. 
>
> Also: https://groups.google.com/forum/?fromgroups#!forum/clojure-android
>  

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

Clojure Recursion (loop-recur) Questions

2012-11-19 Thread Curtis
Clojure Koans - Recursion

(defn recursive-reverse [coll]
  (loop [coll coll
 acc '() ]
 (if (= (count coll) 0)
acc
   (recur (rest coll) (cons (first coll) acc))
 )
  )
)

I struggled with this one for a while - I don’t want to admit it, but 
honestly even though i have been coding since I was 16 years old - there 
are still many areas where I am rusty or weak.

There is actually a surprising amount of low level concepts operating in a 
list recursive reverse in clojure.

   - tail-call recursion
   - accumulator
   - loop construct

I have some questions about how this “special form”  
loop
 operates 
with recur

I think I need to make sure that I always remember the following :

   - the arity of the recur call must match the arity of the loop form
   - recur must be in the tail position.

I’m not sure how this loop / recur mechanism is implemented in the JVM - I 
imaging that the binding created by ‘loop’ is associated with registers 
that are overwritten as part of the call to ‘recur’. The documentation says 
the bindings are rebound on call of recur in parallel and the execution of 
recur - is done in order.

My questions are

   - Is recur causing some kind of local jump after each binding?
   - What happens with the return address? 
   - If recur doesn’t consume stack - what is going on with the return 
   address? 
   - Is the return address always the same for the same recursive call?

More importantly - Is there a chapter in Knuth AOC that could help me with 
this? Any other resources?  

I feel like I am really missing some context. Am I missing anything 
obvious, important or insightful?

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

Re: Cdr car

2012-10-20 Thread Curtis
Thank you everyone !!

I really appreciate you assistance and am so glad to hear about the 
diversity of backgrounds.!


On Tuesday, October 16, 2012 3:40:24 PM UTC-7, Curtis wrote:
>
> Hello - I was familar with lisp years ago and am very new to clojure.
>
> I am having a hard time understanding how to find 'car' and 'cdr'.
>
> The nice thing about these functions is they always seem to be a part of 
> lisp.
>
> I would like to use the little lisper to teach lisp to my co-workers so 
> that we can adopt Clojure.
>
> How can i import cdr or car? 
>
> I know i can write these manually  or alias them to 'first' and 'rest' - 
> are they a part of the language?
>
> Cons appears to be around.
>
>
>
>

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

Re: Cdr car

2012-10-20 Thread Curtis
This is golden!

thank you so  much!


On Wednesday, October 17, 2012 12:10:15 PM UTC-7, Jeff Heon wrote:
>
> If I may suggest the following presentation:
>
> http://blip.tv/clojure/clojure-for-lisp-programmers-part-1-1319721
> http://blip.tv/clojure/clojure-for-lisp-programmers-part-2-1319826
>
> There used to a transcript available on the newsgroup until Google decided 
> to remove all files from newsgroup 8)
>
> On Wednesday, October 17, 2012 2:16:01 PM UTC-4, Curtis wrote:
>>
>> Cons seems to be strange
>>
>> How do i use Cons with an atom to make a list?
>>
>> (cons 1 1) 
>>
>  
>

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

Re: Cdr car

2012-10-17 Thread Curtis
Thank you so much!




On Tuesday, October 16, 2012 5:08:26 PM UTC-7, Baishampayan Ghose wrote:
>
> `car` is called `first` here and `cdr` could mean either `rest` or 
> `next` depending on what you mean/need. 
>
> And oh, `cons` is not exactly the same one from Common Lisp, etc. 
>
> Regards, 
> BG 
>
> On Tue, Oct 16, 2012 at 3:40 PM, Curtis  wrote: 
> > Hello - I was familar with lisp years ago and am very new to clojure. 
> > 
> > I am having a hard time understanding how to find 'car' and 'cdr'. 
> > 
> > The nice thing about these functions is they always seem to be a part of 
> > lisp. 
> > 
> > I would like to use the little lisper to teach lisp to my co-workers so 
> that 
> > we can adopt Clojure. 
> > 
> > How can i import cdr or car? 
> > 
> > I know i can write these manually  or alias them to 'first' and 'rest' - 
> are 
> > they a part of the language? 
> > 
> > Cons appears to be around. 
> > 
> > 
> > 
> > -- 
> > 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 
>
>
>
> -- 
> Baishampayan Ghose 
> b.ghose at gmail.com 
>

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

Re: Clojure turns 5

2012-10-17 Thread Curtis
HAPPY BIRTHDAY!!

thank you Rich for the  fyi!


On Tuesday, October 16, 2012 6:53:55 PM UTC-7, Rich Hickey wrote:
>
> I released Clojure 5 years ago today. It's been a terrific ride so far. 
>
> Thanks to everyone who contributes to making Clojure, and its community, 
> great. 
>
> 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

Re: Cdr car

2012-10-17 Thread Curtis


On Tuesday, October 16, 2012 5:40:54 PM UTC-7, kovasb wrote:
>
> A number of "classic" lisp books have been translated to clojure, for 
> instance 
>
> http://juliangamble.com/blog/2012/07/20/the-little-schemer-in-clojure/ 
>
>
Thank you for the link!


 

> Personally I felt relieved when I saw that clojure had abandoned the 
> anachronistic car/cdr stuff; the sequence abstraction is a lot nicer. 
>
> There are also a number of excellent clojure books you might want to 
> check out as well, which might appeal to the more practical minded 
> among the coworkers. 
>
>
>
> On Tue, Oct 16, 2012 at 6:40 PM, Curtis  wrote: 
> > Hello - I was familar with lisp years ago and am very new to clojure. 
> > 
> > I am having a hard time understanding how to find 'car' and 'cdr'. 
> > 
> > The nice thing about these functions is they always seem to be a part of 
> > lisp. 
> > 
> > I would like to use the little lisper to teach lisp to my co-workers so 
> that 
> > we can adopt Clojure. 
> > 
> > How can i import cdr or car? 
> > 
> > I know i can write these manually  or alias them to 'first' and 'rest' - 
> are 
> > they a part of the language? 
> > 
> > Cons appears to be around. 
> > 
> > 
> > 
> > -- 
> > 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 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

Re: Cdr car

2012-10-17 Thread Curtis


On Tuesday, October 16, 2012 5:09:02 PM UTC-7, Andy Fingerhut wrote:
>
> Curtis: 
>
> You can do this if you want: 
>
> (def car first) 
> (def cdr rest) 
>
> but most people accustomed to Clojure would be much more familiar with 
> first and rest.  The Content of the Address and Data Registers haven't been 
> applicable for a long time, but it wasn't only the names that are changed 
> -- first and rest work on all kinds of data structures besides lists, and 
> return implementations of a sequence abstraction, not necessarily pointers 
> to cons cells. 
>
>

thank you - I expect some changes - but am coming from ruby where the 
'principle of least surprise'  has been kind to me.

 

> Andy 
>
> On Oct 16, 2012, at 3:40 PM, Curtis wrote: 
>
> > Hello - I was familar with lisp years ago and am very new to clojure. 
> > 
> > I am having a hard time understanding how to find 'car' and 'cdr'. 
> > 
> > The nice thing about these functions is they always seem to be a part of 
> lisp. 
> > 
> > I would like to use the little lisper to teach lisp to my co-workers so 
> that we can adopt Clojure. 
> > 
> > How can i import cdr or car? 
> > 
> > I know i can write these manually  or alias them to 'first' and 'rest' - 
> are they a part of the language? 
> > 
> > Cons appears to be around. 
>

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

Coming from Common Lisp to Clojure

2012-10-17 Thread Curtis
I do hope this is an appropriate topic. 

I am very excited by the power and capability in clojure and amazed at the 
rapid quality of tooling that exists so early in the projects life.

I would like to admit that i am feeling like the simplicity and elegance 
that I experienced writing in lisp seems to be bypassed in certain areas in 
favor of extra syntax [] and what seems to be local variable declarations
as well as 'many ways' to do something around looping and recursion.

I am wondering how others feel about this and if there are any style guides 
that i could be exposed to so that I can enjoy the poetry that I may be 
missing. 

Could some one help me with this please?

Thank you!

Curtis

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

Re: Cdr car

2012-10-17 Thread Curtis
Cons seems to be strange

How do i use Cons with an atom to make a list?

(cons 1 1) 


On Tuesday, October 16, 2012 5:08:26 PM UTC-7, Baishampayan Ghose wrote:
>
> `car` is called `first` here and `cdr` could mean either `rest` or 
> `next` depending on what you mean/need. 
>
> And oh, `cons` is not exactly the same one from Common Lisp, etc. 
>
> Regards, 
> BG 
>
> On Tue, Oct 16, 2012 at 3:40 PM, Curtis  wrote: 
> > Hello - I was familar with lisp years ago and am very new to clojure. 
> > 
> > I am having a hard time understanding how to find 'car' and 'cdr'. 
> > 
> > The nice thing about these functions is they always seem to be a part of 
> > lisp. 
> > 
> > I would like to use the little lisper to teach lisp to my co-workers so 
> that 
> > we can adopt Clojure. 
> > 
> > How can i import cdr or car? 
> > 
> > I know i can write these manually  or alias them to 'first' and 'rest' - 
> are 
> > they a part of the language? 
> > 
> > Cons appears to be around. 
> > 
> > 
> > 
> > -- 
> > 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 
>
>
>
> -- 
> Baishampayan Ghose 
> b.ghose at gmail.com 
>

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

Cdr car

2012-10-16 Thread Curtis
Hello - I was familar with lisp years ago and am very new to clojure.

I am having a hard time understanding how to find 'car' and 'cdr'.

The nice thing about these functions is they always seem to be a part of 
lisp.

I would like to use the little lisper to teach lisp to my co-workers so 
that we can adopt Clojure.

How can i import cdr or car? 

I know i can write these manually  or alias them to 'first' and 'rest' - 
are they a part of the language?

Cons appears to be around.



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

Re: Just wanted to say how much I like ClojurePY

2012-08-16 Thread Curtis Gagliardi
I haven't really investigated clojurescript yet, but I was planning on 
looking at it for small scripts where the startup time of the jvm is a 
problem.  Do you feel that clojurepy fills this need better than 
clojurescript for any reasons other than speed?  Or is it libraries like 
numpy that make it more suitable for crunching numbers than javascript?

On Thursday, August 16, 2012 8:00:50 AM UTC-5, Sean Neilan wrote:
>
> Hey All,
>
> ClojurePY is actually quite amazing. It has none of the complexities with 
> libraries and projects like Clojure and is suitable for crunching data 
> (because it's on Python) unlike Node.js/Clojurescript. You can use all the 
> python libraries. You can even import ipdb and step through your code 
> without any modifications to the ClojurePY source tree. Even the REPL is 
> better by default.
>
> Just try 
> sudo easy_install clojure-py
>
> Then, type clojurepy at your shell to run it!
>
> Then, put this crappy script into emailScraper.clj to automagically 
> listen to IMAP emails from Gmail:
> Be sure to download imapidle.py from 
> https://raw.github.com/athoune/imapidle/master/src/imapidle.py and place 
> it in the same directory as emailScraper.clj
> Then do $ clojurepy emailScraper.clj. No leiningen! No compilation! Just 
> run it!
>
> (ns emailScraper)
> ; adding current directory to path
> (require 'os)
> (require 'sys)
> (require 'time)
>
> ;(.chdir os "/Users/seanneilan/BucketsOfNantucket")
>
> (.append sys/path (.abspath os/path (.-curdir os/path)))
>
> ; using imapidle in clojurepy
> ;https://raw.github.com/athoune/imapidle/master/src/imapidle.py
>
>
> (require 'imapidle)
> (def m (.IMAP4_SSL (.-imaplib imapidle) "imap.gmail.com"))
> (def fetcher (.IMAP4_SSL (.-imaplib imapidle) "imap.gmail.com"))
> (require 'getpass)
> (require 'pyzmail)
> ;(require 'ipdb)
>
> (def pass "Your password here!")
>
> (.login m "your gmail here" pass) ; type in your password here
> (.login fetcher "your gmail here" pass)
> (.select m)
>
>
> (defn process-message [message]
>   ;(println message)
>   (.select fetcher)
>   (let [raw-msg (.fetch fetcher (int (first message)) "(BODY.PEEK[])")
> msg (.message_from_string pyzmail (-> raw-msg
> second
> first
> second))
> from (.get_address msg "from")
> to (.get_addresses msg "to")
> cc (.get_addresses msg "cc")
> bcc (.get_addresses msg "bcc")
> subject (.get_subject msg)
> attachments (filter
>  #(nil? (.-is_body msg))
>  (.-mailparts msg))
> text_body (filter
>#(= (.-is_body %) "text/plain")
>(.-mailparts msg))
> html_body (filter
>#(= (.-is_body %) "text/html")
>(.-mailparts msg))
> body (if (empty? html_body) (first text_body) (first html_body))
> body (.get_payload body)]
> (println body)))
>
>
> (dorun (map process-message (.idle m)))
>
> (comment
> (loop [messages (.idle m)]
>   (println (first messages))
>   (recur (rest messages
>
>
> I'm surprised ClojurePY hasn't received more attention.
>
>

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

Re: Is still idiomatic the ant simulation code?

2012-06-11 Thread Curtis Gagliardi
Here's the video: http://blip.tv/clojure/clojure-concurrency-819147
and you can get the code here (ants.clj):
http://www.lisptoronto.org/past-meetings/2009-05-clojure-ants-demo
or here if you don't want to download it: https://www.refheap.com/paste/3096

On Jun 10, 8:00 am, Alexey Kachayev  wrote:
> Guys, can you please share link where I can find the "ants demo" code?
>
> --
> Alexey Kachayev,
> CTO at KitApp, Inc.
>
>
>
>
>
>
>
> On Friday, June 8, 2012 at 4:44 PM, Stuart Sierra wrote:
> > The ants demo is definitely dated. It's not terrible, but the code could 
> > use some polishing/simplifying using newer additions to the language.
> > -S
>
> > --
> > 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 
> > (mailto: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 
> > (mailto: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


Re: Lambda: A lniux distro for clojurists

2012-05-25 Thread Curtis Gagliardi
I'll have to check this out when I get home, it sounds like exactly
what I was looking for.  Thanks.

On May 25, 11:01 am, Tom Maynard  wrote:
> On Thursday, May 24, 2012 3:11:21 PM UTC-5, banseljaj wrote:
> > Looking forward to all input.
>
> I suggest bundling Dave Ray's "VimClojure-Easy"
> (http://blog.darevay.com/2011/10/vimclojure-easy/).  It's a fully
> functional, bare-bones Vim + VimClojure, REPL-in-editor setup that's
> completely painless.  Further, the supplied .vimrc is stripped to only the
> entries needed to make it work ... you can merge it with your own, or
> customize it to suit.
>
> I used it myself to get up & running, and then just merged in my own,
> highly customized .vimrc along with my own pathogen-infected .vim directory.
>
> Another suggestion might be to have some kind of Internet file-sharing
> (Dropbox, Ubuntu One, ...) so that users can migrate files from their
> "home" systems to this new one (whether virtualized or in a bootable
> partition).
>
> Otherwise, it looks interesting and I wish you the best with it.  It won't
> convert me, but I expect there is a large target audience for it.
>
> Tom.
>
> regards.
>
>
>
>
>
>
>
>
>
> > banseljaj

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


Re: Practical Clojure

2012-04-13 Thread Curtis Gagliardi
I hadn't heard of practical clojure, but while we're praising books,
I'd like to say that Clojure Programming is excellent.  I've been
reading the early access version, and while I haven't finished it, I'm
almost done with the first half, which covers the core of the
language.  It's been incredibly helpful so far and I'm really looking
forward to the practical stuff that makes up second half of the
book.

On Apr 13, 8:51 am, David Cabana  wrote:
> I have not read it all (yet), but what I have read is outstanding.
> O'Reilly has made the table of contents and first chapter available
> online. If you are at all curious, check it out.  The first chapter
> contains an exceptionally lucid and thorough section on destructuring.
>
> http://cdn.oreilly.com/oreilly/booksamplers/9781449394707_sampler.pdf

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


Re: I'm writing a Tempest clone in ClojureScript

2012-04-09 Thread Curtis Gagliardi
This is some cool stuff, I'll have to poke through the code later.
I've never played tempest, so I don't know what's supposed to happen,
but it was interesting to just move towards the focal point and let
the flippers pile up around the edges.

On Mar 22, 7:14 pm, Trevor Bentley  wrote:
> I'm teaching myself Clojure/ClojureScript/HTML5 via an excessively complex
> first project: a clone of the arcade game Tempest.  I thought it might be a
> handy resource to share since I've found surprisingly few ClojureScript
> examples.  More certainly couldn't hurt.
>
> https://github.com/mrmekon/tempest-cljs
>
> The game is nowhere close to done, but there's some functional drawing and
> movement code.  Collision detection is about the only thing left before it
> qualifies as a "game", albeit a terrible, unfinished one.  It isn't
> currently hosted anywhere, so you'll have to run it yourself, or make do
> with the screenshots.  I have 6 levels, one kind of enemy, and the player
> ship moves and shoots.  Level design is the most interesting part -- I
> wrote some level-generating code, so certain types of levels can be
> generated very easily.
>
> ClojureScript has been surprisingly solid and easy to work with.  I was
> considering using it for a startup I'm working with, and this project has
> done nothing to dissuade me.
>
> -Trevor

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