Re: [ANN] Discontinuing 4clojure.com

2021-07-05 Thread Tim Visher
On Sun, Jul 4, 2021 at 4:26 PM Alan Malloy  wrote:

> TL;DR: Turning off 4clojure.com by the end of July 2021
>
> Hello, 4clojure problem solvers. You've probably noticed SSL errors on
> 4clojure.com over the last week. The old decrepit system 4clojure runs on
> has finally gotten out of date enough that I can't even figure out how to
> get it recent enough that SSL certs will auto-renew anymore.
>
> In principle I could start from scratch on a new server and move 4clojure
> over, but I won't. 4clojure has been piggybacking along on a server that I
> use for personal reasons, and over the years I have less and less reason to
> keep paying for that server - it's now pretty much just 4clojure costing me
> an embarrassing amount of money every month because I haven't wanted to
> disappoint the community by shutting it down. This SSL thing is just what
> made me finally pull the trigger.
>
> I don't have a specific EOL date in mind, but sometime near the end of the
> month, since that's the billing cycle. Until that time, 4clojure still
> works, as long as you don't mind clicking through the security warnings -
> it really is still me hosting the site, and since the connection is still
> HTTPS (albeit with an invalid cert) I think that means your data is still
> safe. If you have solutions to problems you're proud of, you've still got
> some time to print them out and put them up on your refrigerator.
>
> I'm not seeking new maintainers. I'd feel uncomfortable handing over a
> database with so many email addresses and password hashes in it to anyone.
> The service has had a good run - just over a decade since the first
> release
> .
> I hope you enjoyed it during that time.
>

Thank you for your work maintaining it for so long, Alan! IIUC it's open
source  so if someone else feels
passionately about it being available they can always start it up again.

No hard feelings. We all have to make difficult calls about our time and
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
--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/CAHa53uxFfeRJEe5fSQ2ewra2c3tQaBag7xPP3SaBkbuNmKj7eg%40mail.gmail.com.


Clojure interop with Spark

2020-07-09 Thread Tim Clemons
I'm putting together a big data system centered around using Spark 
Streaming for data ingest and Spark SQL for querying the stored data.  I've 
been investigating what options there are for implementing Spark 
applications using Clojure.  It's been close to a decade since sparkling or 
flambo have received any updates and it doesn't look like either will 
accommodate recent distributions of Spark.  I've found powderkeg an 
interesting option, and I like how it supports remote REPLs and the use of 
tranducers rather than wrapped Scala fns.  However, it looks like it's also 
seen a few years without commits and I've heard loose talk that the 
developers have moved on to other pursuits.

Part of the problem seems to be Spark.  The project seem unapologetic about 
breaking interfaces and seems willing to sacrifice third-party code that 
tries to track Spark's development.

So my options seem to be the following:

1. Deploy an older version of Spark that's compatible with one of the above 
mentioned libraries.  While we don't need to be bleeding edge, deploying a 
three year old version just to accommodate my preferred language is hard to 
justify.

2. Create a merge to update one of those libraries to more recent versions 
of Spark and be prepared to maintain it internally for the lifespan of this 
project.  This may be vastly overestimating my personal heroics.

3. Code my own solution from scratch using Java/Scala interop, sketching 
out just enough of a Clojure wrapper to suit my ends.

4. Learn Scala.

I realize that Spark isn't the only game in town (Onyx, for example).  
However, I'm working with a team of developers who are not familiar with 
Clojure (though I'm working to be an advocate). I choose Spark as an 
established solution that supports multiple languages and handles both 
streaming and batch processing.

Any insights?  Any solutions I'm overlooking?



-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/259f5ff6-dd66-4688-aa80-439fed88ab39o%40googlegroups.com.


Re: ANN: ClojureScript 1.10.741

2020-04-25 Thread Tim Visher
On Fri, Apr 24, 2020 at 9:04 PM Ag Ibragimov 
wrote:

> Some people have no idea how awesome it is to see David Nolen working on
> Clojurescript again. That is so cool!
>



-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/CAHa53uwkyEOrwvYx%2BJfDRdDvRy4ex7g3hVgD-qCERLkxz93BMQ%40mail.gmail.com.


Re: [ANN] Cognitect Labs' aws-api 0.8.430

2020-02-18 Thread Tim Visher
Sorry what I meant was _where_ is it. I've never heard of it, there's
obviously several open source Clojure ecosystem http clients (and obviously
several more standard Java clients) and I can't find a repo anywhere.

On Fri, Feb 14, 2020 at 2:12 PM David Chelimsky 
wrote:

> That should be com.cognitect/http-client (
> https://search.maven.org/search?q=g:com.cognitect%20AND%20a:http-client)
>
> It is a dependency of aws-api, which it uses to submit http requests.
>
> On Wednesday, February 12, 2020 at 6:52:31 AM UTC-6, Tim Visher wrote:
>>
>> What's cognitect.http-client?
>>
>> On Tue, Feb 11, 2020 at 10:09 AM David Chelimsky 
>> wrote:
>>
>>> Cognitect Labs' aws-api 0.8.430 is now available!
>>>
>>> NOTE: we changed the behavior of cognitect.aws.client.api/client in
>>> order to support automatic resource management. Although this should be
>>> a drop-in upgrade for most of you, anything you've been doing to manually
>>> manage resources is probably unnecessary now. Please see Upgrade Notes
>>> <https://github.com/cognitect-labs/aws-api/blob/master/UPGRADE.md> for
>>> more information about upgrading to this version, and feel free to reach
>>> out here, on Clojurians' Slack (in the #aws channel), or in github
>>> issues <https://github.com/cognitect-labs/aws-api/issues> if you have
>>> any questions or concerns.
>>>
>>> CHANGES
>>>
>>>- upgrade to cognitect.http-client 0.1.104 #115
>>><https://github.com/cognitect-labs/aws-api/issues/115>
>>>- all aws clients use shared http-client, credentials-provider, and
>>>region-provider by default
>>>   - addresses #109
>>>   <https://github.com/cognitect-labs/aws-api/issues/109>
>>>   - first call to invoke takes hit of fetching region and
>>>   credentials
>>>- com.cognitect.aws.api/stop will not stop the shared http-client,
>>>   but will continue to stop any other instance
>>>
>>>
>>> README: https://github.com/cognitect-labs/aws-api/
>>> API Docs: https://cognitect-labs.github.io/aws-api/
>>> Changelog:
>>> https://github.com/cognitect-labs/aws-api/blob/master/CHANGES.md
>>> Upgrade Notes:
>>> https://github.com/cognitect-labs/aws-api/blob/master/UPGRADE.md
>>> Latest Releases of api, endpoints, and all services:
>>> https://github.com/cognitect-labs/aws-api/blob/master/latest-releases.edn
>>>
>>> --
>>> 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
>>> clo...@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 clo...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/clojure/749f31a3-7c18-42e9-a98d-082d897117fa%40googlegroups.com
>>> <https://groups.google.com/d/msgid/clojure/749f31a3-7c18-42e9-a98d-082d897117fa%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/clojure/db02021d-5403-4d0c-968f-4f26af12551d%40googlegroups.com
> <https://groups.google.com/d/msgid/clojure/db02021d-5403-4d0c-968f-4f26af12551d%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google
Groups "

Re: [ANN] Cognitect Labs' aws-api 0.8.430

2020-02-12 Thread Tim Visher
What's cognitect.http-client?

On Tue, Feb 11, 2020 at 10:09 AM David Chelimsky 
wrote:

> Cognitect Labs' aws-api 0.8.430 is now available!
>
> NOTE: we changed the behavior of cognitect.aws.client.api/client in order
> to support automatic resource management. Although this should be a
> drop-in upgrade for most of you, anything you've been doing to manually
> manage resources is probably unnecessary now. Please see Upgrade Notes
>  for
> more information about upgrading to this version, and feel free to reach
> out here, on Clojurians' Slack (in the #aws channel), or in github issues
>  if you have any
> questions or concerns.
>
> CHANGES
>
>- upgrade to cognitect.http-client 0.1.104 #115
>
>- all aws clients use shared http-client, credentials-provider, and
>region-provider by default
>   - addresses #109
>   
>   - first call to invoke takes hit of fetching region and credentials
>- com.cognitect.aws.api/stop will not stop the shared http-client, but
>   will continue to stop any other instance
>
>
> README: https://github.com/cognitect-labs/aws-api/
> API Docs: https://cognitect-labs.github.io/aws-api/
> Changelog:
> https://github.com/cognitect-labs/aws-api/blob/master/CHANGES.md
> Upgrade Notes:
> https://github.com/cognitect-labs/aws-api/blob/master/UPGRADE.md
> Latest Releases of api, endpoints, and all services:
> https://github.com/cognitect-labs/aws-api/blob/master/latest-releases.edn
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/clojure/749f31a3-7c18-42e9-a98d-082d897117fa%40googlegroups.com
> 
> .
>

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


Re: Two new transcripts available of talks by Rich Hickey

2019-12-02 Thread Tim Visher
Thanks for doing this, Andy!

On Mon, Dec 2, 2019 at 1:29 AM Andy Fingerhut 
wrote:

> Transcripts of two of Rich Hickey's oldest (and longest) talks are now
> published and available, included in a collection of many other talk
> transcripts. The newest transcripts are:
>
> (1) "Clojure Concurrency" from March 2008, where he introduced the fairly
> well known "ant colony" simulation program to demonstrate refs,
> transactions, and agents, here:
> https://github.com/matthiasn/talk-transcripts/blob/master/Hickey_Rich/ClojureConcurrency.md
> 
>
> (2) "Clojure for Java Programmers" from June 2008, here:
> https://github.com/matthiasn/talk-transcripts/blob/master/Hickey_Rich/ClojureForJavaProgrammers.md
> 
>
> That Github repository contains many other talk transcripts.
>
>
> If you are interested in helping create transcripts of other talks that do
> not have one yet, I am happy to help edit/polish them if someone wants to
> volunteer creating a first draft of all or even part of another talk. Offer
> your time and coordinate efforts on any of the open Github issues for
> not-yet-transcribed talks in that same Github repo.
>
> Regards,
> Andy Fingerhut
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/clojure/CAKvLtDb%3Dq%3DvamtBX%2BS4vMk_F2VyF-UcOZ41knk9ZSbPy2fdp2w%40mail.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
--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/CAHa53uxGsHsWK0RFdyHU0cW7PqzTnhmDpWnL03rmk2o8%2BeN8Ug%40mail.gmail.com.


Re: Inside Clojure Journal

2019-02-22 Thread Tim Visher
On Wed, Jan 30, 2019 at 12:03 AM Shaun Parker 
wrote:

> I just wanted to say thanks to Alex for taking the time to journal all the
> Clojure things he's working on (and the non-Clojure things as well).
> They're enjoyable to read and eye-opening. It's a great window into the
> effort that he and others are putting into Clojure. It's been fun to follow
> the spec-alpha2 commits and get to read the thoughts/direction in the
> journal. Great work Alex!
>
> You can find them on the Inside Clojure blog: http://insideclojure.org/
>

Oooo this is awesome. I hadn't seen it before. Alex is pretty great. :)

-- 
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] CIDER 0.19

2019-01-02 Thread Tim Visher
Thanks to you, Bozho ( ;) ) , and all
the other contributors for your consistent hard work on CIDER! :)

It's made my life and the life of my team so much better.

On Tue, Jan 1, 2019 at 10:39 AM Bozhidar Batsov  wrote:

> Btw, I also wrote a short blog post on the new release
> https://metaredux.com/posts/2019/01/01/happy-new-cider.html
>
> On Tue, 1 Jan 2019 at 12:24, Bozhidar Batsov  wrote:
>
>> Hey everyone!
>>
>> Happy New Year! Live long, live well, have fun and prosper!
>>
>> To help you start the New Year on the right foot and with the proper mood
>> I've just cut CIDER 0.19!
>>
>> The release notes are here
>> https://github.com/clojure-emacs/cider/releases/tag/v0.19.0
>>
>> The highlights are:
>>
>> * lots of improvements to the new connection management system
>> * some fixes for the changes to the error messages in Clojure 1.10
>>
>> That's going to be the final CIDER release that will work with the legacy
>> tools.nrepl, so if you're a boot or lein user you should definitely upgrade
>> to their latest versions which target the modern nREPL.
>>
>> Cheers!
>>
> --
> 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/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] deps.edn dependency viewer

2018-12-20 Thread Tim Visher
On Tue, Dec 18, 2018 at 12:46 PM Alex Miller  wrote:

> tda, tda.reader, tda.extensions
>

To make an unrelated, unhelpful, and off-topic comment I will now be
referring to `tools.deps.alpha` exclusively as 'Tada!'. :)

-- 
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: What do Clojure developers use for recurring functions, other than at-at

2018-12-17 Thread Tim Visher
On Mon, Dec 17, 2018 at 2:54 PM  wrote:

> But at-at has not been updated in 6 years, so I assume it is abandoned. I
> have two questions about this:
>

A common bit of wisdom here in the Clojure community is that time since
last update is not always (or even often) a sign of abandonment but instead
of stability. If there are many and recent open issues on at-at then maybe
it's been abandoned. Or it could just be stable.

Disclaimer, I don't know much about at-at.

-- 
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] com.vodori/chronology "0.1.0"

2018-09-13 Thread Tim Visher
Hi Paul,

On Thu, Sep 13, 2018 at 9:05 AM Paul Rutledge 
wrote:

> Chronology is a small library for working with cron expressions
>

Just FYI as I had to deal with this in depth a little while ago at work,
Quartz cron expressions are _not_ POSIX cron

compatible. Quartz, of course, is a standard on the JVM (at least?) but
it's helpful to talk about Quartz as 'cron-like' to disambiguate from POSIX
cron, vixie cron , etc.

The library overall looks very neat though. :)

--

In Christ,

Timmy V.

https://blog.twonegatives.com
https://five.sentenc.es

-- 
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: Complete Web Development Setup Using Clojure CLI Tools

2018-07-18 Thread Tim Goodwin
for additional inspiration, i suggest looking at 
https://github.com/juxt/edge

On Monday, 9 July 2018 17:14:22 UTC+1, Gary Johnson wrote:
>
> Howdy Clojurians,
>
> I recently started developing a new Clojure+Clojurescript web application, 
> and I wanted to see if I could set up my development environment using just 
> the Clojure CLI tools. After a good deal of digging around through 
> tutorials on a number of different websites and a fair amount of 
> experimenting, I've managed to create a very simple (IMHO) configuration 
> that provides me with both development and production mode CLJS->JS 
> compilation, development and production mode ring handlers, and the always 
> delightful FIgwheel development environment all from just the simple 
> "clojure" command. Since I haven't seen this before, I thought I'd share it 
> with all of you in case it helps someone else out there who doesn't need 
> (or want) all of leiningen or boot to develop a simple web app.
>
> Here goes:
>
> Step 1: Create your project structure like so:
>
> ├── cljsbuild.edn
> ├── deps.edn
> ├── figwheel.edn
> ├── resources
> │   └── public
> │   ├── cljs
> │   ├── css
> │   │ ├── style.css
> │   ├── images
> │   └── js
> ├── src
> │   ├── clj
> │   │   └── my_project
> │   │   ├── handler.clj
> │   │   ├── server.clj
> │   │   ├── views.clj
> │   └── cljs
> │   └── my_project
> │   ├── client.cljs
>
> Step 2: Make the deps.edn file (replace :deps and my-project.server 
> namespace as necessary for your project)
>
> {:paths ["src/clj" "resources"]
>
>  :deps {org.clojure/clojure   {:mvn/version "1.9.0"}
> org.clojure/clojurescript {:mvn/version "1.10.312"}
> ring  {:mvn/version "1.7.0-RC1"}
> ring/ring-defaults{:mvn/version "0.3.2"}
> prone {:mvn/version "1.6.0"}
> compojure {:mvn/version "1.6.1"}
> hiccup{:mvn/version "1.0.5"}
> reagent   {:mvn/version "0.8.1"}}
>
>  :aliases {:run{:main-opts ["-m" "my-project.server"]}
>:cljsbuild  {:extra-paths ["src/cljs"]
> :main-opts ["-m" "cljs.main" "-co" "cljsbuild.edn" 
> "-c"]}
>:figwheel   {:extra-deps {org.clojure/tools.nrepl {:mvn/version 
> "0.2.13"}
>  cider/cider-nrepl   {:mvn/version 
> "0.17.0"}
>  com.cemerick/piggieback {:mvn/version 
> "0.2.2"}
>  figwheel-sidecar{:mvn/version 
> "0.5.14"}}
> :main-opts ["-e" 
> "(use,'figwheel-sidecar.repl-api),(start-figwheel!)"]}}}
>
>
> Step 3: Make the cljsbuild.edn file (replace :main for your project)
>
> {:main  "my-project.client"
>  :output-dir"resources/public/cljs"
>  :output-to "resources/public/cljs/app.js"
>  :source-map"resources/public/cljs/app.js.map"
>  :optimizations :advanced
>  :pretty-print  false}
>
> Step 4: Make the figwheel.edn file (replace :ring-handler, :on-jsload, and 
> :main for your project)
>
> {:nrepl-port   7000
>  :nrepl-middleware ["cider.nrepl/cider-middleware"
> "cemerick.piggieback/wrap-cljs-repl"]
>  :server-port  3000
>  :ring-handler my-project.handler/development-app
>  :http-server-root "public"
>  :css-dirs ["resources/public/css"]
>  :builds [{:id   "dev"
>:source-paths ["src/cljs"]
>:figwheel {:on-jsload "my-project.client/mount-root"}
>:compiler {:main  "my-project.client"
>   :output-dir"resources/public/cljs/out"
>   :output-to "resources/public/cljs/app.js"
>   :asset-path"/cljs/out"
>   :source-maptrue
>   :optimizations :none
>   :pretty-print  true}}]}
>
>
> Step 5: Write server.clj
>
> (ns my-project.server
>   (:require [ring.adapter.jetty :refer [run-jetty]]
> [my-project.handler :refer [development-app production-app]])
>   (:gen-class))
>
> (defonce server (atom nil))
>
> (defn start-server! [& [port mode]]
>   (reset! server
>   (run-jetty
>(case mode
>  "dev"  #'development-app
>  "prod" #'production-app
>  #'production-app)
>{:port (if port (Integer/parseInt port) 3000)
> :join? false})))
>
> (defn stop-server! []
>   (when @server
> (.stop @server)
> (reset! server nil)))
>
> (def -main start-server!)
>
>
> Step 6: Write handler.clj
>
> (ns my-project.handler
>   (:require [ring.middleware.defaults :refer [wrap-defaults site-defaults
> ]]
> [ring.middleware.reload :refer [wrap-reload]]
> [prone.middleware :refer [wrap-exceptions]]
> [compojure.core :refer [defroutes GET]]

Re: Key must be integer error

2018-04-29 Thread Tim Visher
Hi Renata,

```
user=> (clojure.pprint/pprint (swap! accounts #(map (fn [a] (if (= (:id a)
"3136860d-ab7f-4814-8f3b-2d18048db9b9") (assoc a :operations :foo) a)) %)))
({:id "7512a15b-0770-4a9b-a74b-389374b46461",
  :balance 0.0,
  :operations nil,
  :blocked false}
 {:id "7446cfe6-882c-4f25-bad1-5ed8c9aea994",
  :balance 0.0,
  :operations nil,
  :blocked false}
 {:id "3136860d-ab7f-4814-8f3b-2d18048db9b9",
  :balance 0.0,
  :operations :foo,
  :blocked false}
 {:id "2dc20615-f1f7-4637-9602-ae9494689166",
  :balance 0.0,
  :operations nil,
  :blocked false}
 {:id "c6dccf4a-535c-4eba-8cfc-0554408de8bd",
  :balance 0.0,
  :operations nil,
  :blocked false})
```

Your swapping function will have to be map since you're trying to update
some matching component of a vector. Then you can test if the current item
is your target `(if (= (:id a) …)` at which point you can change it `(assoc
a :operations …)`. Otherwise, you need to return it so you don't lose any
data.

Note that in this case it might make some sense to transform your data to a
map since that allows for simple key lookups and would allow for the use of
`assoc-in`:

```
user=> (clojure.pprint/pprint @accounts)
{"7512a15b-0770-4a9b-a74b-389374b46461"
 {:id "7512a15b-0770-4a9b-a74b-389374b46461",
  :balance 0.0,
  :operations nil,
  :blocked false},
 "7446cfe6-882c-4f25-bad1-5ed8c9aea994"
 {:id "7446cfe6-882c-4f25-bad1-5ed8c9aea994",
  :balance 0.0,
  :operations nil,
  :blocked false},
 "3136860d-ab7f-4814-8f3b-2d18048db9b9"
 {:id "3136860d-ab7f-4814-8f3b-2d18048db9b9",
  :balance 0.0,
  :operations nil,
  :blocked false},
 "2dc20615-f1f7-4637-9602-ae9494689166"
 {:id "2dc20615-f1f7-4637-9602-ae9494689166",
  :balance 0.0,
  :operations nil,
  :blocked false},
 "c6dccf4a-535c-4eba-8cfc-0554408de8bd"
 {:id "c6dccf4a-535c-4eba-8cfc-0554408de8bd",
  :balance 0.0,
  :operations nil,
  :blocked false}}
nil
user=> (clojure.pprint/pprint (swap! accounts #(assoc-in %
["3136860d-ab7f-4814-8f3b-2d18048db9b9" :operations] :bar)))
{"7512a15b-0770-4a9b-a74b-389374b46461"
 {:id "7512a15b-0770-4a9b-a74b-389374b46461",
  :balance 0.0,
  :operations nil,
  :blocked false},
 "7446cfe6-882c-4f25-bad1-5ed8c9aea994"
 {:id "7446cfe6-882c-4f25-bad1-5ed8c9aea994",
  :balance 0.0,
  :operations nil,
  :blocked false},
 "3136860d-ab7f-4814-8f3b-2d18048db9b9"
 {:id "3136860d-ab7f-4814-8f3b-2d18048db9b9",
  :balance 0.0,
  :operations :bar,
  :blocked false},
 "2dc20615-f1f7-4637-9602-ae9494689166"
 {:id "2dc20615-f1f7-4637-9602-ae9494689166",
  :balance 0.0,
  :operations nil,
  :blocked false},
 "c6dccf4a-535c-4eba-8cfc-0554408de8bd"
 {:id "c6dccf4a-535c-4eba-8cfc-0554408de8bd",
  :balance 0.0,
  :operations nil,
  :blocked false}}
```


On Sun, Apr 29, 2018 at 10:12 AM, Axel Katerbau  wrote:

> Hi Renata,
>
> > How can I update the atom accounts in the field of operations?
> >
> > (def accounts (atom [{:id "7512a15b-0770-4a9b-a74b-389374b46461",
> :balance 0.0, :operations nil, :blocked false}
> >   {:id "7446cfe6-882c-4f25-bad1-5ed8c9aea994", :balance 0.0,
> :operations nil, :blocked false}
> >   {:id "3136860d-ab7f-4814-8f3b-2d18048db9b9", :balance 0.0,
> :operations nil, :blocked false}
> >   {:id "2dc20615-f1f7-4637-9602-ae9494689166", :balance 0.0,
> :operations nil, :blocked false}
> >   {:id "c6dccf4a-535c-4eba-8cfc-0554408de8bd", :balance 0.0,
> :operations nil, :blocked false}]))
> >
> > I tried this:
> >
> > (swap! accounts (fn [x] (update-in x [:operations]  #(if (= (:id %)
> account-id) new-value
> >
> > and returns "key must be integer" because of [:operations]
>
> the atom hold and array of accounts. In swap! you are trying to access one
> (!) value in a key-path [:operations] but access to elements of an array is
> not valid via a key-path but by using indexes.
>
> What you are seemingly trying to do is to map over the contents of the
> array in the atom which is not what you coded here.
>
> - Axel
>
> --
> 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 

Re: [ANN] clj-new -- creating new Clojure projects using the clj CLI

2018-04-20 Thread Tim Visher
On Thu, Apr 19, 2018 at 1:38 PM, Sean Corfield  wrote:

> I had the one-liner in an earlier version of the README but decided it was
> unreadable (a single long line is hard to read when it scrolls so much).
>
>
>
> Maybe I’ll put it back somewhere in there…
>

Might I suggest:

```
clj -Sdeps '{:deps
  {seancorfield/clj-new
{:git/url "https://github.com/seancorfield/clj-new;
 :sha "492bb2e7ad7373a8b5958124a86cddc4c7a123d5"}}}' \
  -m clj-new.create \
  app \
  bibbity.bobbity.boo
```

It copy/pastes just fine. :)

-- 
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: fdef for defmulti?

2018-04-06 Thread Tim Sauerwein
Because fdef is not available for defmulti, I find myself writing a 
dispatch function by hand instead of using a multimethod.

On Thursday, June 29, 2017 at 12:39:09 PM UTC-7, Alex Miller wrote:
>
> I don't think there is a jira issue for it, feel free to add it. Not 
> currently a priority for us but if someone wanted to work on it, I'd be 
> happy to review.
>
> On Thursday, June 29, 2017 at 1:47:36 PM UTC-5, Derek Thurn wrote:
>>
>> I'm also interested in this functionality. Is there an existing JIRA 
>> issue we can follow for allowing specs for multimethods?
>>
>> On Thursday, 18 August 2016 05:32:01 UTC-7, Patrik Sundberg wrote:
>>>
>>> Hi,
>>>
>>> Am I right to think you can't currently fdef a defmulti function? I 
>>> tried and when running tests using clojure.spec.test/instrument I see:
>>> 1. Unhandled java.lang.ClassCastException
>>>clojure.spec.test$spec_checking_fn$fn__12959 cannot be cast to
>>>clojure.lang.MultiFn
>>>
>>>   core.clj: 1806  clojure.core/get-method
>>>   core.clj: 1806  clojure.core/get-method
>>>time_series.clj:  474  tulos.time-series/eval181936/fn
>>>
>>> So I guess what happens is the fdef+instrument adds a normal fn wrapper, 
>>> which then isn't a multi method and it breaks down.
>>>
>>> Has this been discussed before? Any plans? I didn't find anything.
>>>
>>> Thanks,
>>> Patrik
>>>
>>>

-- 
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: Writing a text adventure in Clojure

2018-03-30 Thread Tim Visher
http://landoflisp.com/ is specifically about coding games in Lisp, in case
you're into books. :)

On Thu, Mar 29, 2018 at 6:45 PM, Will Duquette  wrote:

> I'm an experienced programmer, but a Clojure newbie; as a beginner
> project, I'm looking into how one would idiomatically write a text
> adventure of sorts in Clojure.  I'm less interested in producing a playable
> game than I am in learning how to do such a thing in a proper functional
> style.
>
> Suppose in this game I have a room whose description changes based on a
> global flag.  For example, there's something in the Fancy Room that you
> won't notice until you've reached the major plot point.
>
> The world map is (for the sake of argument) a hash-map whose keys are the
> room IDs and whose values are room records, where each record is a hash-map.
>
> (def world {:fancy-room {:name "Fancy Room" :description "This is a fancy
> room." ...}})
>
> I'm aware that I could use a (defstruct) or (defrecord); I'm keeping it
> simple for now.  Then, the flags are saved in a ref; the intent is that
> mutable set is segregated, so that it can more easily be written to a save
> file.
>
> ;; Global set of flags
> (def flags (ref #{})
>
> (defn flag-set [flag]
>(dosync (alter flags conj flag))
>
> ;; When the major plot point is reached
> (flag-set :major-plot-point-reached)
>
> Normally, to describe a room you just return its :description.
>
> (defn describe [room] (:description (world get room)))
>
> But for the :fancy-room, the returned description depends on the global
> flag, and it will be specific to :fancy-room.  I could add this logic
> directly to the (describe) function's body, but that would be ugly.  What
> I'd like to do is attach a lambda to the :fancy-room in some way.  The
> (describe) function looks for a :describer, and if it's there it calls it;
> and if not it just returns the :description:
>
> (defn describe [entity]
> (if (:describer entity)
>   ((:describer entity) entity)
>   (:description entity)))
>
> *Question 1*: this works, but it looks ugly to me; I figure there's a
> better, more idiomatic way to do this kind of thing that's probably obvious
> to anyone with any real experience.  Multimethods, maybe?  Define a Room
> protocol, then let most rooms be NormalRoom records, but let :fancy-room be
> a FancyRoom record?
>
> *Question 2*: Whatever code actually computes the description, it will
> need access to the :major-plot-point-reached flag.  What's the cleanest way
> to give the description code access to the flags ref?  It could simply
> access "@flags" directly:
>
> (if (:major-plot-point-reached @flags)
>   "This is a fancy room.  Hey, that light sconce looks movable!"
>   "This is a fancy room.")
>
> But that doesn't seem properly functional.  Would it be better to pass the
> game state into each method?
>
> (defn describe [entity state]
>   (if (:describer entity)
>  ((:describer entity) entity state)
>  (:description entity)))
>
> Any ideas?
>
> --
> 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/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] rocks.clj/z 0.1.0-SNAPSHOT (alpha)

2018-01-04 Thread Tim Visher
On Thu, Jan 4, 2018 at 12:04 AM, Edward Knyshov  wrote:

> Thanks :)
>
> I haven't considered using nio Zip FileSystem just because I never heard
> of it, but I'll definitely check it out.
>
> Regarding targeting to java 7, should something like this set up targeting
> properly?
>
> :javac-options ["-target" "1.7" "-source" "1.7"]
>

Not really. That's for compiling java code. I think that may interact in
some way with AOT as well but I'm honestly not sure. A library really
shouldn't AOT anything anyway (most things shouldn't :) ).

What I meant by targeting wasn't compilation but requiring a minimum java
version of 1.7, as the java.nio.file package was only added in 1.7 iiuc.

In contrast, clojure itself only requires 1.6.

--

In Christ,

Timmy V.

https://blog.twonegatives.com
https://five.sentenc.es

-- 
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] rocks.clj/z 0.1.0-SNAPSHOT (alpha)

2018-01-03 Thread Tim Visher
On Wed, Jan 3, 2018 at 6:56 AM, Edward Knyshov  wrote:

> Hi, I made a simple wrapper around java.util.zip.
> Basically it only allows you to compress files or unpack/process zip
> archives.
>

This looks neat. :)

Have you considered targeting Java 7 and using the nio Zip FileSystem?
https://docs.oracle.com/javase/7/docs/technotes/guides/io/fsp/
zipfilesystemprovider.html

I ask mainly because I'm curious. I just started reading about it last
night and this popped up this morning. What serendipity!

--

In Christ,

Timmy V.

http://blog.twonegatives.com
http://five.sentenc.es

-- 
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] jmh-clojure 0.2.0 - Seamless JMH benchmarking for Clojure

2017-12-21 Thread Tim Visher
Looks neat! :)

On Sun, Dec 17, 2017 at 11:25 AM,  wrote:

> This library (github link )
> provides a data-oriented API to JMH, the Java Microbenchmark Harness.
>
> Some of the new features since 0.1.0:
>
> External profiler support. Wiki example
>  
> utilizing
> Java Flight Recorder.
> Implicit benchmark selectors.
> Better error messages and validation.
>
> The companion plugin lein-jmh  has
> also been updated
>  since the
> initial release with features like output formats and sorting.
>
> Additional information is available via the docs
>  or wiki
> . The full changelog is
> available here
> .
>
> --
> 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/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: Doc strings for complex cases?

2017-11-09 Thread Tim
I think I have about two cases where multiple arity doc-strings would useful 
and for that I could just go without, but defmethods are more of a problem for 
me. I find defmethods can have greater contextual differences to the point I 
have been placing comments inline (;commented out lines) which I don't care for 
because you can't do standard lookups and inline comments just get in the way 
making the code harder to read. I'm not sure how changes could work from a 
lookup perspective, but that's where my pain is. And also, last week, I spent a 
good amount of time revisting some older code trying figure out what was going 
on, but alas I had only put a high level description in for the defmulti. 

Anyways, it's all good. I've been revisiting editors and tooling and I just 
think that's the best use of my time.
Cheers,
Tim 

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


Re: Doc strings for complex cases?

2017-11-09 Thread Tim
Thanks for the suggestion(s), but I don't like the idea of writing custom code 
to implement better doc strings. Should any breaking changes occur in Clojure 
core, then I too could be forced to make changes and deal with broken code 
everywhere. If there was more community interest and the Clojure team 
implemented it then I'd be good because I know it would be maintained, but it 
doesn't seem like this is the case. So if it requires some custom work then I 
think I'd much rather do it at the tooling level as a plug-in to an editor. Ie, 
pull doc strings out all together and have them linked to and stored 
elsewhere... Maybe just store a db id in the doc string and go from there. I'll 
need to mull it over ;)

Thanks,
tim

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


Re: Doc strings for complex cases?

2017-11-05 Thread Tim
I expected a code smell response, but I simply don't agree with that. I believe 
peoples approach to doc strings are as varied as people are. I tend to be 
specific and want to add more context (do not read 'more content') in my doc 
string(s) than others might, but at the same time it's not like there's a 
shortage of poorly documented code in the world. So maybe we should consider 
other people's approach too. A simple solution might be to put the doc-string 
before the name:

i.e. Instead of:

defmulti the-name multi-fn

use:

defmulti "brevity matters in a doc-string" the-name multi-fn

Or

(defn 
"doc-string"
([x]...)
"doc-string"
([x y] ...))

Or is there a reason not to consider adding this?

Cheers,
Tim







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


Re: Sum types in Clojure? Better to represent as tagged records or as variant vectors?

2017-08-29 Thread Tim Gilbert
I've used tagged unions to represent lookup identifiers for variant types 
and found them to be pleasant to work with. I think part of the reason they 
don't seem useful in the context of this discussion is that many of the 
examples given have not actually been variants. For example, in [:image/file 
"/images/image" :jpeg], every value will have those three data elements, 
and for {:status :response :result val}, every value will have both of 
those fields, and their values will be the same type. The identifiers I was 
working with were in heterogenous collections, so I might have [:image/ref 
45] or [:user/name "bob"] or [:project/element "project-slug" 435].

It would certainly be just as easy to use {:collection/type ::person 
:user/name "bob"} and {:collection/type ::project :project/slug 
"project-slug" :project/element 435}, but I like the concision of the 
tagged unions.

On Friday, August 25, 2017 at 4:30:37 PM UTC-4, tbc++ wrote:
>
> >> they're a little nicer to type and read
>
> And that's where I have to disagree. The problem with most of these 
> options is they complect ordering with meaning. 
>
> [:image/file "/images/image" :jpeg]
>
> Here I have no idea what these values mean. I have to have out-of-band 
> information about what offset in the vector corresponds to what value. 
> Functions have this same problem, look no further than `cons` vs `conj` to 
> see potential confusion on argument ordering. 
>
> So why don't we only use maps for function arguments? Well mostly to make 
> the functions easier to manipulate by humans. But some of the best 
> libraries for web APIs (AWS) that I've used have used almost an exclusively 
> map based interface. 
>
> Once again I have to repeat my mantra about DSLs. Don't start with DSLs. 
> Start with maps. Build everything off of maps. They're extensible, easy to 
> introspect, and can drive a host of metaprogramming algorithms. If maps are 
> to hard to understand, build constructor functions on top of them. Then 
> finally build a DSL on top, if you need it. 
>
> Frankly, I have so many things I have to remember during programming. I'd 
> much rather see a very uniform map-based interface. Than any sort of nested 
> vectors, tagged values, or anything else. 
>
> Surely we can't say that this:
> >> [[:image/file :image/web] :image.file/path "/images/image" :
> image.file/format :jpeg :image.web/url "www.myimage.com/image"]
>
> Is a better interface than:
>
> {:image.file/path "/images/image"
>  :image.file/format :jpeg
>  :image.web/url "www.myimage.com/image"}
>
> And as I said before, spec is designed from the start to support data in 
> this format. Stating "this is a file", "this is a web image". Is just book 
> keeping that doesn't need to be done. Is a map a :image/web? Well check its 
> members and see if they match the spec. If they match, then you have a 
> :image/web. No need for sum types, tags, wrapping values in vectors. Simply 
> state what a thing should have for it to conform to an interface, and 
> forget whatever else might be in there. It couldn't be simpler. 
>
> On Fri, Aug 25, 2017 at 11:59 AM, Didier  
> wrote:
>
>> Thanks for everyone's great input.
>>
>> Currently, I see the big distinction being concise vs extension. Maybe 
>> for streaming variants would be better as the format would be smaller to 
>> transfer over a wire. And for small short lived programs, or things you 
>> know won't need extension, variants offer a slightly more convenient 
>> structure to work with.
>>
>> I think both can be specced easily. S/or a few s/tuple to spec a variant. 
>> And multi-spec over a set for the map version.
>>
>> I'd like to explore then the issue of extensibility with variants. How 
>> would you extend them, is there really no way? This is some of my 
>> brainstorming thoughts.
>>
>> 1) How to design a variant of more then one value?
>>
>>
>> 1.1)
>>
>> I know this is a standard variant of one value:
>>
>> [:image/web "www.myimage.com/image.jpg"]
>>
>> I believe to extend it to more values, you would do:
>>
>> [:image/file "/images/image" :jpeg]
>>
>> That is, you'd threat it as a constructor function, which creates an 
>> :image/file type and takes an ordered list of arguments. This way, each 
>> variant type can even be overloaded on their arguments the way you'd 
>> overload a function.
>>
>> [:image/file "/images/image"]
>>
>> Can default to format :png for example, when using the one arg 
>> constructor.
>>
>> 1.2)
>>
>> An alternative is to keep variants as vector pairs, and nest them.
>>
>> [:image/file [:image/file-path "/images/image"] [:image/file-format:jpeg]]
>>
>> In this form, variants are more like their map counterpart. Each element 
>> is named and itself a variant.
>>
>> 1.3)
>>
>> You could also decide to limit variants to strict pairs, so the second 
>> element of any variant is either a variant or a vector of variants.
>>
>> [:image/file [[:image/file-path "/images/image"] 
>> 

Re: pager for lein repl?

2017-03-27 Thread Tim Visher
I have always used either CIDER (with full emacs paging support) or tmux
for those requirements.

On Thu, Mar 23, 2017 at 8:46 PM, Joe Python  wrote:

>
> Is there a equivalent of less/more like pager (found in Linux shells) for
> Leiningen repl?
>
> The lein repl is fast enough for me displaying large data structures
> making it great for exploratory programming. But it is desperately missing
> a pager.
>
> - Joe
>
> --
> 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/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.


HTTPS for dev.clojure.org?

2017-01-08 Thread Tim McCormack
Could we get HTTPS for dev.clojure.org? It's great that we have TLS on 
clojure.org (although not by default -- issue filed!) but dev.clojure.org 
takes passwords and involves exchanges of code patches, which makes it a 
moderately juicy target. (Some of those passwords may also be used for 
github or other sensitive places.)

 - Tim McCormack

-- 
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: Creating a spec for destructuring

2017-01-06 Thread Tim Visher
This is interesting. I did want to point out though that at least for me I
can't see links in your current styling.

[image: Inline image 1]

On Thu, Jan 5, 2017 at 9:18 AM, Alex Miller  wrote:

> I thought this might be interesting to some here:
>
> http://blog.cognitect.com/blog/2017/1/3/spec-destructuring
>
>
> --
> 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/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: Deref Nil

2016-09-15 Thread Tim Gilbert
In this specific case, I might personally use something like:

(render-image (some-> product-image-list first deref))

...or maybe write a little function that does the above. Alternately, in 
(render-image) you might start out with (if (nil? cursor) (default-image) 
(code-to-render @cursor)). You'd need to check for nil to render the 
default image even if deref was nil-punnable, right?

Tim

On Monday, September 12, 2016 at 4:30:00 AM UTC-4, Deon Moolman wrote:
>
> Hi Tim,
>
> Thanks for your feedback, I appreciate it! :)
>
> Ye, I've been tempted and bitten by atoms-in-atoms before, and that's no 
> fun - My case here is slightly different though, I have a single atom and 
> construct cursors to paths within, which are swappable and deref'able like 
> normal atoms, but they modify the value of the original atom (just their 
> allocated slice inside though).
>
> I'll give a bit of detail on one very specific usecase I have, my 
> structure looks like so:
>
> My atom (and its value) looks like so:
>
> (atom
>   {:product
>[{:product/id 1 :product/name "Cooker"}
> {:product/id 2 :product/name "Pan"}]
>:image
>[{:image/id 1 :image/url "..." :image/product 1}]})
>
> And I have a function (reverse-lookup) that will take a product id and 
> return a list of cursors that point to the individual images for a product, 
> so:
>
> (reverse-lookup :image/product 1) => [(cursor {:image/id :image/url "..." 
> :image/product 1})]
> (reverse-lookup :image/product 2) => []
>
> If I'm only interested in, say, rendering the first image, I can call 
> (render-image 
> @(first product-image-list)) - without nil-punning, I have to do add an 
> if to every usage, where I'd rather just handle nil to a default image 
> placeholder inside render-image.
>
> I also have a function will literally return the first (and likely only) 
> element in the lookup, which will also return a cursor or nil if not found. 
> One could argue that the data needs integrity checking in that case before 
> getting into the atom, but in my case I'd rather just nil-pun all the 
> things since it's not exactly a big deal.
>
> Anyhow - back to the original question - I'm wondering if there's anything 
> I'm missing about the decision to not nil-pun deref - If it's simply a 
> matter of 'didn't really think of it', that's fine, I'm quite content to 
> work around it, but if there's a deeper philosophical reason, then I'm keen 
> to add it to my understanding of the underlying foundation of clojure.
>
> Thanks again for all the feedback, I really do appreciate your time!
>
> Cheers,
>  - Deon
>
> On Sat, Sep 10, 2016 at 9:08 PM, Timothy Baldridge <tbald...@gmail.com 
> > wrote:
>
>> I've worked with a model much like this, and as an experience report: it 
>> resulted in a lot of pain. Atoms inside atoms, or really more than one atom 
>> for the entire state of your app results in to many sources of mutability. 
>> On top of that, you have the problem of async updates: some part of your 
>> state may or may not exist depending if some async call to the server has 
>> completed yet. I can't say much more without seeing your code, but I would 
>> use this as an opprotunity to re-think the design of the app a bit. 
>>
>> If you are getting nils in unexpected places you can either nil-prune 
>> (what you're asking for here), or you can ask "why am I getting a nil here 
>> when I didn't expect it...how can I keep from doing this in the future?". 
>> Perhaps the answer is as simple as never calling the render function of a 
>> component until all its state exists (Om.Next takes an approach somewhat 
>> like this). 
>>
>> On Sat, Sep 10, 2016 at 11:12 AM, Deon Moolman <cmdr...@gmail.com 
>> > wrote:
>>
>>> Hi Sean,
>>>
>>> Good point - as you have noticed, my use case is in ClojureScript - I'm 
>>> using reagent cursors (hence the deref) fairly heavily to chop my main atom 
>>> up and send only the relevant bits to components, but still allow them to 
>>> locally modify their state. 
>>>
>>> In my specific case, I do lookups for parts of the tree that may not 
>>> exist, and in that case 'nil' is the obvious return value.
>>>
>>> Cheers,
>>>  - Deon
>>>
>>> On Fri, Sep 9, 2016 at 6:55 PM, Sean Corfield <se...@corfield.org 
>>> > wrote:
>>>
>>>> Like Stuart, I don’t encounter atom-or-nil as a common pattern – could 
>>>> you explain why you have functions that might return an atom or might 
>>>> return nil?
>>>&g

REPL-Driven Techniques?

2015-08-07 Thread Tim Visher
Hi Everyone,

I'm taking part in an effort to introduce REPL-Driven Development at my 
shop. The shop has historically been based in PHP/Python/javascript and 
similar languages and most devs there have their workflows formed by that 
technology.

I'm used to using a REPL or REPL-connected editor to develop and debug code 
but I've always struggled to articulate exactly why and how I go about 
doing that, other than saying that it tightens the feedback loop like 
nothing I've ever seen, which I think is descriptive yet still not 
particularly helpful.

I'm wondering if there's a collection of techniques somewhere online. I've 
spent some time googling for things like it but I'm coming up mostly empty.

I watched this years ago and it seems 
pertinent: https://www.youtube.com/watch?v=_B_4vhsmRRI

I also found Jay Field's RDD post which I had read before, but sort of just 
states the same thing I already said.

Some examples of techniques that aren't possible without a REPL

1. (def *foo* (arbitrary expression))

Modify a function definition to capture a var and then run what you're 
working on to have a value you can interact with as you continue to 
develop. This is also incredibly useful when debugging code because you can 
capture the args to a function and then work with and inspect them offline.

If you need to capture something in a let chain you can `_ (def …)` handily.

2. Interactively modify a function definition when you believe you have a 
solution and verify that it works immediately (no release!)

I think the thing that I find hard to express about this is that all the 
advice boils down to You have the entirety of your language instantly at 
your disposal to debug and develop anything which is both true and not 
very helpful if the tightest feedback loop you've used is TDD.

Any ideas?

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
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] lein-collisions: a plugin to find classpath collisions

2015-07-13 Thread Tim Gilbert
I'm not sure if it's something else in my project's somewhat baroque 
dependency tree that causes this, but after I add lein-collisions to my 
project's plugins, I'm unable to get it to pass lein's :pedantic? tests due 
to overlapping versions in its own dependencies:

http://pastebin.com/js93Mrzw

...and in fact the only way I can get it to pass dependency checks is if I 
add a lot of :exclusions, up to and including org.slf4j/slf4j-api at which 
point it aborts with a runtime error java.lang.ClassNotFoundException: 
org.slf4j.LoggerFactory.

Is anyone else seeing this?

Thanks
Tim

On Monday, July 13, 2015 at 10:05:41 AM UTC-4, Herwig Hochleitner wrote:

 2015-07-09 19:01 GMT+02:00 Andy Fingerhut andy.fi...@gmail.com 
 javascript::

 I think it would be helpful to include that text in your README on Github 
 somewhere.


 Done. Good idea, thanks Andy!



-- 
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: Clojure Async/State Machine/Workflow Libraries?

2015-05-04 Thread Tim Visher
I think I may have summoned the wrong demons when invoking with the 
`Workflow` keyword. :)

I've found some resources on Event-Driven Architecture, mostly from Zach 
Tellman. Is his stuff the main source of that sort of thing?

I realized that prismatic's graph is basically what I'm looking for 
(especially with the addition of async into the model) so long as my edge 
predicates are always based on data availability, since graph is 
essentially what I'm talking about as far as a 'workflow' description where 
you talk about steps, but the transition predicates are implicitly defined 
by data availability, which I think at least models the current problems 
that I have.

Any further thoughts given that new information?

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

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


Clojure Async/State Machine/Workflow Libraries?

2015-04-30 Thread Tim Visher
Hey All,

Anyone have any tips on clojure 'workflow' libraries? 
https://github.com/relaynetwork/impresario is very close, but lacks some 
basic features like exception transitions, etc. 

Basically, I'm looking for a library that allows me to create a workflow 
that will happen asynchronously, recording it's progress in a db. I think i 
could probably whip something together without _too_ much trouble using 
core.async but this feels like something that's probably already been 
written.

Thanks in advance!

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
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] Chestnut 0.7.0

2015-03-10 Thread Tim Gilbert
Oh, that's odd. I don't have any entries in my own user plugins for lein 
new templates. (I'm assuming you meant ~/.lein/profiles.clj, right?)

Is there some reason you have them in there? lein new chestnut should 
work just fine without them, but maybe I'm not understanding what you're 
trying to do.

Tim

On Monday, March 9, 2015 at 6:30:48 PM UTC-4, webber wrote:

 I've commented chestnut/lein-template from the ~/.lein/projects.clj as 
 follows, then it worked.
 It worked using 0.6.0 if there was the chestnut/lein-template definition. 
 Was my usage wrong ?

 {:user {:plugins [
   [lein-try 0.4.3]
   ;[lein-pprint 1.1.1]
   [lein-ancient 0.6.4 :exclusions 
 [org.clojure/core.cache]]
   [lein-bikeshed 0.2.0]
   [lein-ritz 0.7.0]
   [lein-marginalia 0.8.0]
   [http-kit/lein-template 1.0.0-SNAPSHOT]
   [cider/cider-nrepl 0.9.0-SNAPSHOT]
   [cljs-complete 0.1.1]
   ;;[chestnut/lein-template 0.7.0]
   ;;[chestnut/lein-template 0.6.0]
   ]
 :dependencies [;;[nrepl-inspect 0.4.1]
[compliment 0.2.0]
[ritz/ritz-nrepl-middleware 0.7.0]
[cider/cider-nrepl 0.9.0-SNAPSHOT]
[alembic 0.2.1]
[org.clojure/tools.nrepl 0.2.7]
]

 :repl-options {:nrepl-middleware
[cider.nrepl.middleware.classpath/wrap-classpath
 cider.nrepl.middleware.complete/wrap-complete
 cider.nrepl.middleware.info/wrap-info
 cider.nrepl.middleware.inspect/wrap-inspect
 cider.nrepl.middleware.stacktrace/wrap-stacktrace
 cider.nrepl.middleware.trace/wrap-trace
 ]}

 }}

 Makoto
  

 I ran into this same behavior, and then I realized it only happened if I 
 run the lein new command if I'm *already in* a previously-created 
 project created with lein new chestnut. I'm guessing that something in 
 the generated project.clj interferes some of the lein new behavior somehow. 
 At any rate, running lein new in a directory without a project.clj file in 
 it is working fine for me.

 Tim

 On Saturday, March 7, 2015 at 5:38:41 AM UTC-5, webber wrote:

 I tested the v 0.7.0 of chestnut and I encountered the following error.
 The v 0.6.0 works fine.

 $ lein new chestnut test-app
 Retrieving chestnut/lein-template/0.7.0/lein-template-0.7.0.pom from 
 clojars
 Retrieving chestnut/lein-template/0.7.0/lein-template-0.7.0.jar from 
 clojars
 Exception in thread main java.lang.ExceptionInInitializerError
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:270)
 at clojure.lang.RT.loadClassForName(RT.java:2093)
 at clojure.lang.RT.load(RT.java:430)
 at clojure.lang.RT.load(RT.java:411)
 at clojure.core$load$fn__5066.invoke(core.clj:5641)
 at clojure.core$load.doInvoke(core.clj:5640)
 at clojure.lang.RestFn.invoke(RestFn.java:408)
 at clojure.core$load_one.invoke(core.clj:5446)
 at clojure.core$load_lib$fn__5015.invoke(core.clj:5486)
 at clojure.core$load_lib.doInvoke(core.clj:5485)
 at clojure.lang.RestFn.applyTo(RestFn.java:142)
 at clojure.core$apply.invoke(core.clj:626)
 at clojure.core$load_libs.doInvoke(core.clj:5524)
 at clojure.lang.RestFn.applyTo(RestFn.java:137)
 at clojure.core$apply.invoke(core.clj:626)
 at clojure.core$require.doInvoke(core.clj:5607)
 at clojure.lang.RestFn.invoke(RestFn.java:421)
 at stencil.core$loading__4958__auto__.invoke(core.clj:1)
 at stencil.core__init.load(Unknown Source)
 at stencil.core__init.clinit(Unknown Source)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:270)
 at clojure.lang.RT.loadClassForName(RT.java:2093)
 at clojure.lang.RT.load(RT.java:430)
 at clojure.lang.RT.load(RT.java:411)
 at clojure.core$load$fn__5066.invoke(core.clj:5641)
 at clojure.core$load.doInvoke(core.clj:5640)
 at clojure.lang.RestFn.invoke(RestFn.java:408)
 at clojure.core$load_one.invoke(core.clj:5446)
 at clojure.core$load_lib$fn__5015.invoke(core.clj:5486)
 at clojure.core$load_lib.doInvoke(core.clj:5485)
 at clojure.lang.RestFn.applyTo(RestFn.java:142)
 at clojure.core$apply.invoke(core.clj:626)
 at clojure.core$load_libs.doInvoke(core.clj:5524)
 at clojure.lang.RestFn.applyTo(RestFn.java:137)
 at clojure.core$apply.invoke(core.clj:626)
 at clojure.core$require.doInvoke(core.clj:5607)
 at clojure.lang.RestFn.invoke(RestFn.java:512)
 at leiningen.new.templates$loading__4958__auto__.invoke(templates.clj:11)
 at leiningen.new.templates__init.load(Unknown Source)
 at leiningen.new.templates__init.clinit(Unknown Source)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:270)
 at clojure.lang.RT.loadClassForName(RT.java:2093

Re: [ANN] Chestnut 0.7.0

2015-03-08 Thread Tim Gilbert
I ran into this same behavior, and then I realized it only happened if I 
run the lein new command if I'm *already in* a previously-created project 
created with lein new chestnut. I'm guessing that something in the 
generated project.clj interferes some of the lein new behavior somehow. At 
any rate, running lein new in a directory without a project.clj file in it 
is working fine for me.

Tim

On Saturday, March 7, 2015 at 5:38:41 AM UTC-5, webber wrote:

 I tested the v 0.7.0 of chestnut and I encountered the following error.
 The v 0.6.0 works fine.

 $ lein new chestnut test-app
 Retrieving chestnut/lein-template/0.7.0/lein-template-0.7.0.pom from 
 clojars
 Retrieving chestnut/lein-template/0.7.0/lein-template-0.7.0.jar from 
 clojars
 Exception in thread main java.lang.ExceptionInInitializerError
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:270)
 at clojure.lang.RT.loadClassForName(RT.java:2093)
 at clojure.lang.RT.load(RT.java:430)
 at clojure.lang.RT.load(RT.java:411)
 at clojure.core$load$fn__5066.invoke(core.clj:5641)
 at clojure.core$load.doInvoke(core.clj:5640)
 at clojure.lang.RestFn.invoke(RestFn.java:408)
 at clojure.core$load_one.invoke(core.clj:5446)
 at clojure.core$load_lib$fn__5015.invoke(core.clj:5486)
 at clojure.core$load_lib.doInvoke(core.clj:5485)
 at clojure.lang.RestFn.applyTo(RestFn.java:142)
 at clojure.core$apply.invoke(core.clj:626)
 at clojure.core$load_libs.doInvoke(core.clj:5524)
 at clojure.lang.RestFn.applyTo(RestFn.java:137)
 at clojure.core$apply.invoke(core.clj:626)
 at clojure.core$require.doInvoke(core.clj:5607)
 at clojure.lang.RestFn.invoke(RestFn.java:421)
 at stencil.core$loading__4958__auto__.invoke(core.clj:1)
 at stencil.core__init.load(Unknown Source)
 at stencil.core__init.clinit(Unknown Source)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:270)
 at clojure.lang.RT.loadClassForName(RT.java:2093)
 at clojure.lang.RT.load(RT.java:430)
 at clojure.lang.RT.load(RT.java:411)
 at clojure.core$load$fn__5066.invoke(core.clj:5641)
 at clojure.core$load.doInvoke(core.clj:5640)
 at clojure.lang.RestFn.invoke(RestFn.java:408)
 at clojure.core$load_one.invoke(core.clj:5446)
 at clojure.core$load_lib$fn__5015.invoke(core.clj:5486)
 at clojure.core$load_lib.doInvoke(core.clj:5485)
 at clojure.lang.RestFn.applyTo(RestFn.java:142)
 at clojure.core$apply.invoke(core.clj:626)
 at clojure.core$load_libs.doInvoke(core.clj:5524)
 at clojure.lang.RestFn.applyTo(RestFn.java:137)
 at clojure.core$apply.invoke(core.clj:626)
 at clojure.core$require.doInvoke(core.clj:5607)
 at clojure.lang.RestFn.invoke(RestFn.java:512)
 at leiningen.new.templates$loading__4958__auto__.invoke(templates.clj:11)
 at leiningen.new.templates__init.load(Unknown Source)
 at leiningen.new.templates__init.clinit(Unknown Source)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:270)
 at clojure.lang.RT.loadClassForName(RT.java:2093)
 at clojure.lang.RT.load(RT.java:430)
 at clojure.lang.RT.load(RT.java:411)
 at clojure.core$load$fn__5066.invoke(core.clj:5641)
 at clojure.core$load.doInvoke(core.clj:5640)
 at clojure.lang.RestFn.invoke(RestFn.java:408)
 at clojure.core$load_one.invoke(core.clj:5446)
 at clojure.core$load_lib$fn__5015.invoke(core.clj:5486)
 at clojure.core$load_lib.doInvoke(core.clj:5485)
 at clojure.lang.RestFn.applyTo(RestFn.java:142)
 at clojure.core$apply.invoke(core.clj:626)
 at clojure.core$load_libs.doInvoke(core.clj:5524)
 at clojure.lang.RestFn.applyTo(RestFn.java:137)
 at clojure.core$apply.invoke(core.clj:626)
 at clojure.core$require.doInvoke(core.clj:5607)
 at clojure.lang.RestFn.invoke(RestFn.java:512)
 at leiningen.new$loading__4958__auto__.invoke(new.clj:1)
 at leiningen.new__init.load(Unknown Source)
 at leiningen.new__init.clinit(Unknown Source)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:270)
 at clojure.lang.RT.loadClassForName(RT.java:2093)
 at clojure.lang.RT.load(RT.java:430)
 at clojure.lang.RT.load(RT.java:411)
 at clojure.core$load$fn__5066.invoke(core.clj:5641)
 at clojure.core$load.doInvoke(core.clj:5640)
 at clojure.lang.RestFn.invoke(RestFn.java:408)
 at clojure.core$load_one.invoke(core.clj:5446)
 at clojure.core$load_lib$fn__5015.invoke(core.clj:5486)
 at clojure.core$load_lib.doInvoke(core.clj:5485)
 at clojure.lang.RestFn.applyTo(RestFn.java:142)
 at clojure.core$apply.invoke(core.clj:626)
 at clojure.core$load_libs.doInvoke(core.clj:5524)
 at clojure.lang.RestFn.applyTo(RestFn.java:137)
 at clojure.core$apply.invoke(core.clj:626)
 at clojure.core$require.doInvoke(core.clj:5607)
 at clojure.lang.RestFn.invoke(RestFn.java:408)
 at leiningen.core.utils$require_resolve.invoke(utils.clj:80)
 at leiningen.core.utils$require_resolve.invoke(utils.clj:83)
 at leiningen.core.main$lookup_task_var.invoke(main.clj:68)
 at leiningen.core.main$pass_through_help_QMARK_.invoke(main.clj:78)
 at leiningen.core.main$task_args.invoke

Re: How can I remove the nils in the result?

2014-12-22 Thread Tim
Another option (though Bens does look nicer!) 

(loop [xs (- 00101110101110
(map vector (iterate inc 1))
(filter #(= (last %) \1))
(map first))
  it nil]
  (let [steps (partition 2 1 xs)
[i o] (split-with in-step steps)]
(cond (every? empty? steps)
(str it (first xs))
  (empty? i)
(recur (rest xs)(str it (first xs) ,))
   :else (recur (last (split-at (count i) xs)) (str it (ffirst 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/d/optout.


Re: How can I remove the nils in the result?

2014-12-22 Thread Tim
whoops...

   (defn in-step [xs]
 (let [[x1 x2] xs]
   (= (- x2 x1) 1)))

On Monday, December 22, 2014 11:38:49 PM UTC-8, Tim wrote:

 Another option (though Bens does look nicer!) 

 (loop [xs (- 00101110101110
 (map vector (iterate inc 1))
 (filter #(= (last %) \1))
 (map first))
   it nil]
   (let [steps (partition 2 1 xs)
 [i o] (split-with in-step steps)]
 (cond (every? empty? steps)
 (str it (first xs))
   (empty? i)
 (recur (rest xs)(str it (first xs) ,))
:else (recur (last (split-at (count i) xs)) (str it (ffirst 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/d/optout.


Question on developing flexible libraries and best practices.

2014-12-18 Thread Tim
I've developed a library that I would like to be extremely flexible. My 
current iteration has a primary function, in a core namespace, that 
dispatches to multi-methods which are expected to be defined externally as 
plug-ins/modules. The issue at hand is determining the right way to do this 
given how namespaces work in Clojure.  A conceptual example follows (the 
project is not xmas related, but Tis' the season for such things):

(ns christmas.core)

(defmulti remove-items :id) 
(defmulti add-items :id)

(defn decorate [object instructions]
  (reduce
#(- %1
(remove-items %2)
(add-items %2))
   object instructions))

Doing it this way allows people to create their own modules in separate 
namespaces containing the appropriate method handling along with a unique 
id:

(ns whacky.module
   (require christmas.core))

(defmethod christmas.core/remove-items :whacky [spec object]
   (remove-whacky-items object spec))

(defmethod christmas.core/add-items :whacky [spec object]
   (add-whacky-items object spec))

Note that I also want the ability to mix and match in use.  i.e...

(ns sample.use
   (require [christmas.core :refer (decorate)])
   (require whacky.module)
   (require crazy.module))

(decorate 
{:object tree :branches 50}
[{:action add :id :whacky :type lights :num 4}{:action remove :id 
:crazy :type ornaments}}})

Originally I implemented it such that these methods would reside in their 
origin namespace (ie. not loaded back to christams.core) but that caused: 
circular namespace loading blowups (which could be mitigated via nasty 
macro hacks), major code redundancy issues (due to some required code 
scaffolding), along with overall ease of use concerns. And so here I am, 
with the above working, but still thinking there's got to be a cleaner way 
to do this. 

Have any of you folks created a truly flexible plug-in/module system, 
within Clojure, that can be shown? Can you point me to a project that you 
would consider representative of a best practice for doing such?

Overall I can't help think I'm missing some well defined abstraction that's 
already built. Here are some options I've considered:

1. deftype, defrecord and protocols: We're not decorating well defined 
objects. These objects have only a few shared conceptual dispatches, but 
other than that they are loosely defined at a high level through 
documentation guidance and dynamically defined within the object itself 
(which is just a map), and since each module manages its own code 
everything works according to its own set of instructions specs.

2. Building this as an application (storing dispatch code in a db) instead 
of making it a library. This is feasible, but I'm thinking the required 
user setup will lose all curb appeal. And this seems like a lot of work 
just to mitigate namespace management for multi-method dispatching.

Now that I think further, it feels more like a spec than a library, only 
I'm trying to provide a single entry point with some very minimal loosely 
defined dispatches acting as constraints.

Thanks for any helpful ideas/pointers.

Tim

Sent from my iPad

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


Re: Clojure beginner: angst about doing things right

2014-09-23 Thread Tim Visher
On Mon, Sep 22, 2014 at 2:45 PM, J David Eisenberg
jdavid.eisenb...@gmail.com wrote:
 As part of a larger program, I'm testing a function that will turn a string
 of days on which a class occurs (such as MWF) into a list of seven
 numbers: (1 0 1 0 1 0 0).
 I first translateTH (Thursday) to R and SU (Sunday) to N to make
 things a bit easier.

 I came up with the following code:

 (defn days-number-maker
   Recursively compare first item in days of week with
 first item in string of days. If matching, add a 1,
 else add a zero to the result
   [all-days day-string result]
   (if (empty? all-days) (reverse result)
 (if (= (first all-days) (first day-string))
   (recur (rest all-days)(rest day-string) (conj result 1))
   (recur (rest all-days) day-string (conj result 0)

 (defn days-to-numbers
   Change string like MTTH to (1 1 0 1 0 0 0)
   [day-string]
   (let [days (clojure.string/replace
(clojure.string/replace day-string #TH R) #SU N)]
 (days-number-maker MTWRFSN days (list

 The good news: the code works. The bad news: I'm convinced I'm doing it
 wrong, in the moral purity sense of the word. Something inside of me says,
 You could have just used (map...) to do this the *right* way, but I can't
 see how to do it with (map). So, my two questions are:

 1) Is there such a thing as the Clojure way, and if so,
 2) How can I rewrite the code to be more Clojure-ish?

Just for fun, I thought of a way to do this with map. The trick is to
not map over the days of the class, but instead map over the days of
the week, checking for matches in the class schedule.

(def week [SU M T W TH F S SU])

(def class-schedule MWTHFSU)

(defn class-days [class-schedule]
  (- class-schedule
   (re-seq #(TH|SU|S|M|T|W|F))
   (map first)
   set))

user= (mapv (partial contains? (class-days class-schedule)) week)
[true true false true true true false true]

Anyway, it's such a trivial problem that I don't think anyone would
fault you one way or another (unless you were out there using an atom
or something to track state) but this is one way to do it with map.

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

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


lein 2.4.3 repl outside project?

2014-08-28 Thread Tim Visher
Anyone else get this error?

 lein repl
Downloading Leiningen to
/Users/tim/.lein/self-installs/leiningen-2.4.3-standalone.jar now...
  % Total% Received % Xferd  Average Speed   TimeTime Time  Current
 Dload  Upload   Total   SpentLeft  Speed
100   3550   3550 0889  0 --:--:-- --:--:-- --:--:--   889
100 14.2M  100 14.2M0 0  2469k  0  0:00:05  0:00:05 --:--:-- 3166k
nREPL server started on port 52343 on host 127.0.0.1 - nrepl://127.0.0.1:52343
REPL-y 0.3.2, nREPL 0.2.0-beta5Exception in thread nREPL-worker-0
NoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length()I
clojure.tools.nrepl.middleware.session/session-out/fn--7630
(session.clj:43)NoSuchMethodError
clojure.tools.nrepl.StdOutBuffer.length()I
clojure.tools.nrepl.middleware.session/session-out/fn--7630
(session.clj:43)java.lang.NoSuchMethodError:
clojure.tools.nrepl.StdOutBuffer.length()I
at 
clojure.tools.nrepl.middleware.session$session_out$fn__7630.doInvoke(session.clj:43)
at clojure.lang.RestFn.invoke(RestFn.java:460)
at 
clojure.tools.nrepl.middleware.session.proxy$java.io.Writer$ff19274a.write(Unknown
Source)
at java.io.PrintWriter.write(PrintWriter.java:456)
at java.io.PrintWriter.write(PrintWriter.java:473)
at clojure.core$fn__5471.invoke(core_print.clj:191)
at clojure.lang.MultiFn.invoke(MultiFn.java:231)
at clojure.core$pr_on.invoke(core.clj:3392)
at clojure.core$pr.invoke(core.clj:3404)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:624)
at clojure.core$prn.doInvoke(core.clj:3437)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:624)
at clojure.core$println.doInvoke(core.clj:3457)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.main$repl_caught.invoke(main.clj:158)
at 
clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569$fn__7582.invoke(interruptible_eval.clj:76)
at clojure.main$repl$fn__6634.invoke(main.clj:259)
at clojure.main$repl.doInvoke(main.clj:257)
at clojure.lang.RestFn.invoke(RestFn.java:1096)
at 
clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569.invoke(interruptible_eval.clj:56)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invoke(core.clj:624)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1862)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at 
clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:41)
at 
clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__7610$fn__7613.invoke(interruptible_eval.clj:171)
at clojure.core$comp$fn__4192.invoke(core.clj:2402)
at 
clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__7603.invoke(interruptible_eval.clj:138)
at clojure.lang.AFn.run(AFn.java:22)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
#Namespace user

Error loading namespace; falling back to userException in thread
nREPL-worker-2 java.lang.NoSuchMethodError:
clojure.tools.nrepl.StdOutBuffer.length()I
at 
clojure.tools.nrepl.middleware.session$session_out$fn__7630.doInvoke(session.clj:43)
at clojure.lang.RestFn.invoke(RestFn.java:460)
at 
clojure.tools.nrepl.middleware.session.proxy$java.io.Writer$ff19274a.write(Unknown
Source)
at java.io.PrintWriter.write(PrintWriter.java:456)
at java.io.PrintWriter.write(PrintWriter.java:473)
at clojure.core$fn__5471.invoke(core_print.clj:191)
at clojure.lang.MultiFn.invoke(MultiFn.java:231)
at clojure.core$pr_on.invoke(core.clj:3392)
at clojure.core$pr.invoke(core.clj:3404)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invoke(core.clj:624)
at clojure.core$prn.doInvoke(core.clj:3437)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:624)
at clojure.core$println.doInvoke(core.clj:3457)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.main$repl_caught.invoke(main.clj:158)
at 
clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569$fn__7582.invoke(interruptible_eval.clj:76)
at clojure.main$repl$fn__6634.invoke(main.clj:259)
at clojure.main$repl.doInvoke(main.clj:257)
at clojure.lang.RestFn.invoke(RestFn.java:1096)
at 
clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__7569.invoke(interruptible_eval.clj:56)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invoke(core.clj:624)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1862)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at 
clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:41)
at 
clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval

Re: lein 2.4.3 repl outside project?

2014-08-28 Thread Tim Visher
Looks like it. Good to know it's been 'fixed'.

On Thu, Aug 28, 2014 at 12:35 PM, john walker john.lou.wal...@gmail.com wrote:
 Right, so if you're having this problem, just do.

 lein upgrade 2.4.2

 Cider users might also get this behavior and not know it - weird things like
 pretty printing not working are related to this issue.


 On Thursday, August 28, 2014 9:01:40 AM UTC-7, John Gabriele wrote:

 On Thursday, August 28, 2014 11:29:44 AM UTC-4, Tim Visher wrote:

 Anyone else get this error?



 Yup. I think it's https://github.com/technomancy/leiningen/issues/1625.

 --
 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/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: What is happening in this code?

2014-08-27 Thread Tim Visher
Clojure is form-oriented so you can think of almost all of its
evaluation as sending one form after another to a REPL. In that model
of evaluation, you of course want to be able to re-define a symbol an
arbitrary amount of times.

The serialization of these forms into a file which has other forms in
it is almost incidental. In the case of a file, the forms are passed
one at a time to the interpreter.

There has been some discussion, iirc, of generating a warning when a
symbol is redefined.

On Wed, Aug 27, 2014 at 5:32 AM, Hemant Gautam gettingerr...@gmail.com wrote:
 I am new to Clojure, I am currently at Beginner level. While trying to run
 small programs, I found that I can load a file having duplicate code. Let me
 explain it with example.

 This is the code

 (ns clojure_begins_19_08_2014.core)

 (defn first-fn[x]
   (print x))

 (defn first-fn[x]
   (print Value of x with String  x))

 (first-fn 10)

 See, above code consists of two function with same name and with same number
 of arguments.
 When I call first-fn, the function declared later gets called. I get output
 as:

 Value of x with String  10
 nil

 So can any one explain how this thing is happening and also explain how we
 can have same function written 2 times in a same namespace.

 --
 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/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] Grimoire: up to date Clojure web docs

2014-07-12 Thread Tim Gilbert
Well, clojure-grimoire.com is available, FWIW.

Tim

On Saturday, July 12, 2014 2:46:18 AM UTC-4, Reid McKenzie wrote:

 While I appreciate the interest, I think that attempting to officiate 
 Grimoire is a bad move. 

 We already have clojure.org. clojure.org is the only official site. 
 Grimoire is not condoned by Rich. Using #clo?j.*\.org would detract 
 from any future documentation effort Rich and co. may make and implies a 
 blessing which I do not have, do not seek and do not expect to get. See 
 http://arrdem.com/2014/07/12/of_mages_and_grimoires/ for more on the 
 subject. 

 Furthermore the #clo?j.* is also confusing due to existing namespace 
 contention from clojuredocs.org and clojure-doc.org let alone 
 clojure.org should it overnight grow better docs. Case in point: I lost 
 the link to http://getclojure.com/ for several months until it was 
 mentioned in IRC in the last week because it fell down the back of my 
 mental couch with the rest of the *jure namespace. 

 Reid 


-- 
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: lein install

2014-07-08 Thread Tim Visher
On Tue, Jul 8, 2014 at 7:39 AM, zhenxuanpan zhenxuan...@gmail.com wrote:
 when i run lein install

 lein install
 Compiling zilch.mq
 Exception in thread main java.io.FileNotFoundException: Could not locate
 zilch/mq__init.class or zilch/mq.clj on classpath:
 at clojure.lang.RT.load(RT.java:432)
 at clojure.lang.RT.load(RT.java:400)
 at clojure.core$load$fn__4890.invoke(core.clj:5415)
 at clojure.core$load.doInvoke(core.clj:5414)
 at clojure.lang.RestFn.invoke(RestFn.java:408)
 at clojure.core$load_one.invoke(core.clj:5227)
 at clojure.core$compile$fn__4895.invoke(core.clj:5426)
 at clojure.core$compile.invoke(core.clj:5425)
 at user$eval9.invoke(form-init581473078545854006.clj:1)
 at clojure.lang.Compiler.eval(Compiler.java:6511)
 at clojure.lang.Compiler.eval(Compiler.java:6501)
 at clojure.lang.Compiler.load(Compiler.java:6952)
 at clojure.lang.Compiler.loadFile(Compiler.java:6912)
 at clojure.main$load_script.invoke(main.clj:283)
 at clojure.main$init_opt.invoke(main.clj:288)
 at clojure.main$initialize.invoke(main.clj:316)
 at clojure.main$null_opt.invoke(main.clj:349)
 at clojure.main$main.doInvoke(main.clj:427)
 at clojure.lang.RestFn.invoke(RestFn.java:421)
 at clojure.lang.Var.invoke(Var.java:419)
 at clojure.lang.AFn.applyToHelper(AFn.java:163)
 at clojure.lang.Var.applyTo(Var.java:532)
 at clojure.main.main(main.java:37)
 Compilation failed: Subprocess failed

Is your source code available anywhere? Harder to help without it.

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
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: Clojure Contributor Agreement process update

2014-06-10 Thread Tim Visher
(boom)

On Mon, Jun 9, 2014 at 1:23 PM, Alex Miller a...@puredanger.com wrote:
 Starting today, we have updated the Clojure Contributor Agreement process.
 The prior process which involved signing and mailing a form has been
 replaced with an online e-signing process.

 Existing contributors that have signed the Contributor Agreement are
 unaffected - those agreements are still in effect. New signers will use the
 online process.

 Information has been updated at:
 http://clojure.org/contributing

 As always, we welcome your contributions to the Clojure community and hope
 that we can continue to improve Clojure together!

 - Alex Miller, Rich Hickey, and the Clojure team



 --
 You received this message because you are subscribed to the Google Groups
 Clojure Dev group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojure-dev+unsubscr...@googlegroups.com.
 To post to this group, send email to clojure-...@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojure-dev.
 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: Heidegger, literate programming, and communication

2014-05-22 Thread Tim Daly
Forward from Ralf Hemmecke:


On 05/22/2014 11:21 AM, Gregg Reynolds wrote:
 I can tell you I would rather maintain the four lines of C++ without
 the largely useless commentary.

That's a simple AXIOM program, but I'm sure one can easily translate it
into any programming language.

foo(a: Integer, b: Integer): Integer ==
if a  0 then
if a  b then return foo(b,a)
return foo(b-a,a))
return b

Question: Does the program have a bug?

Ralf

-- 
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: Heidegger, literate programming, and communication

2014-05-22 Thread Tim Daly
Tim, as someone already mentioned, the multi-page Java code you posted from
the Clojure core is actually one file from the Java ASM library, copied
into the Clojure Github repository from one version of that library
available from here:

Hmmm, I didn't see that in the documentation :-)
Thanks for the warning.

In order to write the book I took a clone of the repository at a
particular time with the intention of walking up the diffs after
I had a clue about the details.

There are 18,821 lines of Java code in that library, as it has been copied
into Clojure in the src/jvm/clojure/asm directory.  

Oh, good. That means I can read the library documentation :-)

I would strongly
recommend that you *not* spend a lot of time reading and documenting that
code, if you want to document things that are unique to Clojure.  That
library is used by other projects besides Clojure.  Between Clojure 1.5.1
and Clojure 1.6.0, a new version of it was copied over the older version
that was used before then.

http://dev.clojure.org/jira/browse/CLJ-713

That will likely happen again in a future Clojure release, to better
support JDK8:

and again for JDK9... and again for JDK10... and again for...

If Clojure needs the library then it needs to be documented. I am
using a reference model. If code references a function then document
the function. If no code references the library then it won't get
documented.

Any living piece of software is going to have changes made but I'm
hoping that the core remain reasonably stable. Assuming, of course, I
can distinguish core code. Reading code is SO much fun :-)

Anyway, thanks for the warning.

Tim Daly


-- 
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: [Axiom-developer] Heidegger, literate programming, and communication

2014-05-22 Thread Tim Daly

PS I have many chunks of code that I wrote 20-30 years ago and I have no
idea why and what the code was written for even after reading each
line of the code

This is what got me interested in literate programming. 

Axiom was written at IBM as research code, mostly by people trying to
get a PhD. I wrote bits and pieces of the internals but didn't bother
to document anything, especially since I write dirt simple code.

Fifteen years later I'm looking at my own code. I know what it does.
I can even tell you what bytes the compiler will lay down in memory.
I know the code is needed since the system fails if I remove it.

But I have no clue WHY I wrote it.

The person who wrote the code failed to communicate with the person
who maintains the code. I have the misfortune of being both people.

I understand the strong opposition to writing good documentation at any
level.  Especially when writing code; it just seems wasteful to state
the obvious. 

One non-obvious side effect of doing literate programming is that the
code quality improves a LOT. As Bill Hart said:

Another thing I've been enjoying lately is literate programming.
Amazingly it turns out to be faster to write a literate program
than an ordinary program because debugging takes almost no time.

I fear that we're going to have the same approach as the physicists.
New theories get accepted when the previous generation dies out.

Fortunately statistics show that programmers retire into management
at age 35 so we won't have to wait that long. If there is any justice,
the managers will have to hire noobs to maintain code they wrote so
they get to listen to the noobs trash talk about their code. :-)

Tim Daly



-- 
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, sourcemaps, and debugging info

2014-05-16 Thread Tim Visher
Seems worth a bug report/feature request to the Chrome Dev Tools team.

On Thu, May 15, 2014 at 11:45 PM, t x txrev...@gmail.com wrote:
 Hi,

 * background:

   * I have clojurescript + lein cljsbuild auto working perfectly fine.

   * I have source maps working (when I click on a file in Chrome, it
 jumps me to the corresponding *.cljs file)


 * problem I am facing:

   * I like to name my modules:

 foo/public.cljs
 foo/other-stuff.cljs

 bar/public.cljs
 bar/other-stuff.cljs

   Now, Chrome + clojurescript (not sure who is at fault) appears to
 display not the _full name_, but only the _last part of the pathname_,
 so I get a bunch of lines saying things like:

public.cljs:23
public.cljs:68

   and I have no idea whether it's foo/public.cljs or bar/public.cljs
 without clicking on it.


 * question:

   Is there anyway to get Chrome / clojurescript to display the full
 name of the *.cljs file rather than just the last part?

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


[did...@lrde.epita.fr: [clisp-list] [CfP] International Lisp Conference 2014, Aug. 14-17, Montreal]

2014-05-07 Thread Tim Daly

From: Didier Verna did...@lrde.epita.fr

   ILC 2014 - International Lisp Conference
  Lisp on the Move
 August 14-17 2014, University of Montreal, Montreal, Canada
  Sponsored by the Association of Lisp Users
   In cooperation with: ACM SIGPLAN
 http://www.international-lisp-conference.org

Scope:

Lisp is one of the greatest ideas from computer science and a
majorinfluence for almost all programming languages and for
allsufficiently complex software applications.

The International Lisp Conference is a forum for the discussion ofLisp
and, in particular, the design, implementation and application ofany of
the Lisp dialects.  We encourage everyone interested in Lisp
toparticipate.

We invite high quality submissions in all areas involving Lispdialects
and any other languages in the Lisp family, including, butnot limited
to, ACL2, AutoLisp, Clojure, Common Lisp, ECMAScript, Dylan, Emacs Lisp,
ISLISP, Racket, Scheme, SKILL, HOP etc.  The conference proceedings will
be published in the ACM Digital Library.

This year's focus will be directed towards integrated
solutions,including mobile computing. We especially invite submissions
in thefollowing areas:

  * Pervasive computing Interoperability Portability Implementation
  * challenges/tradeoffs for embedded/mobile platforms Language
  * support for mobile toolkits and frameworks Language support for 
  * distribution Language support for reliability, availability, and
  * serviceability Mobile IDEs Mobile applications

Contributions are also welcome in other areas, including but not limited
to:

  * Language design and implementation Language integration,
  * inter-operation and deployment Applications (especially commercial)
  * Reflection, meta-object protocols, meta-programming
  * Domain-specific languages Programming paradigms and environments
  * Efficient parallel and concurrent computation Language support for
  * managing both manual and automatic GC Theorem proving Scientific
  * computing Data mining Semantic web

Technical Programme:

Original submissions in all areas related to the conference themes are
invited for the following categories:

  Papers: Technical papers of up to 10 pages that describe original
  results.
  Demonstrations: Abstracts of up to 2 pages for demonstrations of
  tools, libraries and applications.
  Workshops: Abstracts of up to 2 pages for groups of people who
  intend to work on a focused topic for half a day.
  Tutorials: Abstracts of up to 2 pages for in-depth presentations
  about topics of special interest for 1 to 2 hours.
  Panel discussions: Abstracts of up to 2 pages for discussions
   about current themes. Panel discussion proposals must mention 
   panel member who are willing to partake in a discussion.

The conference will also provide slots for lightning talks, to be
registered on-site every day.

For inquiries about any other kind of participation (commercial
exhibits, advertising, prizes, book signing etc.), please see the
contacts below.

Important Dates:
 - May18, 2014: Submission deadline 
- June   09, 2014: Notification of acceptance 
- June   29, 2014: Final Papers due - August 14, 2014: Conference

All submissions should be formatted following the ACM SIGS guidelines
and include ACM classification categories and terms. For more
information on the submission guidelines and the ACM keywords, see:
http://www.acm.org/sigs/publications/proceedings-templates and
http://www.acm.org/about/class/1998.

Submissions should be uploaded to Easy Chair, at the following
address: https://www.easychair.org/conferences/?conf=ilc14

Organizing Committee:
General Chair:   Marc Feeley (Universitie de Montral, Montreal, Canada)
Programme Chair: Didier Verna (EPITA Research lab, Paris, France)
Local chair: Marc Feeley (Universitie de Montreal, Montreal, Canada)
Programme Committee:
Charlotte Herzeel, IMEC, ExaScience Life Lab, Belgium
Damir Cavar, Eastern Michigan University, USA
Dave Herman, Mozilla Research, USA
Greg Pfeil, Clozure Associates, USAIrone 
Anne Durand, LaBRI University of Bordeaux, France
Jim Newton, Cadence Design Systems, France
Kuroda Hisao, Mathematical Systems Inc., Japan
Matthew Might, University of Utah, USA
Nicolas Neuss, Friedrich Alexander Universitat, Germany
Ralf Meller, TUHH, Germany
Sam Tobin-Hochstadt, Northeastern University, USA
William Byrd, University of Utah, USA

Contacts:
  * General Questions: ilc14-organizing-committee at alu.org
  * Programme Committee: ilc14 at easychair.org

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

Re: Proposing a new Clojure documentation system (in Clojure)

2014-05-06 Thread Tim Daly
 Less trivial things that I would like to be able to do: 
  - transclude documentation from secondary files, so that the developer 
of a piece of code sees a short piece of documentation, while users 
of code can see something longer. 
  - expand the documentation system as I see fit; i.e. the documentation 
system should be designed to an abstraction, not an
  implementation. 

   - include diagrams and pictures
   It is easy to show the red-black tree rebalance algorithm
 with a few pictures whereas the words are rather opaque. 
 Stacks and immutable copy algorithms are also easy in diagrams.
 You CAN do this with ascii-art but it IS the late 90s and some
 lucky few of us have 640x480 color terminals.

Tim



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


Re: Proposing a new Clojure documentation system (in Clojure)

2014-05-06 Thread Tim Daly
 Compare Emacs Lisp, for example, which uses semi-structure
 in the comments to drive many of its features.

Speaking of Emacs, there are (at least) two doc systems available,
the emacs info system and org-mode. Both of those evolved due to
a need for a better documentation system. 

The claim has been made that what exists is all we need since, if
there was MORE we need then a doc system would arise. Several dozen
have arisen and are in use.

Wouldn't a gif of Rich's Ant system running make the whole point
of the code perfectly obvious? Wouldn't it be even better if, when
you changed the code, the gif updated to reflect the new change?
We have Clojurescript and browsers have a canvas element.

Given that I only have a 640x480 terminal I guess ascii ants would
be ok :-)


-- 
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: Proposing a new Clojure documentation system (in Clojure)

2014-05-06 Thread Tim Daly
Gregg,

 My original comment on litprog (bad bad bad) was admittedly a little
 strong.  I think its bad for some things, fine for others.  And it's
 possible litprog conventions will evolve to address the problems some of us
 see with using it for programming in the large etc.

Could you explain what some of the problems some of us see with using
it for programming in the large might be? It is hard to refute 
bad bad bad and other assertions without specific examples.

Axiom (1.2 million lines of lisp) is being rewritten into a literate
program. So far I can't think of a problem. Clojure is being reworked
into literate form already and I can't see a problem other than trying
to understand and explain code I didn't write (reading code is hard).

The Clojure community isn't ready to make the leap into a literate
world. I understand that. But Clojure is still at the stage of writing
new code for new uses. There are few people who need to modify code
written by programmers who left the community. That's when the need
will arise for clearly communicating ideas to other humans.

The technical debt has not come due ... but it will. 

Tim





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


Re: Proposing a new Clojure documentation system (in Clojure)

2014-05-06 Thread Tim Daly
 Adding complexity and weaving heapings of prose in amongst the code
 isn't going to make the developer that wrote the above rewrite it in a
 better way. You'll just end up with more bad documentation getting in
 the way of what the code actually does. Bad documentation is worse than
 no documentation. At least with no documentation, the code doesn't
 lie.

Bad documentation should have to leap the same hurdles as bad code.
Code review ought to be able to push back against bad documentation
just as easily as it screams at bad code. 

There is the famous WTFs per minute cartoon that can be applied to
documentation. Doing regular doc reviews might provide full employment
for English majors :-)

In fact, working on a WTF code review social process in Clojure might be
the most effective step toward better code and documentation overall.
Of course, this would have to be instituted by Rich and company since
they control the sources.

We could post code snippets (ref my prior post) which need explanation
and do a community documentation upgrade on the Clojure sources.

Tim

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


deep thinking

2014-05-04 Thread Tim Daly

==

Tim Daly[4] tries to find documentation criteria that include in-file
comments as well as higher level organization of needed information,
representing the extreme case.

  Consider Clojure's primary data structure implementation. It is
  basically an immutable, log32, red-black tree. For some people that is
  more than sufficient, especially if they have been working in the code
  base for years.
  
  For others, especially as a developer new to the project, there is a lot
  to know. Without this information it is very difficult to contribute.
  
  A new developer needs an introduction to the IDEA of immutable data
  structures with a reference to Okasaki's thesis which is online at
  http://www.cs.cmu.edu/~rwh/theses/okasaki.pdf (a bibliography).
  
  A new developer needs to know that the DESIGN of Clojure relies on these
  immutable data structures so they don't introduce any quick and
  efficient hacks that violate the design. (a Clojure overview)
  
  A new developer needs to know WHAT a red-black tree is, WHY it was
  chosen, and HOW Clojure maps user-visible data structures to them.  
  (the chapter on this particular data structure)
  
  A new developer needs to know the IMPLICATIONS of the choice of log32
  since it defines the efficiency. (the design constraints section and
  the algorithmic analysis section)
  
  A new developer needs to know HOW to update a log32 immutable red-black
  tree.  (a pseudocode explanation with pictures)
  
  A new developer needs to know HOW the log32 red-black tree is
  implemented.  It is not immediately obvious how the 5-bit chunks are
  mapped into a 32 bit word. If the task was to re-implement it on a 64
  bit word they'd have to know the details to understand the code.  (the
  actual code with explanations of the variables)
  
  If the new developer's task is to modify the code for a 64 bit
  architecture they would need a way to find the code (the table of
  contents) and places where this information is mentioned (an index). 
  All of the places where it is written need to be properly updated.
  
  Even if we focus strictly on what a new developer needs to know
  we end up with something that smells a lot like a book. From the
  above we see the need for 

  1) a bibliography
  2) a Clojure overview
  3) a chapter focus on this data structure
  4) sections on design constraints and algorithmic analysis
  5) a section of pseudocode with pictures
  6) a section with code and details of the actual implementation
  7) a table of contents
  8) an index


[0] Val Waeselynck clojure@googlegroups.com Wed, 30 Apr 2014 16:08:33 -0700 
(PDT)
[1] Steve McConnell Code Complete, Second Edition Microsoft Press,
Redmond, WA, USA, 2004
[2] Ronald M. Baecker and Aaron Marcus Human factors and typography
for more readable programs ACM, New York, NY, USA, 1989
[3] Simon Benjamin Orion Parent How Programmers Comment When They Think
Nobody's Watching Master's Thesis, University of Waterloo, Waterloo,
Ontario, Canada 2014
[4] Tim Daly clojure@googlegroups.com Wed Apr 30 03:09:05 2014


-- 
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: Proposing a new Clojure documentation system (in Clojure)

2014-04-30 Thread Tim Daly
 the skill to create
any technology we want. The problem is social. There needs to be a
focus on creating professional standards. We need to raise the bar
of what we expect as world-class professional programmers.

Tim Daly

-- 
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: Clojure Office Hours

2014-04-30 Thread Tim Visher
This is getting to the point where it seems to make sense as a wiki
page like http://dev.clojure.org/display/community/Clojure+User+Groups

Maybe http://dev.clojure.org/display/community/Clojure+Office+Hours ?

On Tue, Apr 29, 2014 at 5:53 PM, Lynn Grogan l...@thinkrelevance.com wrote:
 This is awesome, thank you Leif!

 I just set up an office hours account to help anyone who might be interested
 in organizing a Clojure tech conference or event, Meetup, etc.
 I chose some random office times, so ping me if you have a special timing
 request outside of the listed hours.

 https://lynn.youcanbook.me/

 Cheers! Lynn Grogan (Cognitect, Events Manager)

 On Monday, April 28, 2014 5:31:04 AM UTC-5, Ulises wrote:

 Thanks for the pointer Jakob. I've updated the form accordingly.

 Cheers,


 On 28 April 2014 10:56, Jakub Holy jakub...@iterate.no wrote:

 I too have booked a session with Ulises and am excited about it :-)

 @Ulises It would be nice if the timezone of the session was mentioned on
 the booking page (your [BST] 9-10am is mine [CEST] 10-11, I believe).


 2014-04-28 11:09 GMT+02:00 Rudi Engelbrecht rudi.eng...@gmail.com:

 Hi Ulises

 Just finished our session - wow!

 I have learned a lot by watching how you approach solving the problem I
 suggested.

 Looking forward to our next session and thanks a lot for sharing your
 knowledge.

 Kind regards

 Rudi Engelbrecht



 On 18/04/2014, at 7:41 PM, Ulises ulises@gmail.com wrote:

 Yikes! Got my first booking for Monday. That was quick!

 one thing I forgot to mention is that I have no preferred way to do
 this. I personally have emacs+cider set up, but I'm happy to work with your
 own set up.

 In the past I've used ScreenHero (not available for Linux unfortunately)
 for screen sharing, as well as Google hangouts.

 Once you've booked an appointment with me please email me privately to
 arrange the pairing set up so that I can be ready for you :)

 Cheers


 On 18 April 2014 10:35, Ulises ulises@gmail.com wrote:

 Inspired by Leif's offer, I've decided to offer Clojure office hours as
 well.

 I'm based in the UK so I reckon the times will be more amenable to
 those in Europe (not sure the times will be good for those in Asia
 unfortunately.)

 Sadly the offer is limited to 1h a day, but hopefully it'll still be
 useful.

 You can book me at https://ucb.youcanbook.me/

 Cheers!


 On 18 April 2014 03:03, Leif leif.p...@gmail.com wrote:

 @Miguel: There are somewhat subtle arrows on the sides for navigation.
 Thursday, April 24 is still open.  I will give a slot to you if you want
 one, just email me if the 24th is full when you check again.

 @all: But yes, this round of office hours is almost over.  I will be
 in transit for at least a couple weeks in the beginning of May, but I 
 will
 probably book some more hours when I become stationary again.  It will
 probably be more like 4 or 5 hours a week, though, not 8.

 @all: Several poor souls from Europe are going to stay up until 2 a.m.
 for this, and people further east are probably just silent because the 
 time
 difference is so large; So, I definitely think some European / African /
 Asian / Australian clojure devs' office hours would be popular.  It's 
 fun,
 and you might find some people to hire, if that's your thing!

 --Leif


 On Thursday, April 17, 2014 10:43:50 AM UTC-4, Miguel Ping wrote:

 Hey, the schedule's full! :\

 On Wednesday, April 16, 2014 2:57:49 AM UTC+1, Marcus Blankenship
 wrote:

 Leif, thanks for the great session today.  Not only did I get a jump
 start on my next 4Clojure problems, but I learned some emacs as well!  
 Very
 enjoyable, and I look forward to next week’s session.  THANK YOU!

 All, if you’re trying to get a jumpstart on Clojure, I highly
 recommend Leif’s office hours.

 -Marcus

 On Apr 15, 2014, at 6:50 PM, Leif leif.p...@gmail.com wrote:

 @Jakub: Thanks for your kind words.  I'm definitely no industry
 hero, but I hope Clojure devs of all levels start having more pair
 programming fun.

 @Tim: Clojurescript UI programming being way out of my comfort zone,
 I learned quite a lot from you yesterday.  So thank you.

 @Everyone:  To clarify / reiterate:  You do not need a plan, a
 project, or a specific problem.  If you want to work through Project 
 Euler,
 4clojure, clojure-koans, the ClojureBridge materials, some other 
 clojure
 tutorial, or just play it by ear, I am happy to try it out.

 --Leif

 On Tuesday, April 15, 2014 8:00:17 AM UTC-4, frye wrote:

 I just came from an office hours session, yesterday with Leif.

 This is good stuff guys, and a great way to learn and meet with
 other developers. Highly recommended.


 Thanks Leif

 Tim Washington
 Interruptsoftware.com


 On Tue, Apr 15, 2014 at 5:12 AM, Jakub Holy jakub...@iterate.no
 wrote:

 Hi Leif,

 This is a great activity, thank you for contributing to the
 community this way!

 Do not be surprise and discouraged by the fact that the interest
 seems low. I have a similar

Re: testing clojure.core/group-by with clojure.test.check

2014-04-30 Thread Tim Visher
As an aside to the discussion at hand, what papers/books/online
articles are good to read to learn about how to come up with good
properties and generators?

On Wed, Apr 30, 2014 at 3:36 PM, Alex Miller a...@puredanger.com wrote:
 The only hard parts about property based testing are the properties and the
 generators. ;)

 On Wednesday, April 30, 2014 6:38:19 AM UTC-5, henry w wrote:

 Hi, I wanted to get started with clojure.test.check (formerly
 simple-check) and I am new to property based testing.

 I plucked clojure.core/group-by for no particular reason as a function to
 test.

 I started by stating some properties i think should hold:

 ;; 1. applying the grouping key function to each member in a grouping
 should result in the grouping key
 ;; 2. flattening the vals of the group-by result should give back the
 contents of the original collection.
 ;; 3. no element appears in more than one grouping.


 those seem good



 so far so good I think. there may be others but this seems ok for now.

 now, how to generate some data.

 for group-by we need two params:
 1) a grouping function
 2) a collection of items to be grouped

 If I start by naively generating collections of maps (containing keyword
 keys and int vals, for example), the data is of the right shape to use in
 group by, but there is no guarantee that:
 1) any of the maps share a key that I could use for grouping
 2) the values under a common key are shared

 This is really the crux of my problem ideally I would have the
 generator *mostly* produce data which is actually doing to result in the
 sort of collection i might want to call group-by on in real life (ie not
 have everything grouped under nil on each generation). So should i create a
 generator that creates keywords (which i will want to use as grouping
 function) then have another generator that produces what are going to be the
 values under this grouping key, then a generator that uses both of these to
 create collections of maps from these. then i would have to find out what
 the grouping keyword was that was generated this could all work, I have
 read enough about generators to have a stab at this... but is it the right
 approach?


 You don't seem to be leveraging the possibilities of the grouping function.
 If you create a grouping function that maps many random values into a small
 number of groups, then everything may get easier. Some candidate functions:
 first character of the keyword, length of the keyword, etc.

 Or working backwards is often useful with a generator - generate the
 grouping values first, then use the inverse of the grouping function to
 generate data that maps to that group and populate the input with that.



 as far as implementing tests for the properties so far, I have done
 property 2 above, using a basic generator and yanking out an arbitrary key
 from it clearly a flawed approach as not much 'realistic' grouping is
 going to happen here.

 (def vector-of-maps (gen/such-that not-empty (gen/vector (gen/such-that
 not-empty (gen/map gen/keyword gen/int)

 (def all-elements-are-grouped
   (prop/for-all [group-by-input vector-of-maps]
 (let [a-map-key (- group-by-input first keys first)] ;;
 hmm, seems far from ideal
   (= (set group-by-input) (- (group-by a-map-key
 group-by-input) vals flatten set)

 help appreciated... perhaps I need to learn more about the paradigm first,
 but resources linked from the readme are all a bit more basic than this. so
 if you know of some more advanced tutorials please let me know.

 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/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: Proposing a new Clojure documentation system (in Clojure)

2014-04-29 Thread Tim Daly
Phil,

 I like the general idea of the Valentin's proposal, but I don't
 understand every bit of it.  It sounds complicated.  Personally, I'd
 rather see something that's relatively simple, and good enough, than
 something that's perfect but unwieldy.  If it's too difficult, people
 won't use it, or they'll waste time, or feel that the Clojure
 community expects them to spend too much time on something that
 detracts from what's important.

Can I ask, quite seriously and not intending any sarcasm, what you mean
by detracts from what's important? 

For me, what's important is to communicate ideas, designs, and details
from one developer to another so that others can maintain, modify, and
extend what exists. I've already held forth on what I think that implies
so I won't bore you with it.

What I don't understand is your criteria for what's important and 
how that translates to action.

If we can agree on what's important then the technical details would
have common criteria for simple and good enough vs something that's
perfect but unwieldy.

Tim Daly


-- 
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: braveclojure problem ( paste into emacs)

2014-04-16 Thread Tim Visher
On Wed, Apr 16, 2014 at 6:57 AM, Roelof Wobben rwob...@hotmail.com wrote:
 I try to learn coljure by using this tutorial: http://www.braveclojure.com
 Im now at point 7 : http://www.braveclojure.com/basic-emacs/

 There I must paste a text into emacs.

 But as far as I know there is no mentioned how I can paste text into emacs.

How you paste text into emacs is somewhat dependent on your
configuration. Can you give more details as to your system
configuration and emacs version?

For instance, I'm on OS X using console Emacs 24.3 and the way I tend
to 'paste' things into emacs is by `C-u M-! pbpaste`.

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
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: auto include a certain line in all *.cljs files

2014-04-14 Thread Tim Visher
Hi t,

On Sun, Apr 13, 2014 at 3:18 PM, t x txrev...@gmail.com wrote:
 What does 
 https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L209-L211
 mean ?

 In particular, I'm confused about:

 Forms to prepend to every form that is evaluated inside your project.

 I only want to insert it right into the (ns ...) clause.

 Thanks!

The ns macro is only one way to require a namespace.

The way :injections works (at least the way it appears to work, I've
never personally used it) is by allowing you to use the alternate
means of requiring another namespace which is programmatically.

In other words you can have a `(:require …)` section in your `ns`
macro, or you could simply have a regular `(require '…)` form in your
source.

So the real question becomes if there is a programmatic call you can
make to `(require-macros …)`, which from brief googling appears not to
be the case.

If the answer to that is no then I would say to look into the
templating features of your editor to facilitate easily adding it in.

As a stylistic note, the more magical you make your source files, the
harder they are to understand going forward. People are used to seeing
all the symbols they might encounter in the source file listed in the
`ns` macro. Violating that might be expedient, but it's probably not
good style. In this instance, I'd swallow the repetition for the sake
of clarity.

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
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: Logo usage

2014-04-09 Thread Tim Visher
On Wed, Apr 9, 2014 at 4:06 PM, Plínio Balduino pbaldu...@gmail.com wrote:

 Hi there

 Is there any restriction about the usage of Clojure logo in magazines,
 books and printed materials?


Yes. You must get permission from Tom Hickey, I believe, who listens on
this list (or at least used to).

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
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: Any experience with Cognitect?

2014-04-09 Thread Tim Visher



On Wed, Apr 9, 2014 at 4:47 PM, Mike Haney txmikes...@gmail.com wrote:

 Thanks for the feedback.

 Resume updated - check
 Cover letter written - check
 Email sent - check
 Ego intact - pending

 --
 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/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: Any experience with Cognitect?

2014-04-08 Thread Tim Visher
On Tue, Apr 8, 2014 at 12:56 PM, Mike Haney txmikes...@gmail.com wrote:
 Cognitect (and previously Relevance) always seem to have openings for
 contract Clojure developers.  I was wondering if anyone here has applied for
 and/or actually been hired for one of these positions, and was willing to
 share their experience?

 I have thought about the possibility of being a contractor for Cognitect for
 awhile, and it's been pretty much my target goal as I've been learning
 Clojure/Datomic over the last 8-9 months.  The bar seems pretty high - I
 mean, do you have to be a Mike Fogus or Tim Baldridge to work there?

 My current contract is winding up soon, and my Clojure skills are at the
 point where I think I am almost productive enough to use it professionally
 (IMO you have to actually USE something professionally to reach that last
 level of productivity, which is why I said almost).  This would be an ideal
 time to make the switch, but I don't want to apply too soon and ruin my
 chances.

 One other question - for anyone who has worked as a contractor for them, was
 there usually/always enough work to keep you busy full time, or would I need
 to plan on doing other freelance work to fill in the gaps between
 assignments for them?

Fortune favors the brave, the worst they can do is say no. :)

I did apply, feeling woefully under-prepared, and had some really nice
conversations with them. I'd still love to work with them some day,
but it turned out that the uncertainty of contracting was just too
much for me to stomach.

Do it!

:)

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

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

2014-04-01 Thread Tim Visher
Hi David,

On Tue, Apr 1, 2014 at 2:38 PM, David Nolen dnolen.li...@gmail.com wrote:
 ClojureScript, the Clojure compiler that emits JavaScript source code.

 New release version: 0.0-2199

 The only difference is the removal of spurious warnings about
 required/imported Google Closure libraries.

As always, thanks for all the hard work!

AFAICT, I'm still getting these warnings when using lein-cljsbuild
1.0.3, clojurescript 0.0-2199, and clojure 1.6.0. Are there extra
flags I need to set to avoid them? They happen under whitespace and
advanced.

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
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: Unexpected core.async timeout behaviour

2014-03-28 Thread Tim Visher
Hi Peter,

On Fri, Mar 28, 2014 at 2:48 AM, Peter Taoussanis ptaoussa...@gmail.com wrote:
 Hi all, quick question:

 `(dotimes [_ 5] (go (! (async/timeout 100` runs as expected.
 `(dotimes [_ 5] (go (! (async/timeout (+ 50 (rand-int 100))`
 produces an error:

 ( (.size takes) impl/MAX-QUEUE-SIZE) java.lang.AssertionError: Assert
 failed: No more than 1024 pending takes are allowed on a single channel.

 It appears (?) that there's a (surprisingly low?) limit to the number of
 unique timeout timestamps that can be simultaneously queued.

 Is this the expected behaviour running Clojure 1.6.0, core.async
 0.1.278.0-76b25b-alpha?

 Much appreciated, thanks! Cheers :-)

I _still_ have no personal experience with core.async ( :((( ), but I
did spot this message coming through recently which answers your
question with 'yes' I believe.

https://groups.google.com/forum/#!searchin/clojure/1024/clojure/NIPIzJ7l6RA/Idm1_2GMlCMJ

It sounds like you need to use a different kind of channel buffer
(whatever that means :).

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
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: Unexpected core.async timeout behaviour

2014-03-28 Thread Tim Visher
On Fri, Mar 28, 2014 at 8:08 AM, Peter Taoussanis ptaoussa...@gmail.com wrote:
 Hi Tim, thanks for the info!

 It's not clear to me that this is the same issue, unfortunately. (Though I
 may be missing something obvious).

 In the example I've provided above, we're actually creating a _new_ channel
 for each take. The problem appears to be either some interaction between the
 loop and core.async that I'm not aware of, or something on the
 _implementation-end_ that is bumping up against the referenced issue (i.e.
 an insufficiently-buffered channel somewhere).

 So there's actually no channel here that I could be buffering, since it's
 not my channel that's overflowing. Again, modulo me missing something
 obvious :-)

 Does that make sense?

Ah, forgive me for not seeing the subtlety and getting excited about
being able to help in some small way on a core.async problem. :)

Can one of the adults chime in?

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
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: generators...?

2014-03-27 Thread Tim
I'm fairly new to Clojure and this was a fun little exercise to try.

(def color-map (reduce #(assoc % (count %) %2) {} [:red :yellow :blue 
:green :purple]))

color-map
= {4 :purple, 3 :green, 2 :blue, 1 :yellow, 0 :red}

(defn random-repeating-map
  ([coll-map] (random-repeating-map coll-map coll-map))
  ([coll-map new-coll-map]
   (if (seq new-coll-map)
 (let [ key-vec (into [] (keys new-coll-map))
idx-key (key-vec (rand-int (count key-vec)))]
   (cons (new-coll-map idx-key)
   (lazy-seq (random-repeating-map coll-map (dissoc new-coll-map 
idx-key) (random-repeating-map coll-map

(take 20 (random-repeating-map color-map))
= (:blue :purple :yellow :red :green :purple :blue :red :yellow :green 
:red :purple :yellow :green :blue :green :blue :yellow :red :purple)

Step 4: Profit

On Wednesday, March 26, 2014 1:10:12 PM UTC-7, Gary Trakhman wrote:

 true, he did say 'or something that would be as useful', but lazy-seqs 
 are more useful :-).


 On Wed, Mar 26, 2014 at 4:08 PM, Ben Wolfson wol...@gmail.comjavascript:
  wrote:

 cycle isn't really the same thing, though, at least if the OP really 
 does require (for some reason) something that can be called repeatedly and 
 get a different answer each time.
  

 On Wed, Mar 26, 2014 at 1:05 PM, Gary Trakhman 
 gary.t...@gmail.comjavascript:
  wrote:

 cycle - http://clojuredocs.org/clojure_core/clojure.core/cycle

 And generally, this class of functionality is called lazy-seqs.


 On Wed, Mar 26, 2014 at 3:59 PM, Christopher Howard 
 cmho...@alaska.edujavascript:
  wrote:

 Hi. I'm still fairly new to Clojure. I was wondering: What's the
 easiest way to make a generator (or something that would be as useful).
 In one application, I need something that will return a different color
 each time I call it - following a predefined list of colors, and
 starting over again at the beginning when colors are exhausted.

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.comjavascript:
 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 javascript:
 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 javascript:.
 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 clo...@googlegroups.comjavascript:
 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 javascript:
 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 javascript:.
 For more options, visit https://groups.google.com/d/optout.




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

  -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.comjavascript:
 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 javascript:
 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 javascript:.
 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 

Re: anyone in Santa Cruz?

2014-03-27 Thread Tim
Yes, please!

On Thursday, March 27, 2014 10:21:32 AM UTC-7, Brian Craft wrote:

 Looking for clojure users in the Santa Cruz, Ca area who are interested in 
 a meetup, study group, etc.


-- 
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: How should I begin this project?

2014-03-24 Thread Tim Visher
On Thu, Mar 20, 2014 at 1:43 PM, kurofune jesseluisd...@gmail.com wrote:
 Thank you very much for both of those emails Gary. Your programming advice 
 rang very true and doodle does look almost exactly like what I need. I'll 
 look into that and google calendar, but now I need a good project to work on! 
 How does one go about getting mentored in Clojure? Is that even a thing?

The mailing list and IRC channels are _amazing_ resources in this
community. Pick something and start lurking! :)

I've also heard really good things lately about exercism.io, though I
have no personal experience with it. http://exercism.io/

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
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: How should I begin this project?

2014-03-24 Thread Tim Visher
On Mon, Mar 24, 2014 at 12:49 PM, Aditya Athalye
aditya.atha...@gmail.com wrote:
 Thanks for the lead on exercism.io, Tim.

 I just set it up, to peek at how it looks/works.

 The setup itself was a breeze, and the very first exercise is
 a nice little text processing problem. (Based on Deaf Grandma,
 found here: http://pine.fm/LearnToProgram/?Chapter=06)

 Feels like a good follow-on to the medium difficulty level on 4clojure,
 and to Clojure Koans.

 Cool!

Great!

To me, the coolest part of exercism.io is that a real peer reviews your code.

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
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: How should I begin this project?

2014-03-20 Thread Tim Visher
I would just use Google Calendar for that.

On Thu, Mar 20, 2014 at 3:53 AM, kurofune jesseluisd...@gmail.com wrote:

 At my job, I have to meet clients multiple times a week and schedule
 appointments with them at various places around town. Recently, I have seen
 a boom in business and while this is very fortunate it has made scheduling
 tedious. Lamenting this fact, it dawned on me that I might be able to make a
 web-application that tells me if there are any scheduling asymmetries
 between me and my clients. I am thinking of something with a front page like
 this:

 | myself:
 | other-person:
 | appointment-time:
 | location:

 Both parties would enter the appropriate information on separate devices or
 desktops. The information would be pushed to a database, new users would be
 automatically added. A scan will be made at intervals to find mismatched
 appointments, the asymmetry logged and a notice sent out to one or both of
 the users, suggesting they reconfirm the appointment. Well aligned
 appointments will have green status; mis-aligned ones, red, both viewable
 via a monitoring screen that updates automatically. Of course, there might
 be other functionality that I will want to add in later: login/security,
 aesthetics, customized behavior for appointments with multiple users and
 clear distinctions between business and client. In the beginning, however, I
 just want to breathe a little easier knowing that my appointments are
 sorted, something that simple calendar apps cannot do.

 I am relatively new to both Clojure and programming, but have managed to get
 myself to a point where I can make websites that include functionality and
 rendering. I have done a few tutorials utilizing databases (Datomic, jdbc,
 postgresql), read a handful of books, and completed a lot of tutorials. I
 still feel, however, that I don't know how to tie everything I have learned
 together to tackle larger tasks that require complexity management. I don't
 really know where to start, and would be grateful if someone could give me
 advice in terms of what technologies I should use and how I should organize
 the project. Should I use Clojures built in state management features  and
 jdbc/postgresql or view this as an opportunity to dip into Datomic and
 core.async. I am excited about making something that utilizes all of
 Clojure's technologies that other people can use and learn from, but is it
 possible to go too far down the Clojure rabbit-hole? Also, if this type of
 web-app already exists and you happen to have heard of it, please tell me
 and I will be happy to use it instead of having to make it from scratch.

 Jesse

 --
 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/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: Clojure 1.6.0-RC1 - LAST CHANCE, PLEASE TEST

2014-03-20 Thread Tim McCormack
On Wednesday, March 19, 2014 4:14:38 PM UTC-4, Alex Miller wrote:
 Rich just pushed a change to the String hashing to address this. We're 
going to grab the string hashcode (which is cached after first call) and 
murmur the result of that. This gives us constant time hashcode after first 
call with better distribution for combinations in nested collections. Will 
be in presumed RC2.

(Discussion continued from IRC and Github.)

This does make PHM vulnerable to hashDoS attacks again -- [AaAa  
AaBB BBAa] will all hash to the same value, so an attacker can pass a 
ton of these colliding strings to a webapp as a querystring or POST body 
and really bog down the machine. Best article I could find on this attack: 
http://cryptanalysis.eu/blog/2011/12/28/effective-dos-attacks-against-web-application-plattforms-hashdos/

Is there some compromise we can make between caching and good hashing?

My naïve thought would be to combine the native String hashCode with a 
Murmur hash of a fixed chunk of the string, then possibly run that 
combination through Murmur. This avoids hashing unbounded data more than 
once, and would be effective against basic hashDoS. (Intelligently picking 
the fixed chunk of the string would be essential for protecting against an 
adaptive hashDoS attack.)

 - Tim McCormack

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


Kibit output

2014-03-19 Thread Tim Terry
Hi, is it possible to output kibit code analysis results into a file? My 
aim is to publish this file with a CI tool such as teamcity/ jenkins.

Thanks,

Tim

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


Re: Image processing

2014-02-28 Thread Tim Visher
I assume you're referring to https://github.com/neatonk/im4clj ?

On Thu, Feb 27, 2014 at 10:24 PM, exel...@gmail.com exel...@gmail.com wrote:
 Hi Michael,

 Got some good results on img processing tests. I got image resizer working 
 nice, it was a resource path issue.

 However after some side by side testing with graphicmagick, I found imgscalr 
 outputs files at a 30% to 50% larger file size. About 30% on larger 
 dimensions, 50% on thumbnails.

 So I've opted for graphicmagick as it processes faster, same quality, much 
 smaller static files and v elegant syntax, I've been using it in ruby and 
 coldfusion for years. One other thing is it bypasses java, does the buffering 
 internally.

 If you have an image processing use case, hope that's helpful for anyone 
 going so far as a cdn to scale static assets. Here's a couple syntax examples:

 ;resize to 300 proportionally
 (convert photofile
   (-antialias)
   (-resize 300 300)
   (str (img-path) /lg_ new-file-name))

 ; resize to 150 proportionally then crop to a 150 square
 (convert photofile
   (-antialias)
   (-resize 150 150)
   (-gravity Center)
   (-extent 100 100) photofile)

 photofile is resource path and file name. I'll check into clojure-docs, see 
 if I can help out on the web dev section based on my experience last few 
 weeks.

 Best,
 Pardeep.

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

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


Re: Image processing

2014-02-28 Thread Tim Visher
The main disadvantage with this, of course, being requiring
imagemagick on the command line.

On Fri, Feb 28, 2014 at 2:51 PM, The Dude (Abides) exel...@gmail.com wrote:
 Yes via im4clj - https://github.com/neatonk/im4clj

 [im4clj 0.0.1]

 The developer recommends shell scripting with Conch with standard command
 line syntax, however im4clj works perfectly fine for 2 core needs for photo
 gallery apps:

 1. resize with proportions, and
 2. crop thumbnails from center

 If shell scripting is preferred, here's the command line version of resize 
 crop from center:

 gm convert in_path_and_file  -antialias -resize '150x150' -gravity center
 -extent 100x100 out_path_and_file



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

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


Re: Helping newcomers get involved in Clojure projects

2014-01-27 Thread Tim Visher
On Sat, Jan 25, 2014 at 1:54 PM, Bridget bridget.hill...@gmail.com wrote:
 OpenHatch has this great initiative for encouraging newcomers to get
 involved with open source projects. You tag some issues in your bug tracker
 as newcomer or easy. This provides a gentle path into contributing.
 There is some work involved with this. You have to do the tagging, and there
 needs to be some capacity in your project for some mentoring.

 Leiningen is doing this already with newbie tagged issues, which is
 awesome.

 Are there any other Clojure projects that are doing this? Would you like to
 do this with your project? If so, I can try to help. I have been spending a
 lot of time thinking about the Clojure newcomer perspective lately, and I'd
 like to work on some things that help smooth that path.

This is a great idea!

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

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


Re: ClojureScript integration with Emacs/Cider ?

2014-01-06 Thread Tim Visher
Hi Alexandru,

On Sun, Jan 5, 2014 at 3:30 PM, Alexandru Nedelcu a...@bionicspirit.com wrote:
 I can’t get auto-completion or jumping to the definition of a function in
 Emacs, while working with ClojureScript. Is this a limitation of Emacs’
 Cider plugin?

IIUC, completing et al does not work for ClojureScript because
ClojureScript, not because of tooling. I have no idea how or if
development towards that end is going, but I believe it has something
to do with limitations of the host language which does not get my
hopes up.

If someone else knows better, please correct me, because I miss it too!

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

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


Re: ClojureScript integration with Emacs/Cider ?

2014-01-06 Thread Tim Visher
On Mon, Jan 6, 2014 at 3:01 PM, David Nolen dnolen.li...@gmail.com wrote:
 Limitation of tooling. ClojureScript analyzer exposes the necessary
 information.

That is seriously great to hear. I had no idea we were that far along.

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
-- 
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: Require namespace

2014-01-05 Thread Tim Visher
Hi juanghui,

If you're working out your stuff, more power to you, but I do want to
say that you sound quite far off the beaten path of Clojure usage, so
just be aware that you may be accomplishing your goal in a
non-standard, hard to support way. :)

On Sat, Jan 4, 2014 at 6:12 AM, jianghui jianghui8...@gmail.com wrote:
 Hi,Thank you so much ;)
 I use load-file at last and it works.


 2014/1/3 Gary Trakhman gary.trakh...@gmail.com

 There's a reasonable blog post here on the matter:
 http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html

 It's a bit complicated to regurgitate it all in a mailing list response
 :-).


 On Thu, Jan 2, 2014 at 8:33 AM, jianghui8...@gmail.com wrote:


 Hi,

 I am a newbie of Clojure.I have some confusions of "how to require a
 namespace".

 1、If I want to call a function of file B.clj  in the file A.clj,does I
 have to require the namespace of B.clj in A.clj?

 2、In the file A.clj,if I need to call the functions of all *.clj in the
 special directory,how to require the namespace of *.clj dynamically?

 Happy New Year!
 Thanks in advance!

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


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


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

-- 
-- 
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: Recommendations for a project with learning-friendly bugs and devs?

2013-12-28 Thread Tim Visher
Leiningen as well. :)

On Fri, Dec 27, 2013 at 1:53 PM, Jakub Holy jakub.h...@iterate.no wrote:
 Hello,

 I'd like to sharpen my Clojure skill by contributing to an open source
 project and getting feedback on my patches from its developers. Can you
 recommend a project that would be suitable? Preferably something where there
 is plenty of beginner-friendly bugs and in the domain of web or devops.

 Thanks a lot and happy new year!


 Best regards, Jakub
 --
 Forget software. Strive to make an impact, deliver a valuable change.

 (Vær så snill og hjelp meg med å forbedre norsken min – skriftlig og
 muntlig. Takk!)

 Jakub Holy
 Solutions Engineer | +47 966 23 666
 Iterate AS | www.iterate.no
 The Lean Software Development Consultancy
 - http://theholyjava.wordpress.com/ -

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

-- 
-- 
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: Akka-like framework in Clojure ?

2013-12-27 Thread Tim Visher
Hi Eric,

On Fri, Dec 27, 2013 at 3:54 AM, Eric Le Goff eleg...@gmail.com wrote:
 After a long background with imperative languages such as Java, I recently
 spent some time learning functionnal programming, starting with Scala. I had
 the opporrtunity to build a demo project based on the Akka framework.

 Now I am starting learning Clojure, and would be curious to know if there
 was some clojure based framework available which could implement rather
 similar features to Akka.

I know of no such library for Clojure specifically (although I did not
look and have never needed to), but it appears that Akka is a Java
library, so worst comes to worst you could use it via [interop][1].

[1]: http://clojure.org/java_interop

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
-- 
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: Finding available methods or docs for a value type

2013-12-27 Thread Tim Visher
On Fri, Dec 27, 2013 at 6:27 AM, Niels van Klaveren
niels.vanklave...@gmail.com wrote:
 Anthony Grimes made a find-fn that finds functions based on input parameters
 and output functions.

 So something like (find-fn clojure.core [1 2] {:a 1 :b 2}) would return vals
 and (find-fn clojure.core [:a :b] {:a 1 :b 2}) would return keys.

 It would be great if we would have an online version that could do that. The
 biggest problem would be how to specify which namespaces (from clojars
 available libraries ?) you'd want to have searched.

That's the one! :)

Someone also put together a hosted version if you're looking to just
try it out.

http://findfn.herokuapp.com/

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
-- 
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: Finding available methods or docs for a value type

2013-12-24 Thread Tim Visher
My searching is failing, but I remember someone publishing a library
here that was meant to do exactly that. I can't remember if it was
based on arity or on fuzzing or whatever but IRRC it would do the sort
of thing you're asking for.

Hope someone else can use search better than me or have a better memory. :)

On Tue, Dec 24, 2013 at 8:58 AM, John Kida jdk...@gmail.com wrote:
 So i am very new to Clojure and I am wondering if there are any good
 techniques to finding available methods that will take a particular value. I
 understand this is probably very hard to do or even impossible being Clojure
 is a dynamic language and a lisp but for example.

 Lets say i have a simple map data structure. Being new to Clojure i just
 start fiddling with the REPL, and try:
 (keys my-hmap)
 cool, got the keys from my map back.

 Now how about values
 (values my-hmap)

 nope. wrong method name..  I was able to quickly find it in the Clojure Data
 Structures documentation, where it had a few method names for examining a
 Map, and linked me to the Clojure Core API, is this something I should
 probably go through start to finish, so I have a good idea of what is
 available.

 Or is there some technique I can use in the repl to tell me what methods are
 available to work with this particular datastructure.. that sounds not
 possible due to the dynamic lisp nature of clojure, but I wanted to ask the
 community to see if there were some good strategies to learning and finding
 available methods to work with a particular value.

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

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


Re: library development

2013-12-20 Thread Tim Visher
Maybe using lein checkouts is also something that would interest you?

https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#checkout-dependencies

On Fri, Dec 20, 2013 at 9:22 AM, Daniel Higginbotham
nonrecurs...@gmail.com wrote:
 lein install actually installs your library ~/.m2/repository in addition
 to creating the pom and jar. That should be all you need to do.


 On Friday, December 20, 2013 9:09:32 AM UTC-5, Bob Hutchison wrote:

 Hi,

 I’m missing something. And it’s annoying me.

 Let’s say I’m working on three or four projects and there’s some code that
 really should be developed as a library and used by each of the projects. A
 similar thing happens if I fork a library from github. I don’t want to make
 any of this code public so clojars is not an option. It’s clear enough that
 the solution to this will involve a local maven repository somehow.

 Now, I don’t know maven. I like it that way. I *do* *not* want to know
 maven. It’s so low on my priority list that reviewing the new C++ standard
 is higher. Basically it’ll never get to the top of the list.

 Furthermore I think requiring someone to know maven to do any non-trivial
 Clojure development is a bad plan. This is surely one of the founding goals
 of Leiningen.

 I’ve found some documentation and blog posts that, as soon as they get
 interesting, pretty much all end up assuming you know maven. I’ve found
 lein-localrepo plugin, which is was hopeful until you read it’s docs and see
 that it describes itself in maven terminology (why do I care what the maven
 coordinates of a file are? *WHY* do I have to know? Is this about Clojure or
 Java jar files? Are they different?)

 Lein install makes a jar file and a pom file. So what? Is there something
 you do with these? There must be. But since I don’t know maven I’ve not got
 a clue what that might be.

 What I’d like to do is type something no more complex than “lein
 local-install” and be done with it. I do not care if every developer on my
 team has to execute that command. I don’t care about sharing. I don’t care
 about naming. I just want to work on my library, install it, and use it in
 my other four projects.

 Running “cp -r” will do it, but it’s a bit crude.

 Thanks,
 Bob

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

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


Re: library development

2013-12-20 Thread Tim Visher
On Fri, Dec 20, 2013 at 12:16 PM, John Gabriele jmg3...@gmail.com wrote:
 If I can just `lein install` my libs (or other people's libs) and then use
 them in all my projects (just like the libs found at clojars), what extra
 functionality does lein-localrepo provide beyond that?

lein-localrepo provides ways to interact with the local repo beyond
just installing a leiningen project to it. You can install arbitrary
artifacts that have poms. You can use to grab coords for a file. Etc.

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
-- 
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: require library from inside the REPL

2013-12-18 Thread Tim Visher
You have a `'` in your ns macro that shouldn't be there.

You're ns form should be:

```
(ns theshire.models.element
  (:require [clojurewerkz.welle.core :as wc]
[clojurewerkz.welle.buckets :as wb]
[clojurewerkz.welle.kv :as kv]
[ring.util.codec :refer [url-encode]]))
```

There's nothing technically wrong with the `use` section, but it's
discouraged at this point.

On Wed, Dec 18, 2013 at 9:28 AM, Nicholas Wieland n...@nofeed.org wrote:
 Damn, you are right :)
 Still, it's no good, and I don't understand why...

 user= (require '[theshire.models.element :as model])

 Exception lib names inside prefix lists must not contain periods
 clojure.core/load-lib (core.clj:5359)


   ngw




 On Wed, Dec 18, 2013 at 3:21 PM, Thomas Heller th.hel...@gmail.com wrote:

 The (:require ...) form is specific to the (ns) macro, in the REPL you'd
 invoke the require function directly.

 (require '[theshire.models.element :as model])

 HTH,
 /thomas


 On Wednesday, December 18, 2013 3:14:14 PM UTC+1, Nicholas Wieland wrote:

 https://gist.github.com/ngw/f8ef003532c8d712dd9b

 I'm having troubles using the create function from inside the REPL.

 I think I should require it directly without defining a ns, right?

 user= (:require [theshire.models.element :as model])

 CompilerException java.lang.ClassNotFoundException:
 theshire.models.element,
 compiling/private/var/folders/r_/8jpc8nbx6x1g6gq3r1djmr90gp/T/form-init3432138121469073363.clj:1:1)

 what am I doing wrong?


 TIA,

   ngw

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


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

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


Re: [ClojureScript] Re: [ANN] cljs-start 0.0.7 now support source-map

2013-12-17 Thread Tim Visher
On Tue, Dec 17, 2013 at 5:48 AM, Mimmo Cosenza mimmo.cose...@gmail.com wrote:
 May be for newcomers like me it will be good to add some integraional tips
 for emacs(others) editors..


 I always feel guilty when talking about editors because I use emacs. It
 seems that the top clojurists are pushing people to switch from emacs to
 something more used by younger/front-end programmers. In someway it seems
 that emacs could be felt as an incidental complexity on the path toward
 Clojure.

 I don't know what to say. Perhaps only use the editor that lets you feel
 less incidental complexities in developing with  CLJ/CLJS. Initially this
 should be your current editor.

The trend that I see (and think is _awesome_!) is encouraging people
to learning just Clojure. There used to be a real attitude that if you
want to use Clojure, you need to use Emacs. That attitude has all but
evaporated ([it's still there though][1]).

I still think most people who've taken the time to grok Emacs say that
it was worth their time as much as taking the time to grok Lisp was,
but it's just not a good idea to learn a new editor and a new language
at the same time.

So I wouldn't encourage anyone, at this point, to switch editors to
learn any language. I would encourage anyone who is not learning a
language to learn Emacs. :)

[1]: https://kotka.de/blog/2013/10/A_bitter_taste.html

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
-- 
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] cljs-start 0.0.7 now support source-map

2013-12-17 Thread Tim Visher
On Tue, Dec 17, 2013 at 8:14 AM, Andrew Voron volan...@gmail.com wrote:
 Well, Im not sure if I expressed myself correctly when asked for tips about
 editor - I thought about how to get Emacs (or may be other editor which
 support nrepl workflow) work with cljs-start. Now I see that it works good
 when I'm testing it. I use emacs-live for clojure work with emacs, and it
 seems like all things work not only from emacs clojurescript repl but from
 file - when I type C-x C-e - it evaluates my s-expressions and puts result
 to emacs's status buffer... Could you tell us maybe some other good shotcuts
 and tips that you use in development... I cant for ex. eval the whole buffer
 or reload the namescpace...

If you're in emacs, and using cider/nrepl.el, then a good place to
look would be:

`M-x help RET m` to see most of the widely useful key bindings for
Clojure and nrepl.el. Also the project pages for those projects list a
lot of the useful key bindings.

To get the complete story, `M-x help RET b` will list every binding.

Specifically, `C-c C-l` tends to load the file.

Evaling the ns form in nrepl.el at least can be done with `M-x
nrepl-eval-ns-form RET` (bound to `C-c C-n` by default).

What about other editors - I think they should work as far as them
 support nrepl... Personally I tryed Sublime Text 3, but without success...

Vim Fireplace has really good nrepl support.

I believe all the IDEs out there now have really good nrepl support as well.

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
-- 
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] cljs-start 0.0.7 now support source-map

2013-12-17 Thread Tim Visher
On Tue, Dec 17, 2013 at 8:21 AM, Lee Spector lspec...@hampshire.edu wrote:
 On Dec 17, 2013, at 6:01 AM, Cedric Greevey wrote:

 Calling emacs incidental complexity is like calling the North Pole a bit 
 nippy this time of year. :)

 The thing is, it's actually possible to have the power of emacs without the 
 incidental complexity of currently available emacs versions. It has been done 
 before, e.g. with FRED (FRED Resembles Emacs Deliberately, in Macintosh 
 Common Lisp). Emacs under the hood, but modern GUI design and usability.

We could all use Aquamacs. :)

-- 
-- 
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: Philadelphia SICP Study Group starting Feb 5th

2013-12-17 Thread Tim Visher
Hi Paul,

On Tue, Dec 17, 2013 at 9:26 AM, Paul L. Snyder
p...@pataprogramming.com wrote:
 On Tue, 17 Dec 2013, Steve Shogren wrote:

 Quite a few in the Philadelphia area expressed interest in having a study
 group around the excellent book Structure and Interpretation of Computer
 Programs, and so here it is!

 http://www.meetup.com/Clojadelphia/events/155920672/

 Any chance of a meeting date *other* than the first Wednesday of the month?
 It conflicts with the Philly Linux Users Group.

 This schedule doesn't have everything, but it often helpful when avoiding
 conflicts with other technical groups:

   http://technical.ly/philly/events/

Good point! :)

Best thing I could recommend would be to comment on the Meetup. If
enough people say they can't make then I'm sure we can change it up.
And localizing the responses on the Meetup page probably would give
the most visibility to the most relevant people.

Thanks in advance!

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
-- 
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: IE compatibility of clojurescript, Element undefined problem

2013-12-16 Thread Tim Visher
Hi Xiangtao,

If you needed to delete dommy in order to get thing working in IE6,
_please_ file a bug report. I like dommy a lot and finding everywhere
that it breaks compatibility with older browsers is crucial for its
success.

On Mon, Dec 16, 2013 at 8:28 AM, Xiangtao Zhou tao...@gmail.com wrote:
 hi David,

 Thanks. You're right, I delete dommy, it works.


 On Monday, December 16, 2013 9:10:18 PM UTC+8, David Powell wrote:

 The clojure.browser namespace does try to extend a protocol to
 js/EventType - which IE6 doesn't have, but if you use third party
 alternatives, raw javascript DOM manipulation, or Google Closure, then
 things should work in IE6.


 On Mon, Dec 16, 2013 at 12:59 PM, Xiangtao Zhou tao...@gmail.com wrote:

 hi all,

 I'm new for clojurescript.  I found there is compatibility problem under
 IE6,  closurescript use Element which IE 6 dos not have.

 Line 34266, Element.prototype.clojure$browser$event$EventType$ = true;

 Is clojurescript give up IE6?


 Joe

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

-- 
-- 
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: Meta-eX: Power to Complect (featuring Rich Hickey)

2013-12-16 Thread Tim Visher
On Mon, Dec 16, 2013 at 6:41 AM, Samuel Aaron samaa...@gmail.com wrote:
 just a quick promotional email, so I'll keep it brief.

 Meta-eX[1] just pushed a small excerpt from a recent Live Session featuring 
 the voice of Rich Hickey:

 https://soundcloud.com/meta-ex/power-to-complect

 It's not every day you get to hear music coded and performed with Clojure 
 featuring Rich, so I thought it not too out of context to mention it on here.

 Enjoy, and Happy Hacking!

There is a thing in the Christian world (perhaps other religions as
well) called a Sermon Jam, where a message is taken and put to music,
usually as an artistic way to drive the point home further.

I'm now anticipating eagerly an outpouring of CS Jams from the
Overtone community, wherein CS Messages are put to music creatively.

Can you imagine The Mother of All Demos? Guy Steele? Alan Kay?
Dijkstra? Grace Hopper? All put to delicious electronic beats?

Go for it, Overtone Hackers!

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

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


Re: [ClojureScript] Re: AnNN: ClojureScript 0.0-2120

2013-12-16 Thread Tim Visher
On Mon, Dec 16, 2013 at 12:33 PM, Gary Johnson gwjoh...@uvm.edu wrote:
 Wait a minute...


   #js data literal support added

 Holy $#%^!!! Where is this documented?! MUST...USE...NOW!

https://groups.google.com/d/msg/clojurescript/mUVbtdnAvHA/Voa86mDnNGwJ

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
-- 
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: cider status

2013-12-13 Thread Tim Visher
Hi Phil,

On Fri, Dec 13, 2013 at 4:57 AM, Phillip Lord
phillip.l...@newcastle.ac.uk wrote:
 Bozhidar Batsov bozhidar.bat...@gmail.com writes:
 On Tuesday, November 19, 2013 4:56:05 PM UTC+2, Phillip Lord wrote:
 I discovered one of the reasons for my issues with stability yesterday.
 The version of clojure-test-mode on marmalade still depends on nrepl
 (rather than cider), so, despite my best efforts to remove nrepl.el it
 was still getting pulled back in.

 Marmalade is a huge problem these days - frequent outages, not to mention
 many package uploads (including cider 0.4) got corrupted and Nic hasn't
 been able to figure out what's going on there.
 I'd suggest to everyone to use MELPA for the time being.

 So, I have used MELPA before, but I found living on the bleeding edge
 for all of my packages is bit painful; the overall stability of my Emacs
 setup dropped considerably. I fear this will remain while many package
 developers use a dirty head versioning system (myself included).

That has completely been my experience. Continuous Deployment
_requires_ Continuous Integration and pretty much all of the emacs
package developers out there don't have the time to do CI correctly so
Continuous Deployment simply equals lots of pain on the users end as
things get broken accidentally.

 I don't mind doing this for one or two packages where I want bleeding
 edge, but I haven't worked out how to get package.el to pick packages
 from different repos.

You might consider playing with something that I've had in my
incubator file for awhile:
https://github.com/timvisher/.emacs.d/blob/c8fa14315825f722f9995e8dd1e888c6b81321e9/timvisher/timvisher_incubator.el#L16-L28

 I agree with you about problems with marmalade. What we need is a way
 for devs to specify the latest stable version (by commit, branch or tag)
 in their Emacs packages. That would mean that, like marmalade, the
 developer would control which version is considered stable, but could do
 so purely with their VC. Wordpress plugins use something similar.

I assume you mean something over and above the `Version` ELPA header?
Obviously, that depends on package maintainers following things like
SNAPSHOT versioning (which ELPA doesn't accept) or Semantic Versioning
to tip people off as to what is considered stable.

I think the general attitude I'm seeing amongst some of the package
maintainers out there is that the idea of versioning is a farse
because they always intend to maintain stable HEADs so HEAD is as
stable as your ever going to get. That's a shame, but I get the
sentiment.

So the responsibility for deciding what is stable or not falls to us,
the package users. That's, unfortunately, an area where ELPA is
woefully inadequate at this time. We have no way of specifying that we
want a particular version of a package. That's a basic requirement of
any true dependency management system and for whatever reason the
Emacs devs did not deign to include it yet. I, at this point, would be
fine with specifying a version _or_ commit depending on what package
repo I'm pointing at.

Didn't realize I'd rant this morning. :(

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

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


Re: [ClojureScript] AnNN: ClojureScript 0.0-2120

2013-12-13 Thread Tim Visher
On Fri, Dec 13, 2013 at 10:15 AM, David Nolen dnolen.li...@gmail.com wrote:
 ClojureScript, the Clojure compiler that emits JavaScript source code.

 README and source code: https://github.com/clojure/clojurescript

 New release version: 0.0-2120

 Leiningen dependency information:

 [org.clojure/clojurescript 0.0-2120]

Great to see another release!

I get bitten by this every time, so I don't know if it's worth
mentioning even though I should know better, but is it possible to
either resist announcing these until they're available from Maven
Central _or_ to mention each time that if you want it now, you should
add `:repositories {sonatype-staging
https://oss.sonatype.org/content/groups/staging/}` to your
project.clj? It's just a minor annoyance but, like I said, I'm bitten
by it every time.

Thanks in advance!

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

-- 
-- 
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: Should I be using deftype, gen-class or defrecord instead of this hack?

2013-12-12 Thread Tim
Hi James,

I'm not basing logic on types alone. That aside, here's an example to 
highlight the specific problem:

{:where [:id 'identity]} 
 
Here are two options for sorting by id:

1. {:where [:id 'identity] :sort-by :id :sort '} 

2. {:where [:id (object 'identity {:sort })}

I chose #2, which is immensely helpful when constructing multi-sort 
queries. I can understand how #2 may raise some eyebrows/questions from a 
query logic perspective, but I am trying to reduce the scope down to 
question at hand and not get into unraveling the entire spec. 

Does that help?   Thanks.

On Thursday, December 12, 2013 7:59:26 AM UTC-5, James Reeves wrote:

 It's hard to offer an opinion without some sense of the data structures 
 you are producing.

 In the case of sorting by identifier, why do you need a new type? It 
 sounds like you're basing your logic on data types, rather than the data 
 itself.

 - James


 On 12 December 2013 04:26, Tim tcr...@gmail.com javascript: wrote:

 As an experiment, I've written a DSL that generates database queries 
 using *effectively* only the data. The query logic is derived from the data 
 assemblance and choice of data structures (or types). I am at the stage 
 where I have all the logic working, and I am now moving into perf testing 
 and tuning. BUT, before I do, there's this one hack I have implemented that 
 has me asking the this question.

 As I wrote the DSL I ran out of data structure types to account for a few 
 defined meanings within the query logic. As a short term hack I decided to 
 attach meta data to symbols where the meta data contained a data value 
 along with, for example, a sort option. I only intended for this to be 
 short term until I got around to figuring out the semantics of Clojure's 
 deftype or defrecord.

 Here's the hack:

   (defn object [v m]
 (let [id (gensym #object#)]
   (with-meta id
 (merge m {:default v :id id}


   (defn object? [o]
 (if-let [it (meta o)]
(if (= (it :id) o)
   true false)
false))

   (defn inspect
 ([o]
   (inspect o nil))
 ([o  xs]
   (if-let [it (meta o)]
 (if (= (:id it) o)
 (if-let [x (first xs)]
(if (coll? x)
(select-keys it x)
(x it))
 it)
   
 (defn instance
   ([o]
 (instance o nil))
   ([o  args]
 (if-let [it (meta o)]
(if (= (:id it) o)
(if-let [x (:default it)]
  (if (fn? x)
  (if-let [args (or (and (some identity args) args) (it 
 :args))]
(apply x args)
(x))
   x)
   it)


   = (def o (object #(java.util.UUID/randomUUID){:sort '})
   object#24397 
  
   = (object? o))
   true

   = (instance o) 
   #uuid 3c9cca8b-59e2-46b2-9175-468de3a21a22

   = (inspect o :sort)) 
   

 So now I've been reading up on Clojure's deftypes  defrecords and while 
 it I expect they are both considered the right tool for the job,
 everything I read seems like overly complicated bloat code compared to my 
 hack. Am I missing something? Is this a case where you wouldn't be caught 
 dead using the above hack? Why or why not?  

 As I see it: I'm not creating and/or holding millions of objects that 
 would need to be shared, altered or held onto. These have relatively short 
 lives that only serve in compiling to a different query language. Type 
 hints or java interop really shouldn't matter.

 Notes: 

 1. While the above function names may carry OO concepts, these functions 
 are not intended to fulfil all of them them; rather they only fill a 
 specific functionality gap that appears to meet my needs.
 2. I realize one wouldn't sort on a UUID, it's just an example to show 
 the functionality. :)


 Thanks,
 Tim

 -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.comjavascript:
 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 javascript:
 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 javascript:.
 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

Re: Should I be using deftype, gen-class or defrecord instead of this hack?

2013-12-12 Thread Tim
And that's ok, there's obviously more to it and not knowing or 
understanding the spec I wouldn't expect you to make sense of that piece. 
 Still, the question really is: If you were to do this, would you implement 
deftype, gen-class instead?  Would the hacked approach be a bad idea and if 
so for what reason? Staying within the bounds of the question are there 
other approaches to doing the same thing? I initially just wanted to use 
with-meta that could attach to any data, but obviously with-meta limits 
what it can be attached to which led to the above approach.  

Thanks, 

On Thursday, December 12, 2013 10:43:22 AM UTC-5, James Reeves wrote:

 Why not something like:

 {:where [[:id 'identity]] :sort [[:id :desc]]}

 That would make it relatively straightforward to merge queries (use `into` 
 and then check for duplicates in :sort).
  
 To me, it doesn't make a huge amount of sense to tie sorting logic onto 
 the field itself.

 - James


 On 12 December 2013 13:56, Tim tcr...@gmail.com javascript: wrote:

 Hi James,

 I'm not basing logic on types alone. That aside, here's an example to 
 highlight the specific problem:

 {:where [:id 'identity]} 
  
 Here are two options for sorting by id:

 1. {:where [:id 'identity] :sort-by :id :sort '} 

 2. {:where [:id (object 'identity {:sort })}

 I chose #2, which is immensely helpful when constructing multi-sort 
 queries. I can understand how #2 may raise some eyebrows/questions from a 
 query logic perspective, but I am trying to reduce the scope down to 
 question at hand and not get into unraveling the entire spec. 

 Does that help?   Thanks.

 On Thursday, December 12, 2013 7:59:26 AM UTC-5, James Reeves wrote:

 It's hard to offer an opinion without some sense of the data structures 
 you are producing.

 In the case of sorting by identifier, why do you need a new type? It 
 sounds like you're basing your logic on data types, rather than the data 
 itself.

 - James


 On 12 December 2013 04:26, Tim tcr...@gmail.com wrote:

 As an experiment, I've written a DSL that generates database queries 
 using *effectively* only the data. The query logic is derived from the 
 data 
 assemblance and choice of data structures (or types). I am at the stage 
 where I have all the logic working, and I am now moving into perf testing 
 and tuning. BUT, before I do, there's this one hack I have implemented 
 that 
 has me asking the this question.

 As I wrote the DSL I ran out of data structure types to account for a 
 few defined meanings within the query logic. As a short term hack I 
 decided 
 to attach meta data to symbols where the meta data contained a data value 
 along with, for example, a sort option. I only intended for this to be 
 short term until I got around to figuring out the semantics of Clojure's 
 deftype or defrecord.

 Here's the hack:

   (defn object [v m]
 (let [id (gensym #object#)]
   (with-meta id
 (merge m {:default v :id id}


   (defn object? [o]
 (if-let [it (meta o)]
(if (= (it :id) o)
   true false)
false))

   (defn inspect
 ([o]
   (inspect o nil))
 ([o  xs]
   (if-let [it (meta o)]
 (if (= (:id it) o)
 (if-let [x (first xs)]
(if (coll? x)
(select-keys it x)
(x it))
 it)
   
 (defn instance
   ([o]
 (instance o nil))
   ([o  args]
 (if-let [it (meta o)]
(if (= (:id it) o)
(if-let [x (:default it)]
  (if (fn? x)
  (if-let [args (or (and (some identity args) args) (it 
 :args))]
(apply x args)
(x))
   x)
   it)


   = (def o (object #(java.util.UUID/randomUUID){:sort '})
   object#24397 
  
   = (object? o))
   true

   = (instance o) 
   #uuid 3c9cca8b-59e2-46b2-9175-468de3a21a22

   = (inspect o :sort)) 
   

 So now I've been reading up on Clojure's deftypes  defrecords and 
 while it I expect they are both considered the right tool for the job,
 everything I read seems like overly complicated bloat code compared to 
 my hack. Am I missing something? Is this a case where you wouldn't be 
 caught dead using the above hack? Why or why not?  

 As I see it: I'm not creating and/or holding millions of objects that 
 would need to be shared, altered or held onto. These have relatively short 
 lives that only serve in compiling to a different query language. Type 
 hints or java interop really shouldn't matter.

 Notes: 

 1. While the above function names may carry OO concepts, these 
 functions are not intended to fulfil all of them them; rather they only 
 fill a specific functionality gap that appears to meet my needs.
 2. I realize one wouldn't sort on a UUID, it's just an example to show 
 the functionality. :)


 Thanks,
 Tim

 -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups

Re: Should I be using deftype, gen-class or defrecord instead of this hack?

2013-12-12 Thread Tim
Thanks for the responses. 

I took a look at your project and found it to be more useful than any 
documentation I've seen on deftype, so thanks for linking to it.

Tim

On Thursday, December 12, 2013 2:20:21 PM UTC-5, James Reeves wrote:

 gen-class is really there just for compatibility with Java. deftype should 
 be preferred.

 Here's a project of mine where I create a custom type and data reader, if 
 you want an example: 
 https://github.com/weavejester/crumpetshttps://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fweavejester%2Fcrumpetssa=Dsntz=1usg=AFQjCNFAbFSPOo7A60iH9ecMtaG1asRquw

 However, it feels like you're looking for a solution in the wrong place. I 
 obviously don't know the precise problem you're trying to solve, so I may 
 be completely wrong, but the example code you've shown so far seems a 
 little odd.

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


Should I be using deftype, gen-class or defrecord instead of this hack?

2013-12-11 Thread Tim
As an experiment, I've written a DSL that generates database queries using 
*effectively* only the data. The query logic is derived from the data 
assemblance and choice of data structures (or types). I am at the stage 
where I have all the logic working, and I am now moving into perf testing 
and tuning. BUT, before I do, there's this one hack I have implemented that 
has me asking the this question.

As I wrote the DSL I ran out of data structure types to account for a few 
defined meanings within the query logic. As a short term hack I decided to 
attach meta data to symbols where the meta data contained a data value 
along with, for example, a sort option. I only intended for this to be 
short term until I got around to figuring out the semantics of Clojure's 
deftype or defrecord.

Here's the hack:

  (defn object [v m]
(let [id (gensym #object#)]
  (with-meta id
(merge m {:default v :id id}


  (defn object? [o]
(if-let [it (meta o)]
   (if (= (it :id) o)
  true false)
   false))

  (defn inspect
([o]
  (inspect o nil))
([o  xs]
  (if-let [it (meta o)]
(if (= (:id it) o)
(if-let [x (first xs)]
   (if (coll? x)
   (select-keys it x)
   (x it))
it)
  
(defn instance
  ([o]
(instance o nil))
  ([o  args]
(if-let [it (meta o)]
   (if (= (:id it) o)
   (if-let [x (:default it)]
 (if (fn? x)
 (if-let [args (or (and (some identity args) args) (it 
:args))]
   (apply x args)
   (x))
  x)
  it)


  = (def o (object #(java.util.UUID/randomUUID){:sort '})
  object#24397 
 
  = (object? o))
  true

  = (instance o) 
  #uuid 3c9cca8b-59e2-46b2-9175-468de3a21a22

  = (inspect o :sort)) 
  

So now I've been reading up on Clojure's deftypes  defrecords and while it 
I expect they are both considered the right tool for the job,
everything I read seems like overly complicated bloat code compared to my 
hack. Am I missing something? Is this a case where you wouldn't be caught 
dead using the above hack? Why or why not?  

As I see it: I'm not creating and/or holding millions of objects that would 
need to be shared, altered or held onto. These have relatively short lives 
that only serve in compiling to a different query language. Type hints or 
java interop really shouldn't matter.

Notes: 

1. While the above function names may carry OO concepts, these functions 
are not intended to fulfil all of them them; rather they only fill a 
specific functionality gap that appears to meet my needs.
2. I realize one wouldn't sort on a UUID, it's just an example to show the 
functionality. :)


Thanks,
Tim

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


Re: Spit seems to use incorrect line terminator on Windoze

2013-11-25 Thread Tim Visher
On Mon, Nov 25, 2013 at 6:18 AM, Cedric Greevey cgree...@gmail.com wrote:
 And yet it does happen, with PrintWriter and similar. Consider the output of
 (println) on different operating systems.

Do you have an example of println converting a \n character embedded
in a string to the host's line terminator?

-- 
-- 
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: Spit seems to use incorrect line terminator on Windoze

2013-11-25 Thread Tim Visher
On Mon, Nov 25, 2013 at 6:29 AM, Cedric Greevey cgree...@gmail.com wrote:
 (println) outputs nothing *but* the host's line terminator.

Note that you have not embedded a \n character in anything in that example.

What does (println \n) print?

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

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


  1   2   3   4   5   >