Re: Switch devops environments via namespaces

2023-05-18 Thread Joe R . Smith
I mean, it works, it’s clever, … is it more or less “safe” is my question. 


On May 18, 2023, at 12:02 PM, Felix Dorner  wrote:


Clojure noob here, I might be totally off the track or committing crimes, so 
please advise.

For ops, I have to often call rest services in different environments, say prod 
and nonprod. My coworkers use postman and clicky clicky stuff, well, not my 
style, I want to use emacs and cider. I've thus written a set of functions that 
call these services, taking the prod/nonprod server as an argument:

(ns services)
(defn rest [server arg1 arg2] ...)

I'm thinking how it would feel to get rid of the server parameter, and resolve 
it inside the function, depending on the current namespace. I can then just 
leave my cider open, use Cider shortcuts to switch to the prod/nonprod 
namespaces quickly and run my stuff. Also, I would be constantly aware of which 
environment I'm in by looking at the repl prompt. Sounds neat somehow. But I 
feel I am venturing off the track somehow, but this seems to work:

(ns prod
  (:require
   [services :refer :all]))

(def server "http://prod-server.com";)

(ns nonprod
  (:require
   [services :refer :all]))

(def server "http://nonprod-server.com";)

(ns services)
;; no more server arg...
(defn call-a [arg1 arg2]
  (let [server @(resolve 'server)]
     ;; ... do stuff with server))

What do I miss? Complete nonsense? Better solutions?
Thanks again for comments,
Felix




-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en 
 
--- 
You received this message because you are subscribed to 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/f16c7ac6-107c-48fd-a6af-c9e91687fe18n%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/0100018830153cf6-3c4a1729-13a9-472b-aad0-86f85350e7d1-00%40email.amazonses.com.


Re: clojure is supposed to be 'code is data' yet I can't add to the end of a list?

2021-07-18 Thread Joe R . Smith
It is a singly linked list, so the natural position at which to add is the 
front. conj will add to the front of lists and to the end of vectors.

Consider using a vector if you want to append to the end. It'd be more 
semantically correct.

More background: If you append to the end of a singly linked list, generally, 
you'd have to follow the references starting from the first element until you 
reached the last element. Clojure uses persistent data structures, meaning when 
you add an item to a collection you share structure with the original item. In 
the case of a singly linked list, adding an item to the front is as simple as 
creating a new list that points to the old list. E.g., adding 5 to the linked 
list 2 -> 3 -> 4 can be thought of as 5 -> 2 -> 3 -> 4.

---
Joe R. Smith
j...@uwcreations.com <mailto:j...@uwcreations.com> 
@solussd


On Jul 17, 2021, at 2:21 PM, Tanya Moldovan mailto:tanya.moldo...@gmail.com> > wrote:



Hi,

conj <https://clojuredocs.org/clojure.core/conj>  adds at the end of a vector, 
but at the beginning of a list. It is how it is implemented. I think this 
<https://stackoverflow.com/questions/5734435/put-an-element-to-the-tail-of-a-collection>
  and this <https://medium.com/@greg_63957/conj-cons-concat-oh-my-1398a2981eab> 
 sums it up why.

You could achieve what you want by using concat 
<https://clojuredocs.org/clojure.core/concat> (note this returns a LazySeq):

user=> (concat grid '((off 1 2 3 6)))
(-> (grid 10 10) (toggle 2 3 4 5) (off 2 3 4 5) (on 2 3 4 5) (off 1 2 3 6))

Though I'm not exactly sure what is the end goal of this but I'd rethink the 
way it is done. 



On Sat, 17 Jul 2021 at 14:24, SideStep mailto:nesvarbu.vi...@gmail.com> > wrote:

 <https://stackoverflow.com/posts/68420449/timeline> 
 
 

I have a representation of a matrix in grid.clj file:


(-> (grid 10 10)
(toggle 2 3 4 5)
(off 2 3 4 5)
(on 2 3 4 5))


It's a list of functionts, first one initializes a grid, others modify it.
Clojures' 'code is data' supposed to make it easy for me to modify that 
representation by adding an instrucion at the end of collection. List is an 
ordered collection right? Order matters. How do I add an instruction to the end 
of the list then?
Something like this:


(def grid (read-string (slurp "grid.clj")))
(conj grid '(off 1 2 3 6))


Yet I can't add to the end of the list, which is a data structure that is 
evaluatable as code. How is it 'code as data' if I can't add to the end of the 
ordered collection that is meant for code (as data)?

 

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com 
<mailto:clojure@googlegroups.com> 
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com 
<mailto:clojure%2bunsubscr...@googlegroups.com> 
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en 
<http://groups.google.com/group/clojure?hl=en> 
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com 
<mailto:clojure+unsubscr...@googlegroups.com> .
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/efd72013-a85e-46e8-b9db-10dde1a8a235n%40googlegroups.com
 
<https://groups.google.com/d/msgid/clojure/efd72013-a85e-46e8-b9db-10dde1a8a235n%40googlegroups.com?utm_medium=email&utm_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 
<mailto:clojure@googlegroups.com> 
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com 
<mailto:clojure+unsubscr...@googlegroups.com> 
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en 
<http://groups.google.com/group/clojure?hl=en> 
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com 
<mailto:clojure+unsubscr...@googlegroups.com> .
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/CADBYUPvzMtspZxxc5PhmkXyNg7kJqgMG%3DWVkUe2FKsf%2BGsdaFA%40mail.gmail.com
 
<https://groups.google.com/d/msgid/clojure/CADBYUPvzMtspZxxc5PhmkXyNg7kJqgMG%3DWVkUe2FKsf%2BGsdaFA%40mail.gmail.com?utm_medium=email&

Re: [ANN] Discontinuing 4clojure.com

2021-07-12 Thread Brandon R
Thank you Alan for all the work and time put into 4clojure, and thank those
of you who've started and contributed to 4ever-clojure!

Cheers,
Brandon

On Sun, Jul 11, 2021 at 2:38 PM Alan Malloy  wrote:

> I've also exported the problem data:
> https://drive.google.com/file/d/1hHrygxAs5Do8FpHC9kphYnmyTwZvISnb/view?usp=sharing
> .
>
> On Sunday, July 11, 2021 at 2:22:33 PM UTC-7 Alan Malloy wrote:
>
>> I'm happy to see this project, and I think exporting some data is a
>> reasonable compromise. Rather than re-learn how to do any fancy mongodb
>> stuff to make it into "pretty" json, I've just done a raw JSON export of
>> the solutions collection, which is world-readable at
>> https://drive.google.com/file/d/1UQHznThT_eVTBjmLGz3yME8L3teGygUs/view?usp=sharing.
>> I'm contemplating doing a partial export of the users collection too: I
>> could connect usernames to IDs without including the email addresses or
>> passwords, which would let you rebuild most of the user information. But
>> I'm not totally sure this is a good idea: some people may not want their
>> usernames shared, or associated with their solutions. Does anyone in this
>> thread have an opinion?
>>
>> On Tuesday, July 6, 2021 at 9:58:29 AM UTC-7 oxa...@gmail.com wrote:
>>
>>> Thank you Alan for all your contributions :)
>>>
>>> Hosting things and maintaing them is really hard. We, the LambdaIsland
>>> team, are already maintaining clojurians-log and clojureverse and it's
>>> definitely not easy!
>>>
>>> With a wonderful idea from @borkdude and his `sci` library, I built
>>> "4ever-clojure": a completely static version of 4clojure which runs using
>>> cljs + sci. It interprets the code in the browser itself.
>>>
>>> It's live at: 4clojure.oxal.org  (Source code at:
>>> https://github.com/oxalorg/4ever-clojure  I'm planning to move it under
>>> the clojureverse github org)
>>>
>>> I have 2 asks from you if it is feasible:
>>> 1. An export of all solutions (only solutions, no user data needed) -
>>> the community is already coming up with some amazing ideas of hooking up
>>> user solutions to automatically commit to a Github repo
>>> 2. Possibility of transfering *4clojure.com  *-or- 
>>> *4clojure.org
>>>  *over to us so that we can host 4ever-clojure
>>> there (instead of on a separate domain)
>>>
>>> Thanks!
>>> - Mitesh
>>>
>>> On Tuesday, July 6, 2021 at 5:56:10 PM UTC+5:30 Srihari Sriraman wrote:
>>>
 Hey Alan, we really like 4clojure. We've suggested using it for
 training most people at nilenso and we're very thankful to you and all the
 contributors for that!
 We (nilenso) would be up for picking up the hosting costs, and also
 some other operations or development work if needed.

 It would be even better if we could work together and turn this into a
 community owned project (ex: clojurists together
 ). That might also assuage your
 concerns about data ownership.

 The questions, and solutions that the community has put together on
 4clojure over the last decade are very valuable as a learning tool. Perhaps
 we can find a way to keep them around without attributing them to a user?
 One idea might be to deactivate all existing accounts, and remove the user
 data (email, passwords, other PII) etc while keeping the questions and
 solutions from those users.

 We would be sad to see 4clojure go away, hope we can find a way for it
 to live on.

 Cheers,
 Srihari

 On Tuesday, July 6, 2021 at 1:12:44 PM UTC+5:30 Robert P. Levy wrote:

> Hi Alan,
>
> Just as a thought.  If it's minimal work on your end (eg. if the folks
> from Roam research who chimed in above pick it up) why not clear the
> password hashes and let the new maintainer handle the communication that
> passwords need to be reset?
>
> Rob
>
> On Sun, Jul 4, 2021 at 1: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 som

Re: Routing for a non-web-app

2021-04-21 Thread Brandon R
Bidi probably would work fine for what you want, but I'll also second the
reitit suggestion.

On Wed, Apr 21, 2021 at 4:54 PM Harold  wrote:

> >> ...is intended for use with Ring middleware, HTTP servers...
> >
> > sorta made me think it wouldn't work in a non-web app.
> >
>
> Understood.
>
> One of the coolest things about bidi is that it's just functions that
> operate on data.
>
> Nothing ring, web, or http specific going on here:
>
> > (require 'bidi.bidi)
> nil
> > (bidi.bidi/match-route ["/foo" :bar] "/foo")
> {:handler :bar}
> > (bidi.bidi/match-route [["/foo/" :id] :bar] "/foo/17")
> {:route-params {:id "17"}, :handler :bar}
> > (bidi.bidi/path-for [["/foo/" :id] :bar] :bar :id 17)
> "/foo/17"
>
> ---
>
> Hope that helps,
> -Harold
> On Tuesday, April 20, 2021 at 8:35:11 PM UTC-6 dsblak...@gmail.com wrote:
>
>> Cool. I thought about bidi but this:
>>
>> ...is intended for use with Ring middleware, HTTP servers...
>>
>>  sorta made me think it wouldn't work in a non-web app.
>>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to 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/fbd94185-4401-4311-85b3-639fafbbb787n%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/CAB_6y6FLk-Rf1Cs21_%2Be_aNA7DmCj1o0NqgDE50y%2BPgJNMr7Mg%40mail.gmail.com.


Re: Without breakloop not much of a REPL

2021-01-29 Thread Brandon R
This may be the talk I was thinking of: https://vimeo.com/223309989

On Fri, Jan 29, 2021 at 10:04 AM Brandon R  wrote:

> I believe what's described in that post is possible in Clojure, at least
> to an extent. I can't remember where I saw it described, but I think it was
> a talk by Stuart Halloway. IIRC you can configure Clojure to run
> clojure.main/repl when an exception is thrown, this puts you into a new sub
> repl with the lexical bindings at that point in execution. You can inspect
> things here and I believe change things. I'm not sure about continuing
> running with new values, but I'm guessing that's possible too.
>
> Maybe someone in this group can point to a good resource about this, as I
> didn't find it in a quick search.
>
> On Fri, Jan 29, 2021 at 6:09 AM SideStep  wrote:
>
>> According to this post:
>> https://mikelevins.github.io/posts/2020-12-18-repl-driven/
>>
>> Breakloop is a true differentiator for "real" REPLs. I can see how
>> breakloop really is a game changer.
>>
>> Also, there is no breakloop in modern languages such as clojure, which is
>> heralded for it's REPL driven development, craftsmans' playground, live
>> coding etc...
>>
>> Is breakloop gone from modern REPL languages? Maybe it's not a big deal?
>> Or is it?
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to 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/6cbcc0e9-c8d6-42b1-a1ae-3d3b88fcdfb6n%40googlegroups.com
>> <https://groups.google.com/d/msgid/clojure/6cbcc0e9-c8d6-42b1-a1ae-3d3b88fcdfb6n%40googlegroups.com?utm_medium=email&utm_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/CAB_6y6GsPfkRXWXrwrE6gHaCXr7hJxFK1zXBYp%3Dh5DRD7mFkrw%40mail.gmail.com.


Re: Without breakloop not much of a REPL

2021-01-29 Thread Brandon R
I believe what's described in that post is possible in Clojure, at least to
an extent. I can't remember where I saw it described, but I think it was a
talk by Stuart Halloway. IIRC you can configure Clojure to run
clojure.main/repl when an exception is thrown, this puts you into a new sub
repl with the lexical bindings at that point in execution. You can inspect
things here and I believe change things. I'm not sure about continuing
running with new values, but I'm guessing that's possible too.

Maybe someone in this group can point to a good resource about this, as I
didn't find it in a quick search.

On Fri, Jan 29, 2021 at 6:09 AM SideStep  wrote:

> According to this post:
> https://mikelevins.github.io/posts/2020-12-18-repl-driven/
>
> Breakloop is a true differentiator for "real" REPLs. I can see how
> breakloop really is a game changer.
>
> Also, there is no breakloop in modern languages such as clojure, which is
> heralded for it's REPL driven development, craftsmans' playground, live
> coding etc...
>
> Is breakloop gone from modern REPL languages? Maybe it's not a big deal?
> Or is it?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to 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/6cbcc0e9-c8d6-42b1-a1ae-3d3b88fcdfb6n%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/CAB_6y6ErN6Xv1QxN3gkz2uGwN5MsR-f4rYeUB_1ByCkTFkjDsA%40mail.gmail.com.


Re: Adding value to the map in sql statement dynamically

2020-12-20 Thread Brandon R
Hey Ganesh,

Just to add to the above information, you may want to check out next.jdbc
as well. If you specifically want to create functions that return complete
SQL, then maybe this isn't what you want, but I just wanted to point out
parameterization in next.jdbc since you mentioned you're new to Clojure,
and maybe weren't aware. See here for an example
,
where next.jdbc replaces a variable number of question marks with the
values defined after the SQL in the vector passed to the function.

- Brandon

On Sun, Dec 20, 2020 at 9:15 AM alpeware llc  wrote:

> The most straight forward approach is to simply define a different
> function for each use case you have using the same approach.
>
> At some point you will have to decide which function to call with what
> input.
>
> In more general terms, you want to think about taking an input (a map),
> applying some transformation (a function) and producing an output (a string
> describing a sql query).
>
> You will first want to think about where the dynamic input is coming from
> and what is considered valid input for your function.
>
> You then have different ways to dispatch the input to the appropriate
> function using Clojure's runtime polymorphism [0].
>
> To make sure you are returning valid SQL, I would highly recommend
> leveraging a library such as the previously mentioned Honey SQL instead.
>
> There's also a Clojure Slack channel that is super helpful and may be
> easier to get more real time feedback for various questions [1]
>
> Hope this makes sense.
>
> [0] https://clojure.org/about/runtime_polymorphism
> [1] https://clojure.org/community/resources
>
> On Sun, Dec 20, 2020, 10:43 AM Ganesh Neelekani 
> wrote:
>
>> Hello Alpaware,
>>
>> Thanks for the reply,
>>
>> In the above, I just gave an example,
>> Bt this will be dynamic, Any number of keys can come, How to segregate
>> and assigned to
>> particular variable?
>>
>> Thanking you.
>> --
>> With regards.
>> Ganesh N Neelekani
>>
>>
>>
>>
>> On Sun, Dec 20, 2020 at 9:12 PM alpeware llc  wrote:
>>
>>> Welcome to Clojure!
>>>
>>> You could just define a function taking a map as an argument and return
>>> the query as a string using destructering [0]
>>>
>>> (defn people [{:keys [table person id]}]
>>>   (str "SELECT * FROM " table " WHERE person_id = " person " ORDER BY "
>>> id))
>>>
>>> You may want to have a look at Sean Cornfield's Honey SQL as well [1].
>>>
>>> Hope this helps.
>>>
>>> [0] https://clojure.org/guides/destructuring
>>> [1] https://github.com/seancorfield/honeysql
>>>
>>> On Sun, Dec 20, 2020, 9:26 AM Ganesh Neelekani <
>>> ganeshneelek...@gmail.com> wrote:
>>>
 Hello Team,

 I am new to clojure and I wanted to write a function where input from
 map keys are passed as parameter as input to the sql query.

 (def query-body1 "
 select first_name, last_name
 from ${table_name}
 where
   person_id=${person_id}
 order by ${id}
 ")


 (def query-body2 "
 select first_name, last_name
 from ${table_name}
 where
   person_id=${person_id},
   and first_name=${first_name},
   and last_name=${last_name},
 order by ${id}
 ")

 (functiona-name query-body1  (:table_name "Employee", :person_id 123,
 id: "ABC"))

 (functiona-name query-body2 (:table_name "Employee", :person_id 123,
 :first_name "John", :last_name "David", id: "ABC"))

 output should be
 select first_name, last_name
 from Employee
 where
   person_id=123,
   and first_name=John,
   and last_name=David,
 order by ${id}

 How can I achieve this?

 Thanks,
 Ganesh N

 --
 You received this message because you are subscribed to the Google
 Groups "Clojure" group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to 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/3695bf0e-95df-4bce-b4a1-575c110c7994n%40googlegroups.com
 
 .

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clojur

Re: Idiomatic program for someone new to Clojure

2020-12-14 Thread Brandon R
Hey James,

Another small suggestion is you can just pass println to map, since it
takes 1 argument in your case.

(map println (sort builds))

But here, since you just want to perform side effects, maybe run! would be
a better function to use.

(run! println (sort builds))

This would cause it to return just one nil. Clojure is a functional
language, and every function returns a value. You'll see the return in your
REPL, but if the program is run in another way, such as packaged as a jar,
you would just see the print output.

- Brandon

On Mon, Dec 14, 2020 at 8:42 AM Justin Smith  wrote:

> a small suggestion: you don't need to nest let inside let, a clause
> can use previous clauses:
>
> (defn get-latest-build
>   [pipeline]
>   (let [response (fetch-pipeline pipeline)
> json (parse-string (:body response) true)
>[pipeline] (:pipelines json)]
>   (:counter pipeline
>
> also consider using get-in:
>
> (defn get-latest-build
>   [pipeline]
>   (let [response (fetch-pipeline pipeline)
> json (parse-string (:body response) true)]
>(get-in json [:pipelines 0 :counter])))
>
> finally, this can now be simplified into a single threading macro:
>
> (defn get-latest-build
>   [pipeline]
>   (-> (fetch-pipeline pipeline)
>   (:body)
>   (parse-string true)
>   (get-in [:pipelines 0 :counter])))
>
> On Mon, Dec 14, 2020 at 7:18 AM James Lorenzen 
> wrote:
> >
> > Hello all,
> > This is my first Clojure program and I was hoping to get some advice on
> it since I don't know any experienced Clojure devs. I'm using it locally to
> print the latest build numbers for a list of projects.
> >
> > ```
> > (ns jlorenzen.core
> >   (:gen-class)
> >   (:require [clj-http.client :as client])
> >   (:require [cheshire.core :refer :all]))
> >
> > (defn fetch-pipeline
> > [pipeline]
> > (client/get (str "https://example.com/go/api/pipelines/"; pipeline
> "/history")
> > {:basic-auth "username:password"}))
> >
> > (defn get-latest-build
> > [pipeline]
> > (let [response (fetch-pipeline pipeline)
> > json (parse-string (:body response) true)]
> > (let [[pipeline] (:pipelines json)]
> > (:counter pipeline
> >
> > (def core-projects #{"projectA"
> > "projectB"
> > "projectC"
> > "projectD"})
> >
> > (defn print-builds
> > ([]
> > (print-builds core-projects))
> > ([projects]
> > (let [builds (pmap #(str % " " (get-latest-build %)) projects)]
> > (map #(println %) (sort builds)
> > ```
> >
> > This will output the following:
> > ```
> > projectA 156
> > projectB 205
> > projectC 29
> > projectD 123
> > (nil nil nil nil)
> > ```
> >
> > A few questions:
> >
> > How can this program be improved?
> > How idiomatic is it?
> > How can I prevent it from returning the nils at the end? I know this is
> returning nil for each map'd item; I just don't know the best way to
> prevent that.
> >
> > Thanks,
> > James Lorenzen
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Clojure" group.
> > To post to this group, send email to clojure@googlegroups.com
> > Note that posts from new members are moderated - please be patient with
> your first post.
> > To unsubscribe from this group, send email to
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/clojure?hl=en
> > ---
> > You received this message because you are subscribed to 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/ccb868e0-7e0c-46df-80fc-712f718314e3n%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/CAGokn9L65oxePmfJqEDNvyhS9XL-JFjDbQAfk5zdiRctXS_-bQ%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 

Re: Using asynchronous clojure function

2020-12-13 Thread Brandon R
Hi Ganesh,

The function called wrap-content-type takes in another function (handler)
and a content-type (string), and returns a function. The function that it
returns takes in a request, which is a Clojure map, that has the keys that
you see in the ring docs here:
https://github.com/ring-clojure/ring/wiki/Concepts#requests

That function that is returned, that takes in a request, is known as
middleware. It calls the handler passed into wrap-content-type, which is
another handler function (returns a ring response), then attaches the
content type passed into wrap-content-type to the headers of the ring
response. So the response might then look like {:headers {"Content-Type":
"application/json"}} (if "application/json" was passed as content-type),
along with whatever other keys/values were on the response before it was
passed into the function.

FYI, the #beginners channel of the Clojurians Slack is super helpful for
general questions like this.

Happy coding,
Brandon

On Sun, Dec 13, 2020 at 7:08 AM Ganesh Neelekani 
wrote:

> Hello Team,
>
> I am a moderate Clojure user and now I planned to explore more Clojure, I
> used to
> write different functions every time where I could write asynchronous
> functions.
>
> As came from object-oriented background and trying to understand
> asynchronous functions
>
> I took some example on using fn functions
>
> ((fn [& nums] (/ (apply + nums) (count nums))) 1 2 3 4)
>
> In the above statement, 1 2 3 4 is added after the function defined as
> input,
> But in the below function I did not understand how fn behaves, what is the
> input for a request, Or what is the methodology , Basically I am not
> understanding the flow,
>
> (defn wrap-content-type [handler content-type]
>  (fn [request]
>(let [response (handler request)]
> (assoc-in response [:headers "Content-Type"]
> content-type
>
> Can someone help me, please?
>
> Thanks,
> Ganesh N
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to 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/c460dada-9752-4f7f-931d-3766fe64411cn%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/CAB_6y6E8_ACLJNR9zDmxPt0Dt9e%3D-QyJS71tuJv1DJ7bXbr8TQ%40mail.gmail.com.


Re: Rationale behind github.com/cljctools project

2020-09-01 Thread Brandon R
Hello and welcome! Always great to have more people contributing ideas and
tools.

On Mon, Aug 31, 2020 at 10:52 PM Sergei Udris 
wrote:

> Thank you!
> Encore indeed is a useful tool.
>
> However, as of now my focus is a non-commercial dream project :
> usef-facing system , a multiplayer game. I won't plug it here, but it can
> be found.
> And for that sockets, server, vscode api and other machinery is needed
> represented as channels. For simplicity and sane management of state and
> asynchrony.
> That's a practical application of cljctools, the trigger.
>
> I want to apologize to the community in general for badly
> presenting(formulating) these posts and not even saying hello, I'm new here.
>
> Hello, I'm new here, as of now I'm just a happy user of clojure ecosystem,
> ripping the fruit of others.
> Clojure world is maintained by a brilliant community of super smart
> people. I hope to grow to that level gradually.
> Through building systems and fresh new tools there will be value from my
> part as well.
>
>
>
> On Mon, Aug 31, 2020 at 3:53 PM matthew...@gmail.com <
> matthewdowne...@gmail.com> wrote:
>
>> You've probably seen this already, but
>> https://github.com/ptaoussanis/encore is a great extended core libary
>> for Clojure(Script) that I find myself using all the time in various
>> projects.
>>
>> On Sunday, August 30, 2020 at 1:42:25 AM UTC-5 sergei...@gmail.com wrote:
>>
>>> Thought process behind and goals of the https://github.com/cljctools
>>>  project:
>>>
>>> https://github.com/cljctools/readme#rationale
>>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to 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/c028db22-3f1f-4a56-abd5-49441627e6ebn%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/CA%2Bq3MLw%3D0S10AZVcgXNt3_O08H5hsTapsu7yHA-Hcv2LkzGDSQ%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/CAB_6y6HQNY2XxBfKr-1vOcHezVpUU4RK9%2BODDsU3Cw8iGsvh1A%40mail.gmail.com.


Re: First post: how to mimic a Java List with types?

2020-08-15 Thread Brandon R
Hey Jack,

Just been a fly on the wall for this convo, and aside from offering a
specific solution, which others have done, I'm pretty certain this can be
done with just protocols and records. Make a record (like your type) that
implements the two protocols (like your interfaces). You could achieve your
desired functionality without records and protocols but what you describe
sounds like a fitting case for them.

Members in such lists can be either other evaluable lists, or they can be
> evaluable objects which perform computations
>

A simple Clojure list/vector can hold any type of data you put into it. So
your record can hold a vector of these things, which can be represented as
Clojure data structure (lists / maps / etc).

You say you *need* to construct a type, but I urge you to challenge this
assumption, again and again if needed. I think it's natural to think you
need a type because of coming from Java/OOP land, especially if you were
there a long time. Old patterns die hard?

I could be wrong though. :)


My 2 cents,
Brandon

On Sat, Aug 15, 2020 at 12:42 PM Jack Park  wrote:

> Hi Erik,
>
> I think that teasing things apart helps along some dimensions, but the
> problem I face, still thinking like a Java hacker, is that I need to put
> things together:
>
> I need to construct a *type*  (deftype) which honors two different
> interfaces, a list, and an evaluable object. I need the type because I want
> to create it, then add members to the list, and then one of:
> a) insert the object into another one (building and/or trees)
> b) evaluate it - when it is the root of the tree.
>
> Members in such lists can be either other evaluable lists, or they can be
> evaluable objects which perform computations - even with side effects - but
> which return a boolean.
>
> The several ideas posted in this thread are greatly helping me to see
> through this situation with fresh eyes, but, thus far, nothing has
> convinced me to drop the goal of creating a type which is a list and
> evaluable, into which I can insert conjunction or disjunction evaluators.
>
> Many thanks,
> Jack
>
> On Sat, Aug 15, 2020 at 12:14 AM Erik Assum  wrote:
>
>> Why not tease things apart?
>>
>> (defn eval [x] ...)
>>
>> (some eval my-list) ;; or list
>> (every? eval my-list) ;; and list
>>
>> https://clojuredocs.org/clojure.core/some
>> https://clojuredocs.org/clojure.core/every_q
>>
>> Now, you can make the eval function polymorphic in several ways, simplest
>> is to case or cond on some property of x. You could also use multimethods
>> or a protocol to achieve this.
>>
>> https://insideclojure.org/2015/04/27/poly-perf/
>>
>> Erik.
>> --
>> i farta
>>
>> 15. aug. 2020 kl. 02:04 skrev matthew...@gmail.com <
>> matthewdowne...@gmail.com>:
>>
>> 
>>
>> Another option would be to do what Alex is suggesting and define and as
>> a function. Just because it’s a macro in clojure.core doesn’t mean you
>> can’t write your own :)
>>
>> (defn eval' [x]
>>   (if (map? x)
>> (apply (:fn x) (:coll x))
>> x))
>>
>> (defn and-list [& items]
>>   (let [if? (fn [x] (if x true false))
>> and' (fn [& args] (every? if? args))]
>> {:fn and' :coll items}))
>>
>> (eval' true) ;=> true
>> (eval' false) ;=> false
>> (eval' (and-list 1 2 3)) ;=> true
>> (eval' (and-list 1 2 3 false)) ;=> false
>>
>> Ditto with or.
>> ​
>> On Friday, August 14, 2020 at 4:27:19 PM UTC-5 jack...@topicquests.org
>> wrote:
>>
>>> Alex,
>>>
>>> I plan to explore this idea.
>>> Many thanks!
>>>
>>> Jack
>>>
>>> On Fri, Aug 14, 2020 at 1:38 PM Oleksandr Shulgin <
>>> oleksand...@zalando.de> wrote:
>>>
>>>> 
>>>>
>>>>
>>>> Nevermind transducers: I've just realized that reduced can be used with
>>>> the normal reduce.  E.g. here's short-circuiting AND-reduction fn:
>>>>
>>>> (defn andr
>>>>   ([] true)
>>>>   ([i] i)
>>>>   ([r i] (let [o (and r i)]
>>>>(if o
>>>>  o
>>>>  (reduced o)
>>>>
>>>> When it comes to the actual lists, it depends how you'd like to
>>>> represent them.  E.g. I could imagine something like the following can be a
>>>> useful notation:
>>>>
>>>> [:and 1 2 [:or 3 4] 5]
>>>>
>>>> or even more direct:
>>>

Re: Cognitect joins Nubank!

2020-07-24 Thread Brandon R
>
> I think this will *compound interest* in the language!
>

Brilliant. Also that's quite an impressive *army* of Clojure devs at Nubank.

On Fri, Jul 24, 2020 at 6:17 AM David Powell  wrote:

>
> I think this will *compound interest* in the language!
>>
>
> Nice.  And congratulations Clojure team!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to 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/CAEBWtKjXgrJLEZUeeNbjARAsuFBvyqF9YQr%2B1pikZa5D42kLmg%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/CAB_6y6GEcJZ4-dvJFnXiQUuHVmUmXhovkmT3j2Q1ZX-AMqRDpw%40mail.gmail.com.


A template for web apps with user auth using OWASP best practices and pedestal

2020-06-16 Thread Brandon R
Hello,

I've recently been working on building a web app with authentication using
specific libraries and tooling that I wanted to use. I separated that part
out into a separate repo for my own reference later, and for anyone who
might find it useful.

https://github.com/bpringe/auth-template

Features:

   - user sign up with email address
   - email verification via link with token emailed to user
   - user login
   - user logout
   - forgot password / password reset

Tooling:

   - clojure cli
   - pedestal for the backend service
   - java-time for handling time and dates
   - postal for sending emails
   - yogthos/config for configuration
   - next.jdbc for database interaction
   - hiccup for rendering html
   - buddy-hashers for hashing passwords and checking raw passwords against
   stored hashes
   - hikaricp for database connection pooling
   - docker for packaging and deployment
   - shadow-cljs for clojurescript compilation


Happy Clojuring,
Brandon

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to 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/CAB_6y6GDg5ZW-JtnPWOuX-9_rosmagnj1r10O8of%2BFjM%2B-k2Og%40mail.gmail.com.


Re: Conceptual difference between map and class

2020-04-04 Thread Brandon R
I think someone else here could give a more detailed answer, and I will
just give it from my point of view. What I really like about Clojure,
coming from C# and JavaScript (and toying with other languages), is the
immutability, the concurrency features, the state management features, and
the concision of the language. These benefits become better understood with
time of usage, but I can say that in my experience, the code that I write
in Clojure is much more bug-free, much more concise, and much easier to
understand (there is way less code to reason about).

If you haven't watched Rich Hickey talks, I recommend Are We There Yet? and
Simple Made Easy. These talks really helped change my perspective on, at
least, imperative / OOP oriented languages. among other things.




On Fri, Apr 3, 2020 at 10:24 PM Dieter Van Eessen <
dieter.van.ees...@gmail.com> wrote:

> Thanks, I'm currently reading the book you mentioned (Joy of Clojure).
> Just started on 'Types, protocols and records'...
> Still doubting if I should continue learning clojure. From my point of
> view, the only major advantages of the language so far, are 'clojurescript'
> and the idea that I can evaluate stuff that I've 'printed' (data is code is
> data).
> Other than that, they are messing with my head by redefining existing
> abstraction and making them 'almost equal but slightly different'.
>
> kind regards,
> Dieter
>
> On Wednesday, April 1, 2020 at 6:44:07 AM UTC+2, James Gatannah wrote:
>>
>> It might be worth mentioning that, ultimately, python class instances are
>> syntactical sugar built around an internal __dict__. It gets twistier,
>> since classes are also instances of the base class object.
>>
>> It would be tricky (though I've seen an example...maybe in Joy of
>> Clojure? I think the author's conclusion was that it was an interesting
>> experiment, but not worth doing in practice) to implement inheritance using
>> clojure maps.
>>
>> For me, the conceptual difference has been that it's better to just write
>> functions that work on simple data structures, rather than tying a few
>> together into a unit that only work on a single data structure (plus its
>> derived classes). Clojure's emphasis on functional purity is another major
>> piece of this puzzle.
>>
>> Unit testing is one thing that becomes much easier with this approach.
>>
>> I deal with a ton of python code that has tests built around dozens of
>> mock objects mimicking things like database records from an ORM. And then
>> we mock out a few low-level HTTP calls in base classes so the class
>> instances we're trying to test in isolation don't break when we run the
>> tests with no web server to call. Then someone refactors the code, and all
>> the tests break because they're tied to a specific package/module structure.
>>
>> By contrast, if you have your business logic in one set of pure
>> functions, and you keep your side-effecting parts well isolated on the
>> fringes of your system, you don't need any of that. Just call the business
>> logic function with appropriate values and double-check the results.
>>
>> You absolutely can write python code that way. But your pythonic
>> colleagues will hate you for it.
>>
>> Hope that helps,
>> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/clojure/9214c10a-8c9f-465a-9163-e1684d919693%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/CAB_6y6FSvG%2BoOFaKKaojD16Jz1zzH0fuLoU3H1X_FMRzFsucog%40mail.gmail.com.


Re: Noob: Getting (re)started with Clojure on OS X

2020-03-28 Thread R Aguilera
I was having the same issue as above and deleting my `lein` folder in my 
root directory solved my issue. Thank you so much, I was about to give up 
learning Clojure.

On Wednesday, March 13, 2019 at 10:20:08 AM UTC-7, Sean Corfield wrote:
>
> Check what’s in your ~/.lein/profiles.clj file – that’s usually the cause 
> of bizarre errors that people report with Leiningen.
>
>  
>
> Also check your environment variables: env|fgrep CLASSPATH
>
>  
>
> Per the warning, you probably want to remove whatever is setting that 
> (from one of your shell’s dot files, perhaps?).
>
>  
>
> Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
>  
> --
> *From:* clo...@googlegroups.com   > on behalf of Kenneth Reid Beesley  >
> *Sent:* Wednesday, March 13, 2019 9:47:24 AM
> *To:* Clojure
> *Subject:* Noob: Getting (re)started with Clojure on OS X 
>  
> I played happily with Clojure/leiningen several years ago, on OS X, but 
> I'm having trouble getting restarted. 
>
> I have
> macOS High Sierra Version 10.13.6
> java version 1.8.0_05
>
> and I just did
>
> $ brew upgrade leiningen
> (it confirms that I have leiningen 2.9.1 already installed)
>
> and
> $ brew install clojure
> (I now have stable 1.10.0.414)
>
> But then I try
>
> $ lein repl
>
> and get
>
> WARNING: You have $CLASSPATH set, probably by accident.
>
> It is strongly recommended to unset this before proceeding.
>
> clojure.lang.Compiler$CompilerException: Syntax error compiling at 
> (cider/nrepl.clj:1:1).
>
> #:clojure.error{:phase :compile-syntax-check, :line 1, :column 1, :source 
> "cider/nrepl.clj"}
>
>  at clojure.lang.Compiler.load (Compiler.java:7647)
>
> ...
>
>
> and
>
>
> Caused by: java.io.FileNotFoundException: Could not locate 
> clojure/tools/nrepl/server__init.class, clojure/tools/nrepl/server.clj or 
> clojure/tools/nrepl/server.cljc on classpath.
>
>  at clojure.lang.RT.load (RT.java:466)
>
> ...
>
>
> 
>
>
> So, where am I going wrong?  How do I get back in the Clojure saddle on OS 
> X?
>
>
> Ken Beesley
>
> -- 
> 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 .
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/f9e93234-e861-4ca6-a4a2-a993a321b2db%40googlegroups.com.


Re: A Concise Guide to Getting Started with Clojure on Windows

2019-10-17 Thread Brandon R
Hi Alex!

That would be great actually. I'll read over that and see about getting in
on there.


Brandon

On Thu, Oct 17, 2019 at 7:05 PM Alex Miller  wrote:

> We'd be happy to host a guide like this on clojure.org if you're
> interested...
>
> https://clojure.org/community/contributing_site
>
> Alex
>
> On Thursday, October 17, 2019 at 7:47:03 PM UTC-5, Brandon R wrote:
>>
>> Hello Clojure friends,
>>
>> I wrote this guide for a friend, and it's something I wish I had when I
>> was starting. This guide focuses on Windows, VS Code, and Calva, though
>> much of it would be useful to non-Windows users as well.
>>
>> Beginner resources have come a long way since I started, but there can
>> never be too many. If you know someone who wants to get started with
>> Clojure and is using Windows and/or VS Code, they may find this useful:
>>
>> https://gist.github.com/bpringe/4f1d07f98633a956a8b33af572e7b810
>>
>>
>> Sincerely,
>>
>> Brandon (@bringe on the Clojurians Slack)
>>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to 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/be9cf9ed-068a-4fde-a097-f71e0a38ec07%40googlegroups.com
> <https://groups.google.com/d/msgid/clojure/be9cf9ed-068a-4fde-a097-f71e0a38ec07%40googlegroups.com?utm_medium=email&utm_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/CAB_6y6G_xt8HBzCro1zyF3FDtzDfQe%2BJoc8Dwe3z9rhmu2d25Q%40mail.gmail.com.


A Concise Guide to Getting Started with Clojure on Windows

2019-10-17 Thread Brandon R
Hello Clojure friends,

I wrote this guide for a friend, and it's something I wish I had when I was
starting. This guide focuses on Windows, VS Code, and Calva, though much of
it would be useful to non-Windows users as well.

Beginner resources have come a long way since I started, but there can
never be too many. If you know someone who wants to get started with
Clojure and is using Windows and/or VS Code, they may find this useful:

https://gist.github.com/bpringe/4f1d07f98633a956a8b33af572e7b810


Sincerely,

Brandon (@bringe on the Clojurians Slack)

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


A Clojure wrapper for the Coinbase Pro exchange API

2018-08-31 Thread Brandon R
I've just released a library that serves as a wrapper around the Coinbase 
Pro cryptocurrency exchange API. I'm still pretty new to Clojure, and took 
this project on partly for learning, and because I figured it was something 
someone would actually find useful. This is my first open source project, 
so it helped me to learn more about open source as well. Anyway, I hope 
someone can find it useful, and I intend to actively maintain and improve 
it where necessary. I welcome constructive criticism and suggestions, 
whether it be about code quality, code organization, documentation 
additions or fixes, or anything else.

https://github.com/bpringe/coinbase-pro-clj


Thanks,

Brandon

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to 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: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-19 Thread Joe R . Smith
Building off of something Benoit mentioned about conj not being about order, 
but about adding to a collection, consider conj’s behavior when adding a 
map-entry to a hash-map: 

(conj (hash-map :a 4 :c 1) [:b 3])
=> {:c 1, :b 3, :a 4}

conj is an interface for adding– not to be conflated with order.




On Jul 19, 2018, at 10:23 AM, Christian Seberino mailto:cseber...@gmail.com> > wrote:

Thanks.  I caught that yesterday.  Like I said, I'm definitely a beginner. ;)

On Thursday, July 19, 2018 at 2:05:20 AM UTC-5, Vladimir Bokov wrote:
First of all, def in a fn body is antipattern (use let), then do into on a 
itself

(defn concat_ [a b]
  (if (vector? a)
    (into a b)
    (concat a b)))

четверг, 19 июля 2018 г., 4:07:46 UTC+7 пользователь Christian Seberino написал:
I'm just a Clojure beginner but it seems that the Lisp Way(TM) is to append and 
prepend one or more elements
with a single command if possible.  The logical name for this command seems to 
be concat which led to this..

(defn concat_ [a b]
      (def c (concat a b))
      (if (vector? a)
          (into [] c)
          c))

(concat_ [1 2] [3 4]) => [1 2 3 4]

(concat_ '(1 2) '(3 4)) => (1 2 3 4)

(concat_ [1] [2 3]) => [1 2 3]

Lists return lists and vectors return vectors.  Simple.
Yes yes I know it is slow.  I also know I need to expand concat_ to handle 
other data structures.

In my little newbie world, this "feels" like the ultimate "right" solution.

Chris


-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com 
 
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com 
 
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en 
 
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com 
 .
For more options, visit https://groups.google.com/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: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-16 Thread Joe R . Smith
FWIW, the same is true for the inverse operation. 

If you pop an item off a list you’ll get the list, less the item you conj’d. 
Same is true with a vector. 

---
Joe R. Smith
j...@uwcreations.com <mailto:j...@uwcreations.com> 
@solussd


On Jul 16, 2018, at 4:31 PM, Alex Miller mailto:a...@puredanger.com> > wrote:



On Monday, July 16, 2018 at 4:08:47 PM UTC-5, solussd wrote:
Another way to think about it is lists and vectors are different and the 
idiomatic way to add items to them is different. 

I would say different data structures have different ways to *efficiently* add 
items to them, and conj is an operation to add items efficiently (meaning, 
sub-linear time). So when you see conj, you know it is always a "fast" 
operation. 
 A (singly-linked) list is usually prepended to (otherwise you have to walk the 
entire list to find the end). A vector is usually added to at it’s n+1 index, 
where n is the size of the vector. The conj function is polymorphic.

cons takes a seq and returns a seq. It only cares that it can get a seq on 
whatever collection you give it and will always prepend to that seq.

Slight modification - I would say cons takes a *seqable* and returns a seq. For 
example, a vector is seqable, but not a seq.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com 
<mailto:clojure@googlegroups.com> 
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com 
<mailto:clojure+unsubscr...@googlegroups.com> 
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en 
<http://groups.google.com/group/clojure?hl=en> 
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com 
<mailto: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: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-16 Thread Joe R . Smith
Another way to think about it is lists and vectors are different and the 
idiomatic way to add items to them is different. A (singly-linked) list is 
usually prepended to (otherwise you have to walk the entire list to find the 
end). A vector is usually added to at it’s n+1 index, where n is the size of 
the vector. The conj function is polymorphic.

cons takes a seq and returns a seq. It only cares that it can get a seq on 
whatever collection you give it and will always prepend to that seq.

On Jul 16, 2018, at 3:15 PM, Christian Seberino mailto:cseber...@gmail.com> > wrote:

I'm impressed with Clojure syntax and I'm still a beginner.

I noticed conj behaves differently for lists and vectors.  I also noticed cons 
does not return a vector for a vector input.

Is there any downside to make 2 macros...prepend and append that behave the 
same for lists and vectors, and also,
return same types as inputs?

If I'm not mistaken, I believe it is for performance reasons that these are not 
already in the standard language?
For those that care about performance, it would be beholden on them to pick the 
correct macro for their
specific data structure.

Good idea?

Thanks!

Chris



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

2018-03-08 Thread Joe R . Smith
Definitely give Pedestal a look. There is also wonderful Lacinia integration (a 
Clojure GraphQL library). 

Pedestal’s notable capabilities: 
https://github.com/pedestal/pedestal/blob/master/README.md#notable-capabilities

---
Joe Smith
j...@uwcreations.com  
@solussd


On Mar 8, 2018, at 11:19 AM, Erik Assum mailto:e...@assum.net> 
> wrote:

As always, the answer is it depends. 
If I were to greenfield some personal project now, I’d probably go with bidi, 
since I’d probably just end up with two endpoints. One for accepting graphql 
queries and one for accepting commands. 

At work there is always more requirements, like development speed and maturity 
which would probably guide me to using compojure-api, the probably safe and 
boring bet. 

Erik. 
-- 
i farta

8. mar. 2018 kl. 17:40 skrev jmckitr...@gmail.com  
:

So it sounds like your choice would be compojure-api, correct?

On Thu, Mar 8, 2018 at 11:28 AM Erik Assum mailto:e...@assum.net> > wrote:
Hi, 

On my current project, we’re using compojure with liberator. It works, but 
there are a few down sides as far as I can see:
Compojure is opaque, eg the routing is expressed using functions/macros, where 
as other routing libs like bidi and reitit
(https://github.com/metosin/reitit) express the routing as data. Also, AFAIK 
compojure is not bi-directional, if that’s a need you have.
Compojure doesn’t offer coercion/swagger out of the box, but compojure-api 
fixes that.

Another thing to be aware of is schema vs spec support. Compojure-API has 
support for both.

As for liberator vs yada, I have noe clear opinion.

Erik.

On 8 Mar 2018, at 17:14, Jonathon McKitrick mailto:jmckitr...@gmail.com> > wrote:

I’m looking at Liberator for our first web API project. But I’m also 
considering Compojure-API and Yada. Any thoughts from anyone who’s done this 
comparison, or has used one of them?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com 
 
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com 
 
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en 
 
--- 
You received this message because you are subscribed to 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 a topic in the Google 
Groups "Clojure" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/clojure/Jic0ijhdTEI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
clojure+unsubscr...@googlegroups.com 
 .
For more options, visit https://groups.google.com/d/optout.
-- 
Jonathon McKitrick

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

Re: ANN: Cognitect acquired by Microsoft

2017-04-01 Thread Joe R . Smith
Beware the 1st of April. 

---
Joseph Smith
j...@uwcreations.com  
@solussd


On Apr 1, 2017, at 3:00 PM, Gregg Reynolds mailto:d...@mobileink.com> > wrote:

made ya look!


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


Customizing error messages reported by spec.explain

2016-07-05 Thread Balaji R Rao
Greetings!

Can someone please tell me if the error messages reported by spec.explain 
can be customized ? I'm trying to use spec for data validation and would 
like to generate human readable errors.

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.


Re: remove a deployed artifact from clojars?

2016-04-17 Thread Kyle R. Burton
That's the one :)


Kyle

On Sunday, April 17, 2016, Sean Corfield  wrote:

> I assume this is the one that should not be there:
>
>
>
> https://clojars.org/repl-from-java
>
>
>
> Sean Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
>
>
> On 4/17/16, 9:58 AM, "Kyle R. Burton"   on behalf of
> kyle.bur...@gmail.com
> > wrote:
>
>
>
> Forgot the link (though it shouldn't matter):
>
>
>
> [1] https://clojars.org/com.github.kyleburton/repl-from-java
>
>
>
> On Sun, Apr 17, 2016 at 12:57 PM, Kyle R. Burton  > wrote:
>
> Hi,
>
>
>
> I just published a project [1] to clojars and neglected to use an
> organization.  I don't really want to claim a top-level name for the
> project.  Is there a way to unpublish, remove or otherwise deprecate a
> project that I've pushed to clojars.org?  Sorry if it's obvious and I'm
> not seeing it in the clojars interface.
>
>
>
>
>
> Kyle
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> 
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> 
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to 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.
>


-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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

2016-04-17 Thread Kyle R. Burton
Forgot the link (though it shouldn't matter):

[1] https://clojars.org/com.github.kyleburton/repl-from-java

On Sun, Apr 17, 2016 at 12:57 PM, Kyle R. Burton 
wrote:

> Hi,
>
> I just published a project [1] to clojars and neglected to use an
> organization.  I don't really want to claim a top-level name for the
> project.  Is there a way to unpublish, remove or otherwise deprecate a
> project that I've pushed to clojars.org?  Sorry if it's obvious and I'm
> not seeing it in the clojars interface.
>
>
> Kyle
>
> --
> Twitter: @kyleburton
> Github: https://github.com/kyleburton
> Blog: http://asymmetrical-view.com/
> Fun: http://snapclean.me/
>



-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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


remove a deployed artifact from clojars?

2016-04-17 Thread Kyle R. Burton
Hi,

I just published a project [1] to clojars and neglected to use an
organization.  I don't really want to claim a top-level name for the
project.  Is there a way to unpublish, remove or otherwise deprecate a
project that I've pushed to clojars.org?  Sorry if it's obvious and I'm not
seeing it in the clojars interface.


Kyle

-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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

2016-03-29 Thread Kyle R. Burton
There are at least two companies in Philadelphia that use Clojure:

* Relay Network (their engineering office is in center city Philly)
* RJ Metrics

I don't know if either is looking for interns, I think both are hiring.  I
used to be at Relay and can put you in touch with people there.  I've never
worked for RJ Metrics, but have worked with several of their people - I'd
be happy to put you in touch with them as well.

Best Regards,

Kyle

On Tue, Mar 29, 2016 at 4:25 PM, Jason Basanese 
wrote:

> I recently have been looking for summer internships. However most of the
> companies I find either do not know what Clojure is or are certain they
> want nothing to do with it as they would much rather stick to Java or
> Javascript. Yes I know that Clojure compiles to both of those but this
> seems to be a mute point in most cases. It is a mute point because telling
> an employer you could make really great black boxes for them is not exactly
> alluring.
>
> Do you guys know of any companies that use Clojure? Have any suggestions
> on how to present Clojure in a more appealing manner? General suggestions
> on where to look for jobs in Clojure, such as startups vs large companies
> or job fairs vs online applications? Basically any suggestion as to how to
> find a job in the field with Clojure?
>
> I have grown to love the language but am failing to find a market for it.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to 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.
>



-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to 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 is the emphasis of “data over code” different than the XML advocacy of the early 2000s?

2016-02-01 Thread Joe R. Smith
The reason XML has a bad rap is because it has been used for things like 
configuration files. XML was intended as a host/platform/language-agnostic data 
interchange format, not something humans would write by hand, much less have to 
read. 



> On Feb 1, 2016, at 4:02 PM, Josh Tilles  wrote:
> 
> As I’m watching Michael Drogalis’s Clojure/Conj 2015 presentation “Onyx: 
> Distributed Computing for Clojure” 
> , I'm distracted by a nagging 
> worry that we —as a community— are somehow falling into the same trap as the 
> those advocating XML in the early 2000s. That said, it's a very vague unease, 
> because I don’t know much about why the industry seems to have rejected XML 
> as “bad”; by the time I started programming professionally there was already 
> a consensus that XML sucked, and that libraries/frameworks that relied 
> heavily on XML configuration files were to be regarded with suspicion and/or 
> distaste.
> 
> So, am I incorrect in seeing a similarity between the “data > code” mentality 
> and the rise of XML? Or, assuming there is a legitimate parallel, is it 
> perhaps unnecessary to be alarmed? Does the tendency to use edn instead of 
> XML sidestep everything that went wrong in the 2000s? Or is it the case that 
> the widespread backlash against XML threw a baby out with the bathwater, 
> forgetting the advantages of data over code?
> 
> Cheers,
> Josh
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en 
> 
> --- 
> You received this message because you are subscribed to 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] Sparkling, a Clojure-API to Apache Spark.

2016-01-17 Thread Drew R
Hi,
Is it possible to run lein repl against standalone spark cluster?
I launched cluster on localhost with master at spark://zhmyh-osx.local:7077 
and tried to run following commands: 

(require '[sparkling.conf :as conf])

(require '[sparkling.core :as spark])

(def c (-> (conf/spark-conf)
   (conf/master "spark://zhmyh-osx.local:7077")
   (conf/app-name "sparkling-example")))

(def sc (spark/spark-context c))

(def data (spark/parallelize sc ["a" "b" "c" "d" "e"]))

(spark/first data)

and got this
tf-idf.core=> (spark/first data)
2016-01-17 10:42:22,977  INFO spark.SparkContext:59 - Starting job: first 
at NativeMethodAccessorImpl.java:-2
2016-01-17 10:42:23,004  INFO cluster.SparkDeploySchedulerBackend:59 - 
Registered executor: 
AkkaRpcEndpointRef(Actor[akka.tcp://sparkExecutor@192.168.200.217:54884/user/Executor#797341151])
 
with ID 0
2016-01-17 10:42:23,014  INFO scheduler.DAGScheduler:59 - Got job 0 (first 
at NativeMethodAccessorImpl.java:-2) with 1 output partitions
2016-01-17 10:42:23,015  INFO scheduler.DAGScheduler:59 - Final stage: 
ResultStage 0(first at NativeMethodAccessorImpl.java:-2)
2016-01-17 10:42:23,016  INFO scheduler.DAGScheduler:59 - Parents of final 
stage: List()
2016-01-17 10:42:23,017  INFO scheduler.DAGScheduler:59 - Missing parents: 
List()
2016-01-17 10:42:23,031  INFO scheduler.DAGScheduler:59 - Submitting 
ResultStage 0 (# 
ParallelCollectionRDD[0] at parallelize at 
NativeMethodAccessorImpl.java:-2), which has no missing parents
2016-01-17 10:42:23,247  INFO cluster.SparkDeploySchedulerBackend:59 - 
Registered executor: 
AkkaRpcEndpointRef(Actor[akka.tcp://sparkExecutor@192.168.200.217:54886/user/Executor#-391700515])
 
with ID 1
2016-01-17 10:42:23,265  INFO storage.MemoryStore:59 - 
ensureFreeSpace(1512) called with curMem=0, maxMem=1030823608
2016-01-17 10:42:23,268  INFO storage.MemoryStore:59 - Block broadcast_0 
stored as values in memory (estimated size 1512.0 B, free 983.1 MB)
2016-01-17 10:42:23,349  INFO storage.BlockManagerMasterEndpoint:59 - 
Registering block manager 192.168.200.217:54890 with 530.0 MB RAM, 
BlockManagerId(0, 192.168.200.217, 54890)
2016-01-17 10:42:23,482  INFO storage.BlockManagerMasterEndpoint:59 - 
Registering block manager 192.168.200.217:54891 with 530.0 MB RAM, 
BlockManagerId(1, 192.168.200.217, 54891)
2016-01-17 10:42:23,639  INFO storage.MemoryStore:59 - ensureFreeSpace(976) 
called with curMem=1512, maxMem=1030823608
2016-01-17 10:42:23,640  INFO storage.MemoryStore:59 - Block 
broadcast_0_piece0 stored as bytes in memory (estimated size 976.0 B, free 
983.1 MB)
2016-01-17 10:42:23,643  INFO storage.BlockManagerInfo:59 - Added 
broadcast_0_piece0 in memory on 127.0.0.1:54879 (size: 976.0 B, free: 983.1 
MB)
2016-01-17 10:42:23,646  INFO spark.SparkContext:59 - Created broadcast 0 
from broadcast at DAGScheduler.scala:861
2016-01-17 10:42:23,652  INFO scheduler.DAGScheduler:59 - Submitting 1 
missing tasks from ResultStage 0 (# ParallelCollectionRDD[0] at parallelize at 
NativeMethodAccessorImpl.java:-2)
2016-01-17 10:42:23,654  INFO scheduler.TaskSchedulerImpl:59 - Adding task 
set 0.0 with 1 tasks
2016-01-17 10:42:23,720  INFO scheduler.TaskSetManager:59 - Starting task 
0.0 in stage 0.0 (TID 0, 192.168.200.217, PROCESS_LOCAL, 1946 bytes)
2016-01-17 10:42:23,928  WARN scheduler.TaskSetManager:71 - Lost task 0.0 
in stage 0.0 (TID 0, 192.168.200.217): java.lang.IllegalStateException: 
unread block data
at 
java.io.ObjectInputStream$BlockDataInputStream.setBlockDataMode(ObjectInputStream.java:2431)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1383)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2000)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1924)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
at 
org.apache.spark.serializer.JavaDeserializationStream.readObject(JavaSerializer.scala:72)
at 
org.apache.spark.serializer.JavaSerializerInstance.deserialize(JavaSerializer.scala:98)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:194)
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)

2016-01-17 10:42:23,942  INFO scheduler.TaskSetManager:59 - Starting task 
0.1 in stage 0.0 (TID 1, 192.168.200.217, PROCESS_LOCAL, 1946 bytes)
2016-01-17 10:42:24,145  INFO scheduler.TaskSetManager:59 - Lost task 0.1 
in stage 0.0 (TID 1) on executor 192.168.200.217: 
java.lang.IllegalStateException (unread block data) [duplicate 1]
2016-01-17 10:42:24,155  INFO scheduler.TaskSetManager:59 - Starting task 
0.2 in stage 0.0 (TID 2, 192.168.200.217, PROCESS_LOCAL, 1946 bytes)
2016-01-17 10:42:24,168  INFO scheduler.TaskSetManager:59 - L

Re: Define new defn, lein uberjar succeeds to compile but lein run fails

2015-11-25 Thread Benjamin R. Haskell
It sounds like you're looking for refer-clojure:
https://clojuredocs.org/clojure.core/refer-clojure

E.g., for your project:

(ns mw.mwm
  (:require
   [clojure.pprint :as pp]
   [clojure.walk :as walk])
  (:refer-clojure :exclude [defn])
  (:gen-class))

Tested in a fork:
https://github.com/mattiasw2/cdn77-purge/compare/renamed_to_defn...benizi:fix-defn-issue

Defining your own `defn` is a fairly unorthodox thing to do.  (Usually it's
less Clojure-centric names that cause problems, like `time` from the
example, or `filter`, `min`, or `max`.)  Based on your comment
,
it seems easier to just write a different version of `get` that handles
nils the way you want, instead of complicated macro behavior.  E.g.:

(defn get!   ;; "!" seems better than "?" to indicate the "dangerous" assert
  "Get a value out of a map, asserting it is non-nil"
  [from key]
  (let [val (get from key)]
(assert (some? val) (str key " is nil"))
val))

Seems much more straightforward than a macro that translates (:key? map) to
something roughly equivalent to (get! map :key).

Best,
Ben

On Wed, Nov 25, 2015 at 3:29 AM, mattias w  wrote:

> I moved my own definition of defn to a separate project, and then it
> works. It seems you cannot redefine defn within the same project it is used.
>
>
> Den fredag 13 november 2015 kl. 13:46:56 UTC+1 skrev mattias w:
>>
>> I defined my own defn in the namespace mwm.
>>
>>
>> My new code looks like this
>>
>>
>> (mwm/defn foo [x] ...)
>>
>>
>> Everything was fine as long as it was called defn2, but after renaming it
>> to defn and refering to the original defn using clojure.core/defn, only
>> "lein uberjar" works.
>>
>> When I run "lein run", the compilation fails as
>>
>>
>> c:\data3\clojure\cdn77-purge>lein run
>> WARNING: defn already refers to: #'clojure.core/defn in namespace: mw.mwm, 
>> being
>>  replaced by: #'mw.mwm/defn
>> Exception in thread "main" java.lang.ClassNotFoundException: mw.mw1, 
>> compiling:(
>> mw/mw1.clj:40:1)
>> at clojure.lang.Compiler.analyze(Compiler.java:6543)
>> at clojure.lang.Compiler.analyze(Compiler.java:6485)
>> at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3791)
>> at clojure.lang.Compiler.analyzeSeq(Compiler.java:6725)
>>
>>
>> The code can be found at
>> https://github.com/mattiasw2/cdn77-purge/tree/renamed_to_defn
>>
>>
>>
>> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to 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: Largest Clojure codebases?

2015-11-16 Thread Kyle R. Burton
At the last company I was with I used sloccount [1] to analyze the
codebase.  I concatenated all the clj files to a .lisp file so sloccount
could analyze it.  I was curious about the cost estimate that sloccount
performs to see how the team measured up (size varied from 2 to 7 over 5
years).  When I did the analysis (over a year ago) we had about 130k lines
of Clojure that represented about two dozen libraries and bout six
services.  Including the javascript, java, C, Ruby and other languages in
our repositories, sloccount estimated over 5x the person years we actually
spent.  This team was also responsible for the whole stack - production
operations, releases, etc.  If someone is doing research, I'd be happy to
reach out to a colleague to see if they would run the analysis again.


Kyle


[1] http://www.dwheeler.com/sloccount/

On Sun, Nov 15, 2015 at 4:06 PM, dennis zhuang  wrote:

> I use cloc(http://cloc.sourceforge.net/) to counting the LOC of our
> projects, it's total about 41025 lines of Clojure  code.
>
>
>
>
>
>
> 2015-11-16 7:22 GMT+08:00 Colin Yates :
>
>> Exactly this. I couldn’t find a reliable way of counting LOC but my
>> (Clojure/ClojureSciprt) src tree (excluding test) in the project I have to
>> hand is 1.5MB.
>>
>>
>> On 15 Nov 2015, at 21:27, Timothy Baldridge  wrote:
>>
>> It's funny, because most of the larger OOP projects I worked on were
>> large because of class bloat, not because of business concerns. For
>> example, the C# app I used to work on was a more or less simple CRUD app.
>> We had a ORM that served up objects to a Silverlight UI. So if we wanted to
>> display information about a person on the UI we normally had to modify
>> around 5 classes in 5 files. We had the following layers
>>
>> ORM - 1.4MB of generated C# for interfacing with the 200 or so SQL tables
>> we had
>> DTO - Data Transfer Object, where used "normal" C# objects to abstract
>> the ORM. This is where we had the "Person" object
>> API - A web service that served up DTOs over HTTP
>> Data Model - Processed views of DTOs formatted in a way that was easily
>> viewable by the UI
>> View Model - UI classes that would take data from a Data Model and emit
>> UI controls.
>>
>> All of that ceremonythat is replaced by one thing in Clojure...data.
>> Hashmaps and vectors replace all the junk you see above.
>>
>> So that's where I often assert "Yes, you may have 1 million lines of Java
>> codebut that would only be ~10,000 lines of Clojure." With proper
>> application of data driven systems (data that configures pipelines and
>> writes code) you can easily get a 100:1 ratio of Java to Clojure code.
>>
>> Timothy
>>
>>
>> On Sun, Nov 15, 2015 at 12:48 PM, Marc O'Morain 
>> wrote:
>>
>>> We have a large app at CircleCI - as of September:
>>>
>>> "The repo for our main app contains 93,983 lines of Clojure code. The
>>> src directory of our main app contains 369 namespaces."
>>>
>>> http://blog.circleci.com/why-were-no-longer-using-core-typed/
>>>
>>>
>>>
>>> On Sun, Nov 15, 2015 at 7:22 PM, dilettante.co...@live.com <
>>> dilettante.co...@live.com> wrote:
>>>
 I've been having a (friendly) argument with a friend who is an
 old-school OOP programmer.  He insists that you need objects to make
 large-scale codebases legible and maintainable over the long run.  Quite
 apart from this argument's virtues or lack thereof, this made me curious --
 what are the largest programs written in Clojure in terms of LOC?  I know
 I've seen mentions of 50k-100k LOC projects (World Singles, if I'm
 remembering correctly), but are there any that are larger?

Vikram

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

help on exercises of brave and feedback

2015-11-14 Thread r/ Wobben
Hello, 

What is the best way to find help with exercises of the brave book and 
feedback on the solutions ?
This group, the irc channel or the reddit page ?

Roelof

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

2015-10-23 Thread r/ Wobben
Thanks, 

Still not what I was expecting.

Suppose I have a map called records which has this [{:name ‘roelof’ :city 
‘secret’} {:name ‘somewhere-else’ :city ‘who-knows’}]

When I do : 

(defn convert-back
"converts the map back to a csv string"
  [{:keys [name, glitter-index]}, records ]
  (map (fn [{:keys [name glitter-index]}] (clojure.string/join "," 
[name glitter-index]))) records) 

I see this error message : 

ArityException Wrong number of args (1) passed to: core/convert-back  
clojure.lang.AFn.throwArity (AFn.java:429)

and when im doing : 

(defn convert-back
"converts the map back to a csv string"
  [records ]
  (map (fn [{:keys [name glitter-index]}] (clojure.string/join "," 
[name glitter-index]))) records)  

I see this as output ; 

{:name "roelof", :glitter-index 2}

Frustating to learn clojure 



Op vrijdag 23 oktober 2015 14:50:30 UTC+2 schreef Colin Yates:

> clojure.string/join not clojure.join/string
>
> On 23 Oct 2015, at 13:49, r/ Wobben > 
> wrote:
>
> Thanks, 
>
> I tried it like this : 
>
> (defn convert-back
> "converts the map back to a csv string"
>   [{:keys [name, city]}, records ]
>   (map (fn [{:keys [name city]}] (clojure.join/string “,” [name 
> city]))) records)  
>
> and then I do : (convert-back {:name "roelof" :city: secret}, { :name "X" 
> :city "Earth"} )
>
> and I see this error when running in repl : 
>
> #error {
>  :cause clojure.join
>  :via
>  [{:type clojure.lang.Compiler$CompilerException
>:message java.lang.ClassNotFoundException: clojure.join, 
> compiling:(chapter_4/core.clj:56:47)
>:at [clojure.lang.Compiler analyzeSeq Compiler.java 6730]}
>   {:type java.lang.ClassNotFoundException
>:message clojure.join
>:at [java.net.URLClassLoader$1 run URLClassLoader.java 366]}]
>  :trace
>  [[java.net.URLClassLoader$1 run URLClassLoader.java 366]
>   [java.net.URLClassLoader$1 run URLClassLoader.java 355]
>   [java.security.AccessController doPrivileged AccessController.java -2]
>
> e clojure.join
>  :via
>  [{:type clojure.lang.Compiler$CompilerException
>:message java.lang.ClassNotFoundException: clojure.join, 
> compiling:(chapter_4/core.clj:56:47)
>:at [clojure.lang.Compiler analyzeSeq Compiler.java 6730]}
>   {:type java.lang.ClassNotFoundException
>:message clojure.join
>:at [java.net.URLClassLoader$1 run URLClassLoader.java 366]}]
>  :trace
>  [[java.net.URLClassLoader$1 run URLClassLoader.java 366]
>   [java.net.URLClassLoader$1 run URLClassLoader.java 355]
>   [java.security.AccessController doPrivileged AccessController.java -2]
>
>
> #error {
>  :cause clojure.join
>  :via
>  [{:type clojure.lang.Compiler$CompilerException
>:message java.lang.ClassNotFoundException: clojure.join, 
> compiling:(chapter_4/core.clj:56:47)
>:at [clojure.lang.Compiler analyzeSeq Compiler.java 6730]}
>   {:type java.lang.ClassNotFoundException
>:message clojure.join
>:at [java.net.URLClassLoader$1 run URLClassLoader.java 366]}]
>  :trace
>  [[java.net.URLClassLoader$1 run URLClassLoader.java 366]
>   [java.net.URLClassLoader$1 run URLClassLoader.java 355]
>   [java.security.AccessController doPrivileged AccessController.java -2]
>
> Roelof
>
>
> (convert-back  {:name "roelof" :glitter-index 2 })(convert-back  {:name 
> "roelof" :glitter-index 2 })
>
>
> Op vrijdag 23 oktober 2015 14:25:44 UTC+2 schreef Colin Yates:
>>
>> (apply clojure.string/join “," (vals my-map)) would work but you can’t 
>> guarantee the order.
>>
>> (map (fn [{:keys [name city]}] (clojure.join/string “,” [name city]))) 
>> my-map) gives you control of the order in which the fields are processed.
>>
>> You could also look at juxt as well?
>>
>> On 23 Oct 2015, at 12:49, r/ Wobben  wrote:
>>
>> Hello, 
>>
>> As a challenge I need to convert a map structure to a csv structure. 
>>
>> So ( { :name "roelof", :city secret }) need to be converted to roelof, 
>> secret. 
>>
>> I think I can use something like (map clojure.string/join  ..) for it but 
>> it seems I have to make a function out of the :name roelof part to get 
>> roelof back. 
>>
>> I could use  get for then I do not know how to call 1 records of the 
>> whole map. 
>>
>> Can someone explain in simple English how I can solve this one ? 
>>
>> -- 
>> 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
>> Not

Re: how to make a function of a map argument ?

2015-10-23 Thread r/ Wobben
Thanks, 

I tried it like this : 

(defn convert-back
"converts the map back to a csv string"
  [{:keys [name, city]}, records ]
  (map (fn [{:keys [name city]}] (clojure.join/string “,” [name 
city]))) records)  

and then I do : (convert-back {:name "roelof" :city: secret}, { :name "X" 
:city "Earth"} )

and I see this error when running in repl : 

#error {
 :cause clojure.join
 :via
 [{:type clojure.lang.Compiler$CompilerException
   :message java.lang.ClassNotFoundException: clojure.join, 
compiling:(chapter_4/core.clj:56:47)
   :at [clojure.lang.Compiler analyzeSeq Compiler.java 6730]}
  {:type java.lang.ClassNotFoundException
   :message clojure.join
   :at [java.net.URLClassLoader$1 run URLClassLoader.java 366]}]
 :trace
 [[java.net.URLClassLoader$1 run URLClassLoader.java 366]
  [java.net.URLClassLoader$1 run URLClassLoader.java 355]
  [java.security.AccessController doPrivileged AccessController.java -2]

e clojure.join
 :via
 [{:type clojure.lang.Compiler$CompilerException
   :message java.lang.ClassNotFoundException: clojure.join, 
compiling:(chapter_4/core.clj:56:47)
   :at [clojure.lang.Compiler analyzeSeq Compiler.java 6730]}
  {:type java.lang.ClassNotFoundException
   :message clojure.join
   :at [java.net.URLClassLoader$1 run URLClassLoader.java 366]}]
 :trace
 [[java.net.URLClassLoader$1 run URLClassLoader.java 366]
  [java.net.URLClassLoader$1 run URLClassLoader.java 355]
  [java.security.AccessController doPrivileged AccessController.java -2]


#error {
 :cause clojure.join
 :via
 [{:type clojure.lang.Compiler$CompilerException
   :message java.lang.ClassNotFoundException: clojure.join, 
compiling:(chapter_4/core.clj:56:47)
   :at [clojure.lang.Compiler analyzeSeq Compiler.java 6730]}
  {:type java.lang.ClassNotFoundException
   :message clojure.join
   :at [java.net.URLClassLoader$1 run URLClassLoader.java 366]}]
 :trace
 [[java.net.URLClassLoader$1 run URLClassLoader.java 366]
  [java.net.URLClassLoader$1 run URLClassLoader.java 355]
  [java.security.AccessController doPrivileged AccessController.java -2]

Roelof


(convert-back  {:name "roelof" :glitter-index 2 })(convert-back  {:name 
"roelof" :glitter-index 2 })


Op vrijdag 23 oktober 2015 14:25:44 UTC+2 schreef Colin Yates:
>
> (apply clojure.string/join “," (vals my-map)) would work but you can’t 
> guarantee the order.
>
> (map (fn [{:keys [name city]}] (clojure.join/string “,” [name city]))) 
> my-map) gives you control of the order in which the fields are processed.
>
> You could also look at juxt as well?
>
> On 23 Oct 2015, at 12:49, r/ Wobben > 
> wrote:
>
> Hello, 
>
> As a challenge I need to convert a map structure to a csv structure. 
>
> So ( { :name "roelof", :city secret }) need to be converted to roelof, 
> secret. 
>
> I think I can use something like (map clojure.string/join  ..) for it but 
> it seems I have to make a function out of the :name roelof part to get 
> roelof back. 
>
> I could use  get for then I do not know how to call 1 records of the whole 
> map. 
>
> Can someone explain in simple English how I can solve this one ? 
>
> -- 
> 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/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.


how to make a function of a map argument ?

2015-10-23 Thread r/ Wobben
Hello, 

As a challenge I need to convert a map structure to a csv structure. 

So ( { :name "roelof", :city secret }) need to be converted to roelof, 
secret. 

I think I can use something like (map clojure.string/join  ..) for it but 
it seems I have to make a function out of the :name roelof part to get 
roelof back. 

I could use  get for then I do not know how to call 1 records of the whole 
map. 

Can someone explain in simple English how I can solve this one ? 

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

2015-10-08 Thread r/ Wobben
Oke, 

So you convert the coll first to a sequence and compared it to the reverse.
Does the reversed coll not to be converted to a sequence then? 



Op donderdag 8 oktober 2015 14:10:43 UTC+2 schreef Marc O'Morain:

> This should do it:
>
> (defn palindrome? [coll]
>   (= (seq coll) (reverse coll)))
>
>
> user=> (palindrome? "tattarrattat")
> true
> user=> (palindrome? [1 5 10 10 5 1])
> true
> user=> (palindrome? "marc")
> false
> user=> (palindrome? [1 2 3])
> false
>
>
> On 8 October 2015 at 12:48, r/ Wobben > 
> wrote:
>
>> Chjips you are right. See  this : 
>>
>> (defn palindrome [x]
>>   (if (string? x)
>> (clojure.string/reverse x)
>> (into (empty x) (reverse x
>>
>> (palindrome '( 1 2 3 4)) (1 2 3 4)
>>
>> So back to the drawing table.
>>
>> Roelof
>>
>>
>> Op donderdag 8 oktober 2015 10:59:30 UTC+2 schreef Alan Forrester:
>>
>>> On 8 Oct 2015, at 09:15, r/ Wobben  wrote: 
>>>
>>> > I have now this : 
>>> > 
>>> > (ns fourclojure.core 
>>> >   (:gen-class)) 
>>> > 
>>> > 
>>> > (defn checker [x] 
>>> >   ( = x (if (string? x) 
>>> > (clojure.string/reverse x) 
>>> > (into (empty x) (reverse x) 
>>> > 
>>> > 
>>> > (checker '(1 2 3 4 5)) true 
>>> > 
>>> > 
>>> > ( = '( 1 2 3 4 5) '( 5 4 3 2 1) ) false 
>>> > 
>>> > So something is wrong about my code 
>>> > 
>>> > it works fine with string but not with a set 
>>>
>>> First, ‘(1 2 3 4 5) is a list, not a set. 
>>>
>>> Second, (reverse ‘(1 2 3 4 5)) is  ‘(5 4 3 2 1) and according to the 
>>> docs for into 
>>>
>>> https://clojuredocs.org/clojure.core/into 
>>>
>>> that function conjoins items from (reverse ‘(1 2 3 4 5)) onto  (empty 
>>> ‘(1 2 3 4 5)). The docs for conj tell you what will happen 
>>>
>>> https://clojuredocs.org/clojure.core/conj 
>>>
>>> (empty ‘(1 2 3 4 5)) is a list and conjoining to a list puts items at 
>>> the front of the list not the back, so it puts 5 in at the from, then puts 
>>> 4 in front of the 5 and so on. So you are doing  ( = '( 1 2 3 4 5) ‘(1 2 3 
>>> 4 5)). 
>>>
>>> Alan
>>
>> -- 
>> 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/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: palingdrome problem (4 clojure)

2015-10-08 Thread r/ Wobben
Chjips you are right. See  this : 

(defn palindrome [x]
  (if (string? x)
(clojure.string/reverse x)
(into (empty x) (reverse x

(palindrome '( 1 2 3 4)) (1 2 3 4)

So back to the drawing table.

Roelof


Op donderdag 8 oktober 2015 10:59:30 UTC+2 schreef Alan Forrester:

> On 8 Oct 2015, at 09:15, r/ Wobben > 
> wrote: 
>
> > I have now this : 
> > 
> > (ns fourclojure.core 
> >   (:gen-class)) 
> > 
> > 
> > (defn checker [x] 
> >   ( = x (if (string? x) 
> > (clojure.string/reverse x) 
> > (into (empty x) (reverse x) 
> > 
> > 
> > (checker '(1 2 3 4 5)) true 
> > 
> > 
> > ( = '( 1 2 3 4 5) '( 5 4 3 2 1) ) false 
> > 
> > So something is wrong about my code 
> > 
> > it works fine with string but not with a set 
>
> First, ‘(1 2 3 4 5) is a list, not a set. 
>
> Second, (reverse ‘(1 2 3 4 5)) is  ‘(5 4 3 2 1) and according to the docs 
> for into 
>
> https://clojuredocs.org/clojure.core/into 
>
> that function conjoins items from (reverse ‘(1 2 3 4 5)) onto  (empty ‘(1 
> 2 3 4 5)). The docs for conj tell you what will happen 
>
> https://clojuredocs.org/clojure.core/conj 
>
> (empty ‘(1 2 3 4 5)) is a list and conjoining to a list puts items at the 
> front of the list not the back, so it puts 5 in at the from, then puts 4 in 
> front of the 5 and so on. So you are doing  ( = '( 1 2 3 4 5) ‘(1 2 3 4 
> 5)). 
>
> Alan

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


Re: palingdrome problem (4 clojure)

2015-10-08 Thread r/ Wobben
I have now this : 

(ns fourclojure.core
  (:gen-class))


(defn checker [x]
  ( = x (if (string? x)
(clojure.string/reverse x)
(into (empty x) (reverse x)


(checker '(1 2 3 4 5)) true


( = '( 1 2 3 4 5) '( 5 4 3 2 1) ) false

So something is wrong about my code 

it works fine with string but not with a set 

Roelof





Op woensdag 7 oktober 2015 23:40:11 UTC+2 schreef Erik Assum:

> I do believe that a palindrome could be defined as 
>
> user> (defn palindrome [s] (= s (clojure.string/reverse s))) 
> ;; => #'user/palindrome 
> user> (palindrome "agnesisenga") 
> ;; => true 
> user> 
>
> No need to split in half. 
>
>
> > On 7. okt. 2015, at 20.24, Tristan Strange  > wrote: 
> > 
> > Hey Roelof, 
> > 
> > Moe's answered your question perfectly. 
> > 
> > Unfortunately I'm not sure it'll help you. All that's been written up 
> > there is a reverse function that works on both a string and a 
> > sequence. 
> > 
> > Firstly I think you might need to check up on what a palindrome is: 
> > https://en.wikipedia.org/wiki/Palindrome 
> > 
> > You need to: 
> > - take the first half of the sequence 
> > - take second half 
> > - compare them 
> > 
> > and work around the fact that sometimes sequences have an odd number 
> > of elements. 
> > 
> > Have you seen the take and drop functions yet? They'd really help. As 
> > would Math/floor and Math/ceil. Those, a reverse and an = will make 
> > bob your uncle. 
> > 
> > If you haven't seen them writing a recursive function would be a 
> solution too. 
> > 
> > I'm not sure what the "hint" is about. It seems very misleading to me. 
> > 
> > Good luck! 
> > 
> > Cheers, 
> > Tristan 
> > 
> > 
> > On 7 October 2015 at 19:06, Moe Aboulkheir  > wrote: 
> >> Roelof, 
> >> 
> >> Something like this: 
> >> 
> >> (defn palindrome [x] 
> >>  (if (string? x) 
> >>(clojure.string/reverse x) 
> >>(into (empty x) (reverse x 
> >> 
> >> Alternatively, you may want to consider explicitly using seq on your 
> inputs 
> >> when you get them, and using that of the basis of comparison & input to 
> >> reverse.  If you don't actually care about the concrete sequence type 
> (i.e. 
> >> you only want sensible equality semantics after reversing something), 
> >> dropping it as soon as possible may be a better strategy. 
> >> 
> >> Take care, 
> >> Moe 
> >> 
> >> On Wed, Oct 7, 2015 at 6:51 PM, Roelof Wobben  > 
> >> wrote: 
> >>> 
> >>> Hello, 
> >>> 
> >>> I try to solve a problem for 4clojure where I have to make a 
> palingdrome 
> >>> detector. 
> >>> 
> >>> So for trying I did this : 
> >>> 
> >>> (ns fourclojure.core 
> >>>  (:gen-class)) 
> >>> 
> >>> 
> >>> (defn palingdrome [string] 
> >>>  ( reverse string)) 
> >>> 
> >>> (apply str (palingdrome '( 1 2 3) ))  '321' 
> >>> (apply str (palingdrome "Roelof" )) "foleoR" 
> >>> 
> >>> (defn palingdrome2 [string] 
> >>>  ( reverse string)) 
> >>> 
> >>> (palingdrome2 '( 1 2 3) )  ( 3 2 1 ) 
> >>> (palingdrome2  "Roelof" )  (\f \o \l \e \o \R) 
> >>> 
> >>> So it works for a map or for a string. 
> >>> 
> >>> Is there a way I can make it work for both ? 
> >>> 
> >>> Roelof 
> >>> 
> >>> 
> >>> 
> >>> -- 
> >>> 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 emai

Re: palingdrome problem (4 clojure)

2015-10-07 Thread r/ Wobben
Thanks for the explanation.
For a beginner enough to learn 

Roelof


Op woensdag 7 oktober 2015 21:02:00 UTC+2 schreef Moe Aboulkheir:

> Roelof,
>
> As you noted, reverse doesn't preserve the variety of collection which was 
> passed in - it returns a sequence.  (into A B) appends the items in B onto 
> A, and will return a collection of the same type as A. (empty A) returns a 
> collection of the same type as A, with no items in it.  So with (into 
> (empty A) (reverse A)) we're saying "give me a sequence containing the 
> items in A in reverse order, then conjoin them onto an empty collection 
> having the same type as A".
>
> References:
> -  https://clojuredocs.org/clojure.core/empty
> -  https://clojuredocs.org/clojure.core/into
>
> Take care,
> Moe
>
> On Wed, Oct 7, 2015 at 7:33 PM, Roelof Wobben  > wrote:
>
>> Thanks , that did the trick. 
>>
>> Apperent; string/reverse works different from reverse 
>>
>> One question : what does into do  and does (empty x) means if x is empty 
>> or do you make a empty copy of x. 
>>
>> Roelof
>>
>>
>> Op woensdag 7 oktober 2015 20:07:00 UTC+2 schreef Moe Aboulkheir:
>>>
>>> Roelof,
>>>
>>> Something like this:
>>>
>>> (defn palindrome [x]
>>>   (if (string? x)
>>> (clojure.string/reverse x)
>>> (into (empty x) (reverse x
>>>
>>> Alternatively, you may want to consider explicitly using seq on your 
>>> inputs when you get them, and using that of the basis of comparison & input 
>>> to reverse.  If you don't actually care about the concrete sequence type 
>>> (i.e. you only want sensible equality semantics after reversing something), 
>>> dropping it as soon as possible may be a better strategy.
>>>
>>> Take care,
>>> Moe
>>>
>>> On Wed, Oct 7, 2015 at 6:51 PM, Roelof Wobben  
>>> wrote:
>>>
>>>> Hello, 
>>>>
>>>> I try to solve a problem for 4clojure where I have to make a 
>>>> palingdrome detector.
>>>>
>>>> So for trying I did this : 
>>>>
>>>> (ns fourclojure.core
>>>>   (:gen-class))
>>>>
>>>>
>>>> (defn palingdrome [string] 
>>>>   ( reverse string))
>>>>
>>>> (apply str (palingdrome '( 1 2 3) ))  '321'
>>>> (apply str (palingdrome "Roelof" )) "foleoR"
>>>>
>>>> (defn palingdrome2 [string] 
>>>>   ( reverse string))
>>>>
>>>> (palingdrome2 '( 1 2 3) )  ( 3 2 1 ) 
>>>> (palingdrome2  "Roelof" )  (\f \o \l \e \o \R)
>>>>
>>>> So it works for a map or for a string.
>>>>
>>>> Is there a way I can make it work for both ? 
>>>>
>>>> Roelof
>>>>
>>>>
>>>>
>>>> -- 
>>>> 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/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.com 
>> 
>> 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/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.


midje only 1 test

2015-09-03 Thread r/ Wobben
hello, 

Suppose I have this test  

(facts "do-a-thing" {:exercise 1 :points 1} (do-a-thing 3) => 46656.0 (
do-a-thing 1) => 4.0 (do-a-thing 0) => 1.0)
Is there a way I can only run this test 
I tried lein midje :filter exercise 1 
but that one fails.

Roelof

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

2015-09-02 Thread r/ Wobben
Another question from a beginner.

How do I add klein here : 

(defproject i-am-a-horse-in-the-land-of-booleans "1.0.0-SNAPSHOT"
  :dependencies [[org.clojure/clojure "1.5.1"]
 [iloveponies.tests/i-am-a-horse-in-the-land-of-booleans 
"0.1.0-SNAPSHOT"]]
  :profiles {:dev {:plugins [[lein-midje "3.1.1"]]}})


Roelof


Op woensdag 2 september 2015 08:02:14 UTC+2 schreef r/ Wobben:
>
> Thanks, 
>
> For anyone who is interested.
> Here are the exercises and theory: 
> http://iloveponies.github.io/120-hour-epic-sax-marathon/I-am-a-horse-in-the-land-of-booleans.html
> and here are the exercises layout ;  
> https://github.com/iloveponies/i-am-a-horse-in-the-land-of-booleans/blob/master/src/i_am_a_horse_in_the_land_of_booleans.clj
>
> Roelof
>
> Op woensdag 2 september 2015 00:11:27 UTC+2 schreef Jony Hudson:
>>
>> You might find kibit interesting too:
>>
>> https://github.com/jonase/kibit
>>
>> In its own words "kibit is a static code analyzer for Clojure, 
>> ClojureScript, cljx <https://github.com/lynaghk/cljx> and other Clojure 
>> variants. It uses core.logic <https://github.com/clojure/core.logic> to 
>> search for patterns of code that could be rewritten with a more idiomatic 
>> function or macro. "
>>
>> Running it on your file gives:
>>
>> At test.clj:10:
>>
>> Consider using:
>>
>>   (neg? x)
>>
>> instead of:
>>
>>   (< x 0)
>>
>>
>> At test.clj:15:
>>
>> Consider using:
>>
>>   (zero? (mod n divisor))
>>
>> instead of:
>>
>>   (= (mod n divisor) 0)
>>
>>
>> Jony
>>
>> On Monday, 31 August 2015 19:29:21 UTC+1, r/ Wobben wrote:
>>>
>>> Hello, 
>>>
>>> I did solve the boolean chapter of the ilovehorses git repo.
>>> My solutions can be found here: 
>>> https://github.com/rwobben/i-am-a-horse-in-the-land-of-booleans/blob/master/src/i_am_a_horse_in_the_land_of_booleans.clj
>>>
>>> Any experts who can give me feedback about the solutions so I can learn 
>>> from it.
>>>
>>> Roelof
>>>  
>>>
>>

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

2015-09-01 Thread r/ Wobben
Thanks, 

For anyone who is interested.
Here are the exercises and theory: 
http://iloveponies.github.io/120-hour-epic-sax-marathon/I-am-a-horse-in-the-land-of-booleans.html
and here are the exercises layout ;  
https://github.com/iloveponies/i-am-a-horse-in-the-land-of-booleans/blob/master/src/i_am_a_horse_in_the_land_of_booleans.clj

Roelof

Op woensdag 2 september 2015 00:11:27 UTC+2 schreef Jony Hudson:
>
> You might find kibit interesting too:
>
> https://github.com/jonase/kibit
>
> In its own words "kibit is a static code analyzer for Clojure, 
> ClojureScript, cljx <https://github.com/lynaghk/cljx> and other Clojure 
> variants. It uses core.logic <https://github.com/clojure/core.logic> to 
> search for patterns of code that could be rewritten with a more idiomatic 
> function or macro. "
>
> Running it on your file gives:
>
> At test.clj:10:
>
> Consider using:
>
>   (neg? x)
>
> instead of:
>
>   (< x 0)
>
>
> At test.clj:15:
>
> Consider using:
>
>   (zero? (mod n divisor))
>
> instead of:
>
>   (= (mod n divisor) 0)
>
>
> Jony
>
> On Monday, 31 August 2015 19:29:21 UTC+1, r/ Wobben wrote:
>>
>> Hello, 
>>
>> I did solve the boolean chapter of the ilovehorses git repo.
>> My solutions can be found here: 
>> https://github.com/rwobben/i-am-a-horse-in-the-land-of-booleans/blob/master/src/i_am_a_horse_in_the_land_of_booleans.clj
>>
>> Any experts who can give me feedback about the solutions so I can learn 
>> from it.
>>
>> Roelof
>>  
>>
>

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


labrep error message (FileNotFoundException bin/run.clj (No such file or directory) java.io.FileInputStream.open)

2015-09-01 Thread r/ Wobben
Hello, 

When I want to start labrepl it stops with this error message.

Installed clojure 1.7.0-alpha1.

java : openjdk7-jre-headless. 

Roelof

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

2015-08-31 Thread r/ Wobben
Thanks, 

I know Clojure for the Brave and True but what I miss there are exercises I 
can do myself.
I will look at the labrepl course. 

Roelof


Op dinsdag 1 september 2015 03:22:04 UTC+2 schreef Denis Fuenzalida:
>
> I recommend Clojure for the Brave and True: http://www.braveclojure.com/
>
> If you can clone this github repo and you are not afraid of the command 
> line you can try: https://github.com/relevance/labrepl
>
>
> Denis
>
> El lunes, 31 de agosto de 2015, 8:49:46 (UTC-7), r/ Wobben escribió:
>>
>> Hello, 
>>
>> I found this MOOC to learn me clojure : 
>> http://iloveponies.github.io/120-hour-epic-sax-marathon/basic-tools.html
>>
>> Is this a good one or is there a better free alternative. 
>>
>> Roelof
>>
>>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>  
>

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


feedback about solutions

2015-08-31 Thread r/ Wobben
Hello, 

I did solve the boolean chapter of the ilovehorses git repo.
My solutions can be found here: 
https://github.com/rwobben/i-am-a-horse-in-the-land-of-booleans/blob/master/src/i_am_a_horse_in_the_land_of_booleans.clj

Any experts who can give me feedback about the solutions so I can learn 
from it.

Roelof
 

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


free online course

2015-08-31 Thread r/ Wobben
Hello, 

I found this MOOC to learn me clojure : 
http://iloveponies.github.io/120-hour-epic-sax-marathon/basic-tools.html

Is this a good one or is there a better free alternative. 

Roelof

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

2015-08-08 Thread Kyle R. Burton
Sorry about the '0.1.0', I had indeed found that in the project.clj.

Is there anything I can do to help w/the round of work?

Regards,

Kyle

On Fri, Aug 7, 2015 at 5:12 PM, Alex Miller  wrote:

> I don't where the 0.1.0 number is coming from, but yes there are plans to
> do a round of work on core.async and release in the near future.
>
>
> On Friday, August 7, 2015 at 1:16:19 PM UTC-5, Kyle Burton wrote:
>>
>> Is there a new release planned for core.async anytime in the near future?
>>
>> The docs show some functionality that's not in the current release [1].
>> Specifically offer! [2] which looks like it's slated for 0.1.0 (love to
>> switch to that from alts+timeout).
>>
>> Are there (perhaps) tasks that need a dev? (yes, I'm offering to help)
>>
>> Regards,
>>
>> Kyle
>>
>>
>>
>> [1] https://github.com/clojure/core.async shows Latest release:
>> 0.1.346.0-17112a-alpha
>> [2] http://clojure.github.io/core.async/#clojure.core.async/offer!
>>
>> --
>> Twitter: @kyleburton
>> Github: https://github.com/kyleburton
>> Blog: http://asymmetrical-view.com/
>> Fun: http://snapclean.me/
>>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to 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.
>



-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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


0.1.0 core.async release?

2015-08-07 Thread Kyle R. Burton
Is there a new release planned for core.async anytime in the near future?

The docs show some functionality that's not in the current release [1].
Specifically offer! [2] which looks like it's slated for 0.1.0 (love to
switch to that from alts+timeout).

Are there (perhaps) tasks that need a dev? (yes, I'm offering to help)

Regards,

Kyle



[1] https://github.com/clojure/core.async shows Latest release:
0.1.346.0-17112a-alpha
[2] http://clojure.github.io/core.async/#clojure.core.async/offer!

-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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


[ANN] clj-xpath 1.4.5 OWASP XXE Vulnerability Fix

2015-08-06 Thread Kyle R. Burton
clj-xpath is a library for working with XML and XPath in Clojure.

This release [1] addresses an issue reported by Louis Nyffenegger [2].
This release changes the default features enabled in the XML parser to
improve security - see the bug for a link to hte OWASP vulnerability.


Best Regards,

Kyle Burton


[1] https://github.com/kyleburton/clj-xpath/releases/tag/clj-xpath-1.4.5

[2] https://github.com/kyleburton/clj-xpath/issues/25

-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to 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: Reality check: EC2 + Ubuntu + Atom (from GitHub) + Clojure?

2015-08-03 Thread Joe R. Smith
I’ll come out as an Emacs -> Cursive convert. I had been using emacs for 
Clojure development for 6+ years before I switched. Originally I had no 
intention of actually switching, but, as Colin suggested, I found enough 
additional value in Cursive to make my experimentation with Cursive permanent.


> On Aug 3, 2015, at 5:02 AM, Colin Fleming  wrote:
> 
> For Clojure nothing beats emacs + CIDER
> 
> As a clearly biased participant here (I develop Cursive) I'd like to politely 
> disagree with this. Lots of people are switching to Cursive from Emacs, 
> including many that you've heard of. Obviously different strokes for 
> different folks etc, but a lot of experienced Emacs users are finding enough 
> additional value in Cursive (and potentially other environments, but I can't 
> really speak to them) that they're willing to go through the pain of 
> switching editing environments to get it. A lot of people also switch from 
> one to the other depending on what they're doing - lein and boot provide 
> enough of a layer that this is not painful and allows you to use the 
> strengths of one or the other.
> 
> Obviously I'm delighted if people are happy with the tools that they're 
> using, whatever they may be, but I do think it's time to lay to rest the myth 
> that Emacs is the only (or unequivocally the best) environment for Clojure. 
> That hasn't been true for a long time - there are lots of good options.
> 
> On 3 August 2015 at 04:05, Jason Lewis  > wrote:
> IntelliJ CE (the free version) has served me well for Java and (playing with) 
> Cursive for Clojure. I can't speak to Python.
> 
> For Clojure nothing beats emacs + CIDER, and emacs is a fine choice for 
> Python. I generally stick to IntelliJ for Java, but I do know a few people 
> who use emacs for Java and then do a run through an IDE for static analysis 
> and automated refactoring as a second step. 
> 
> FWIW, I think it's worth learning the tradeoffs between editors and IDEs; I 
> wish I'd learned the difference earlier on. Maybe Python/emacs -> 
> Java/IntelliJ -> Clojure/emacs? Learning emacs and IntelliJ might be a bit of 
> cognitive overhead, but (insert some old saw about a good craftsmen knowing 
> his tools). 
> 
> I can't imagine using Atom for Java, and using it for Clojure seems like a 
> terrible idea; no inline eval, no integrated REPL, no jump-to-fn-definition, 
> no jump-to-docstring... I used it briefly when I was still doing Ruby, it was 
> acceptable on the days when the latest update didn't cause it to crash every 
> 15 minutes.
> 
> 
> 
> On Sun, Aug 2, 2015 at 8:51 PM Mark Engelberg  > wrote:
> Intellij might be your best option for a unified development platform for 
> Java, Clojure, and Python.  It won't be free though.
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com 
> 
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com 
> 
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en 
> 
> --- 
> You received this message because you are subscribed to 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 
> .
> 
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first po

Re: [:ann :book] ClojureScript Unraveled

2015-07-17 Thread Joe R. Smith
I believe [:ann :book] is a variant. :D

> On Jul 17, 2015, at 1:44 PM, Fluid Dynamics  wrote:
> 
> Nitpick: a collection of tag keywords, which can be presumed not to have 
> duplicates, is probably better represented as a set or a sorted-set rather 
> than a vector, so "#{:ann :book} ClojureScript Unraveled" might be 
> preferable. ;)
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en 
> 
> --- 
> You received this message because you are subscribed to 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: [Documentation] looking for diagramming tools

2015-06-29 Thread Joe R. Smith
I use Omnigraffle to draw entity relationship diagrams like that.


> On Jun 29, 2015, at 4:13 AM, dImas Angga Saputra 
>  wrote:
> 
> Hi Everyone,
> 
> I'd like to ask about recommendation about diagramming tools,
> So i saw this post : 
> http://blog.datomic.com/2013/06/using-datomic-from-groovy-part-1.html
> 
> And i try to search what tools he/she used to make diagram like the first 
> picture?
> 
> I attached the diagram.
> 
> Thank you in advance.
> 
> Regards,
> --
> Dimas Saputra
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en 
> 
> --- 
> You received this message because you are subscribed to 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: symbol grammar

2014-05-24 Thread Benjamin R. Haskell
Interesting.  This is a change in 1.6.0:

; => test.clj
(let [sym 'foo/bar/baz/bot]
  (prn {:name (name sym)
:namespace (namespace sym)
:version *clojure-version*}))

;; Running for all the (release) versions I had locally:
{:name "bot", :namespace "foo/bar/baz", :version {:major 1, :minor 2,
:incremental 0, :qualifier ""}}
{:name "bot", :namespace "foo/bar/baz", :version {:major 1, :minor 2,
:incremental 1, :qualifier ""}}
{:name "bot", :namespace "foo/bar/baz", :version {:major 1, :minor 3,
:incremental 0, :qualifier nil}}
{:name "bot", :namespace "foo/bar/baz", :version {:major 1, :minor 4,
:incremental 0, :qualifier nil}}
{:name "bot", :namespace "foo/bar/baz", :version {:major 1, :minor 5,
:incremental 0, :qualifier nil}}
{:name "bot", :namespace "foo/bar/baz", :version {:major 1, :minor 5,
:incremental 1, :qualifier nil}}
{:name "bar/baz/bot", :namespace "foo", :version {:major 1, :minor 6,
:incremental 0, :qualifier nil}}

Several potentially-related changes in the 1.6.0 changelog (
https://github.com/clojure/clojure/blob/master/changes.md):

- Map destructuring extended to support namespaced keys (
http://dev.clojure.org/jira/browse/CLJ-1318)
- Allow EdnReader to read foo// (http://dev.clojure.org/jira/browse/CLJ-1238
)
- Allow ** as a valid symbol name without triggering "not declared dynamic"
warnings (http://dev.clojure.org/jira/browse/CLJ-1233)

But in general this doesn't seem well-advertised.



On Sat, May 24, 2014 at 6:01 PM, Gregg Reynolds  wrote:

> On Sat, May 24, 2014 at 3:14 PM, Benjamin R. Haskell 
> wrote:
> > On Sat, May 24, 2014 at 3:09 PM, Gregg Reynolds 
> wrote:
> >>
> >> Hi,
> >>
> >> In working on an ANTLR grammar for Clojure I came across this regex in
> >> clojure.lang.LispReader which is used in matchSymbol:
> >>
> >> symbolPat == [:]?([\\D&&[^/]].*/)?(/|[\\D&&[^/]][^/]*)
> >>
> >> Look at the first part of the second group:
> >>
> >> /|[\\D&&[^/]]
> >>
> >> Am I missing something or is that equal to \\D?
> >
> >
> > That would be equal to \\D, but you're missing that /|[\\D&&[^/]][^/]* is
> > the alternation of / and [\\D&&[^/]][^/]* rather than ( the alternation
> of /
> > and [\\D&&[^/]] ) concatenated with [^/]*
>
> Aha.  So concatenation of [] binds more tightly than '|'?  Or maybe it
> follows from greedy matching on the second alternative.  In any case I
> made the opposite assumption.
>
> >
> > '/' is special-cased as a symbol.  It can only be used (with an optional
> > namespace) if it's the only character in the name.
>
> Something doesn't look right.
>
> user=> :a/b/c/d
> :a/b/c/d
> user=> (namespace :a/b/c/d)
> "a"
> user=> (name :a/b/c/d)
> "b/c/d"
> user=> (symbol "x/y/z" "foo")
> x/y/z/foo
> user=> (type 'x/y/z/foo)
> clojure.lang.Symbol
> user=> (namespace (symbol "x/y/z" "foo"))
> "x/y/z"
> user=> (namespace 'x/y/z/foo)
> "x"
> user=> (name 'x/y/z/foo)
> "y/z/foo"
> user=> (name (symbol "x/y/z" "foo"))
> "foo"
> ...etc...
>
> The sym regex gets it right - '/' chars are part of the ns string:
>
> user> (def longrgx (re-pattern
> "[:]?([\\D&&[^/]].*/)?(/|[\\D&&[^/]][^/]*)"))
> user> (re-find longrgx "x/y/z/foo")
> ["x/y/z/foo" "x/y/z/" "foo"]
>
> But it doesn't match a final '/' preceded by a namespace string:
> user> (re-find longrgx "x/y/z/")
> ["x/y/z" "x/y/" "z"]
>
> unless its doubled:
> user> (re-find longrgx "x/y/z//")
> ["x/y/z//" "x/y/z/" "/"]
>
> So if the name portion of a symbol cannot contain '/' then why
> user=> (name 'x/y/z/foo)
> "y/z/foo"
> user=> (name (symbol "x" "y/z/foo"))
> "y/z/foo"
>
> Ok, clojure.core/name calls clojure.lang.Named/getName, implemented by
> clojure.lang.Symbol.
>
> Conclusion: it looks like there is an inconsistency between the Symbol
> regex and matchSymbol processing, on the one hand, and Symbol.intern,
> which is called by matchSymbol and analyzes the passed string to set
> its name and namespace fields:
>
> /* in clojure.lang.Symbol
> static public Symbol intern(String nsname){
&

Re: symbol grammar

2014-05-24 Thread Benjamin R. Haskell
On Sat, May 24, 2014 at 3:09 PM, Gregg Reynolds  wrote:

> Hi,
>
> In working on an ANTLR grammar for Clojure I came across this regex in
> clojure.lang.LispReader which is used in matchSymbol:
>
> symbolPat == [:]?([\\D&&[^/]].*/)?(/|[\\D&&[^/]][^/]*)
>
> Look at the first part of the second group:
>
> /|[\\D&&[^/]]
>
> Am I missing something or is that equal to \\D?
>

That would be equal to \\D, but you're missing that /|[\\D&&[^/]][^/]* is
the alternation of / and [\\D&&[^/]][^/]* rather than ( the alternation of
/ and [\\D&&[^/]] ) concatenated with [^/]*

'/' is special-cased as a symbol.  It can only be used (with an optional
namespace) if it's the only character in the name.

Best,
Ben

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


"recursive" hierarchies and derive

2014-05-12 Thread r
Why is something like 

(derive [::matrix ::ring-element] ::ring-element)

prevented by the assertion in clojure.core/derive?
Is there something that is an actual show-stopper 
or is this an implementation detail?

Cheers,
ranko


-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to 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: CompilerException java.lang.IllegalArgumentException: Mismatched argument count to recur

2014-05-06 Thread Benjamin R. Haskell
`loop` expects a vector of binding forms (with initial values), not just a
vector of names.

(loop [coll counter]; means there is one `loop` binding named `coll`,
with the initial value of `counter`

To fix that problem directly:

(loop [collcoll  ; coll starts with an initial value of its value
outside the loop
   counter counter]  ; counter starts with an initial value of its
value outside the loop
;; rest of code here ...

Then you're left with an extra `let` (which was serving a similar purpose
to `loop` initialization?), and the whole `loop` is possibly superfluous,
because a function can be the target of a `recur`.

On Tue, May 6, 2014 at 3:25 AM, Roelof Wobben  wrote:

> Hello,
>
> I have this form
>
> (ns forclojure.core)
>
>   (defn secondlast [coll counter]
> (let [ number 0
>counter  ( - (count coll)2)]
>   (loop [coll counter]
> (if (== counter number)
>   (first coll)
>   (recur (next coll) (+ counter 1 ))
>
> But as soon as I try to send it to REPL I see this message:
>
> CompilerException java.lang.IllegalArgumentException: Mismatched argument
> count to recur, expected: 1 args, got: 2,
> compiling:(/home/roelof/clojure/forclojure/src/forclojure/core.clj:9:11)
>
> Roelof
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to 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: Emacs - error with `nrepl-jack-in'

2014-04-18 Thread greg r
You should consider going to CIDER:

https://github.com/clojure-emacs/cider

The command is 'cider-jack-in'.

Here's a page with a lot of install info:

http://clojure-doc.org/articles/tutorials/emacs.html

There are many web pages out there with obsolete information on Clojure and 
emacs.
The above page is one of the most up-to-date.

Regards,
Greg

On Thursday, April 17, 2014 9:45:13 PM UTC-4, Thorsten Jolitz wrote:
>
>
> Hi List, 
>
> just installed lein2 and can start 'lein2 repl' successfully on the 
> command-line. 'lein repl' works too, since I defined an alias in my 
> .bashrc. 
>
> After installing packages clojure-mode and nrepl in Emacs, I get this 
> error when trying `nrepl-jack-in': 
>
> ,- 
> | error in process sentinel: Could not start nREPL server: /bin/bash: Line 
> | 1: lein: Command not found. 
> `- 
>
> I'm on Archlinx with 
>
> #+begin_src emacs-lisp 
>  (emacs-version) 
> #+end_src 
>
> #+results: 
> : GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.7) 
> :  of 2014-01-28 on var-lib-archbuild-extra-x86_64-juergen 
>
> I googled some related sites and it seems it might be an Emacs (exec-) 
> path 
> problem, but a reboot did not help. 
>
> -- 
> cheers, 
> Thorsten 
>
>

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


Re: alternative syntax for Clojure? Haskell?

2014-04-05 Thread greg r
I can't answer your question from my own experience, but there does seem to 
be a way to develop your own language on the JVM:

https://www.eclipse.org/Xtext/index.html

You could create a "DSL" to your precise specifications.

Regards,
Greg


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

2014-03-14 Thread Víctor R . Escobar
Hi everyone,

about David's document, I think you need to realize that it is a perfect 
blog post for programmers. In a business usually the focus is in the 
benefit (increase benefit or reduce costs). If I would be your boss perhaps 
I would understand that you want to switch to another technology (for some 
reasons that maybe not everyone understands) that will make the 
maintainability more expensive and the extension more complicated. At least 
as it is exposed in the document and as it can be understood by a 
businessman.

Unless they trust your opinions more than their business reasons, try to 
convince your bosses without show them a single line of code. It is just 
the way some brains are cabled. Give them the economical reasons they want 
to hear. I am inventing some of them:


   - Faster prototyping to explore new business ideas.
   - Easily maintainable product and large easier to test (to avoid 
   unexpected surprises)
   - Faster reaction to error recovery (recovery on critic situations)
   - The code is scalable and parallelizable nearly without modify the 
   setup (remember how many startups died from success). 
   - It is highly portable because it runs in the  archi-well-known JVM 
   (insert now all benefits from marketing java).
   - A new hire can be ready to program in the time he learns how the 
   company works (say 30 days).
   - If you require to move to another technology you can port it with 
   lower costs than other languages (available directly in java, and easy to 
   translate to other lisps...)

And perhaps the most important: the best code for a company is the code 
that doesn't have to be written. It is not what you have to do, it is how 
much it brings to the company without waste company resources: show the 
technologies that you can already use tomorrow for no cost at all because 
they are already implemented and you only need to set them up (mention 
servers and hava open source projects which make mostly all the work and 
just need to be adapted to make everything).

If you really want to convince them to get a yes, show them a working 
prototype that looks to work (I repeat, a prototype).

I hope this business approach helps. I had to learn it in the hard way.




El martes, 11 de marzo de 2014 22:09:43 UTC+1, Jarrod Swart escribió:
>
> I'm about to be an early employee at a small startup.  
>
> I will be the first technical hire and am a competent but not 
> extraordinarily experienced developer. The founders know this and hired me 
> based on soft as well as technical skills.  
>
> I don't want to be the first technical employee and make a poor technology 
> choice that chains this startup from the beginning.
>
> My goal is to convince the CEO and other early stage executives of the 
> benefits of using Clojure in place of PHP.  All the early founders have 
> worked in places that use PHP, and I have worked as a PHP developer with 
> some of them at other companies.  For the past year I have used Clojure in 
> my personal projects and am comfortable with the language.
>
> I expect the following objections:
>
> * What is the talent pool like (for Clojure) and can we outsource less 
> important tasks to other developers.
> * What advantages does this technology offer over something like PHP (from 
> a business perspective)?
> * How will you cope with technical challenges?
>
> I have my own opinions but I would love to hear the feedback of others. 
>  If you have good counter arguments to these or other objections you have 
> heard in the past I would like to hear those.  If you have been in my 
> position I would love to hear about that experience as well.
>
> Also consider that these people are technical but not programmers.  Any 
> benefits have to make sense from a business perspective as well.
>
> Thank you for your help!
>

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

2014-03-07 Thread Víctor R . Escobar
That are very great news! do you think this change in the design could have
any side effect? For me this "lazy" concept is quite new and until today I
only have read posts about the possitive effects it brings.

Do you think it could require that much of more memory that in some
situations the OS would kill the process? (I am sorry if it sounds
extreme... it's a side effect after work on clompex firmware scenarios). If
some side effects are detected perhaps would be desiderable an activation
flag for this patch (e.g. someone who prefers a full initialization at
first).

El viernes, 28 de febrero de 2014 16:16:44 UTC+1, Gal Dolber escribió:
>
> Here're some notes on the lean compiler I've been working on for 
> clojure-objc
>
> http://galdolber.tumblr.com/post/78110050703/reduce-startup
>
> Feedback's welcome
>

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

2014-03-07 Thread Víctor R . Escobar
That are very great news! do you think this change in the design could have 
any side effect? For me this "lazy" concept is quite new and until today I 
only have read posts about the possitive effects it brings.

Do you think it could require that much of more memory that in some 
situations the OS would kill the process? (I am sorry if it sounds 
extreme... it's a side effect after work on clompex firmware scenarios). If 
some side effects are detected perhaps would be desiderable an activation 
flag for this patch (e.g. someone who prefers a full initialization at 
first).

>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to 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: partial function revisited (exercise in macros)

2014-02-08 Thread r
Thanks,

Let me study this a bit. Maybe I have additional questions.
ranko

On Saturday, February 8, 2014 12:01:37 PM UTC-5, juan.facorro wrote:
>
> When you use *`~p* what you are actually doing is  using the symbol of 
> the predicate as a function. For example if you call *(partial-pbm f 
> symbol? 1 x 3)*, the quote-unquote (`~) will return the symbol *symbol?* 
> which 
> is not what you want. What you can do is use the *resolve 
> <http://clojuredocs.org/clojure_core/clojure.core/resolve>* function to 
> get the var associated with that symbol, if it exists.
>
> I haven't tried this but the following should work:
>
>
>
>
>
> *(defmacro partial-pbm  [f p & args]  (let [argseq (flatten args)
> nargs (vec (filter (resolve p) argseq))]*
> *`(fn ~nargs (~f ~@argseq*
>
> Hope it help,
>
> Juan
>
> On Monday, February 3, 2014 8:09:55 PM UTC-3, r wrote:
>>
>> Hello all,
>>
>> For various reasons, and despite the convenience of anonymous functions,
>> I'd like to have a proper positional parameter binding partial function 
>> application. (Actually,
>> I'd like to have by-name parameter binding, but that's another story.)
>>
>> For example, the following seems to work:
>>
>>
>> (defmacro partial-pbm
>> [f & args]
>> (let [argseq (flatten args)
>> nargs (vec (filter symbol? argseq))]
>> `(fn ~nargs (~f ~@argseq
>>
>>
>> and I can do my partials like:
>>
>>
>>1. tools.core=>
>>2.  
>>3. tools.core=> (defn f [a b c] (/ a (- b c)))
>>4. #'tools.core/f
>>5. tools.core=> (partial-pbm f 1 x 3)
>>6. #
>>7. tools.core=> ((partial-pbm f 1 x 3) 2)
>>8. -1
>>9. tools.core=> (f 1 2 3)
>>10. -1
>>11. tools.core=>
>>
>>
>> And it is almost ok. However, I'd like to be able to pass in the
>> predicate that should recognize what the resulting function's new formal 
>> params
>> should be. In other words I'd like "symbol?" in the macro definition 
>> above to
>> be passed in. This brings me to the first, general, question (about 
>> macros):
>>
>> This means that some of the invocation arguments to this macro should be 
>> evaluated, and some should not (e.g. the one specifying the predicate 
>> should
>> be evaluated/dereferenced to enable filtering, but the one specifying the
>> new formal parameters and constants for the rest should not, until the 
>> unbound variables in that param are safely captured in the param list of
>> the (fn ...) form). How is this, usually, resolved? Eval?
>>
>> In other words: If there is a need to do some computation _before_ the
>> quoted (template) form of the macro, how is it usually done? Most
>> macros I've seen start with the quoted form.
>>
>> Now, my various attempts to make this work have been quite confusing 
>> (and I thought I almost got this ...). 
>>
>> First, it seems that the quote must move to the beginning, because
>> I can't find a way to refer to the actual function (predicate) passed,
>> not its symbol. Something like this fails:
>>
>> (defmacro partial-pbm
>> [f p & args]
>> (let [argseq (flatten args)
>> nargs (vec (filter `~p argseq))]
>> ...)
>>
>>
>> which made me realize I don't understand the scope of `/~.
>>
>> I can calculate this properly by:
>>
>> (defmacro ppbm
>>   [f vp & argdef]
>>   `(let [argseq# (flatten '~argdef)
>>  nargs# (vec (filter ~vp argseq#))] 
>>
>> (fn nargs# (~f argseq#
>>
>> But this fails to compile with
>>
>> CompilerException java.lang.IllegalArgumentException: Parameter 
>> declaration f should be a vector, 
>> compiling:(/tmp/form-init5231854403593049721.clj:1:1) ,
>>
>> and I'm unsure why. This type of error is obtained when one forgets [] 
>> parameter list in fn form. 
>> But if I try to print or examine (class, ..) stuff passed to (fn ...) 
>> form they seem correct. Furthermore,
>> this does not look all that different from the functional version at the 
>> beginning.
>>
>> I'm going to InfoQ to re-watch all Macros talks, but if someone could 
>> kick-start me on this, it'd be much appreciated. 
>>  
>> 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/groups/opt_out.


Re: partial function revisited (exercise in macros)

2014-02-08 Thread r
Agreed.
What I'd like to have is something that works like this:

(partial-pbm f ?sym? 1 ?x0 3)

that would produce (given 

(defn ?sym? 

  
  [x]   

  
  (and (symbol? x) (re-find #"\?[a-z][0-9]*" (name x   

(fn [?x0] (f 1 ?x0 x)). In other words: given a predicate that would
recognize use of free variables it would extract them and bind them in
fn form.

Clearly, I need a macro because ?x0 might not be bound in the context.

In that sense, the first example I gave does the exact thing I want.
However, I can't find a way to pass the predicate in, due to my inexperience
with macros, no doubt. So, the main question stands: how to deal with macros
where some of the passed-in parameters should be resolved without 
evaluating them.

Thanks for the help,
ranko


On Saturday, February 8, 2014 12:14:14 PM UTC-5, Gary Verhaegen wrote:
>
> When writing a somewhat complex macro, it is always a good idea to start 
> by writing the code you would like to write (using the macro), rather than 
> begin with the implementation.
>
> Could you perhaps provide an example use of the macro you would like to 
> have? Not one that works, obviously, but what you would like to be able to 
> write.
>
>
> On 8 February 2014 18:01, juan.facorro  >wrote:
>
>> When you use *`~p* what you are actually doing is  using the symbol of 
>> the predicate as a function. For example if you call *(partial-pbm f 
>> symbol? 1 x 3)*, the quote-unquote (`~) will return the symbol *symbol?* 
>> which 
>> is not what you want. What you can do is use the *resolve 
>> <http://clojuredocs.org/clojure_core/clojure.core/resolve>* function to 
>> get the var associated with that symbol, if it exists.
>>
>> I haven't tried this but the following should work:
>>
>>
>>
>>
>>
>> *(defmacro partial-pbm  [f p & args]   (let [argseq (flatten args)
>> nargs (vec (filter (resolve p) argseq))]*
>> *`(fn ~nargs (~f ~@argseq*
>>
>> Hope it help,
>>
>> Juan
>>
>> On Monday, February 3, 2014 8:09:55 PM UTC-3, r wrote:
>>>
>>> Hello all,
>>>
>>> For various reasons, and despite the convenience of anonymous functions,
>>> I'd like to have a proper positional parameter binding partial function 
>>> application. (Actually,
>>> I'd like to have by-name parameter binding, but that's another story.)
>>>
>>> For example, the following seems to work:
>>>
>>>
>>> (defmacro partial-pbm
>>> [f & args]
>>> (let [argseq (flatten args)
>>> nargs (vec (filter symbol? argseq))]
>>> `(fn ~nargs (~f ~@argseq
>>>
>>>
>>> and I can do my partials like:
>>>
>>>
>>>1. tools.core=>
>>>2.  
>>>3. tools.core=> (defn f [a b c] (/ a (- b c)))
>>>4. #'tools.core/f
>>>5. tools.core=> (partial-pbm f 1 x 3)
>>>6. #
>>>7. tools.core=> ((partial-pbm f 1 x 3) 2)
>>>8. -1
>>>9. tools.core=> (f 1 2 3)
>>>10. -1
>>>11. tools.core=>
>>>
>>>
>>> And it is almost ok. However, I'd like to be able to pass in the
>>> predicate that should recognize what the resulting function's new formal 
>>> params
>>> should be. In other words I'd like "symbol?" in the macro definition 
>>> above to
>>> be passed in. This brings me to the first, general, question (about 
>>> macros):
>>>
>>> This means that some of the invocation arguments to this macro should be 
>>> evaluated, and some should not (e.g. the one specifying the predicate 
>>> should
>>> be evaluated/dereferenced to enable filtering, but the one specifying the
>>> new formal parameters and constants for the rest should not, until the 
>>> unbound variables in that param are safely captured in the param list of
>>> the (fn ...) form). How is this, usually, resolved? Eval?
>>>
>>> In other words: If there is a need to do some computation _before_ the
>>> quoted (template) form of the macro, how is it usually done? Most
>>> macros I've seen start with the quoted form.
>>>
>>> Now, my var

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread r
I'd agree here.

This is actually a very nice example of a system that might be called 
"chaotic", though
"chaos" is, even mathematically, a very vague term:

1) the iteration will never leave [-2, 2]
2) it won't converge because all 3 fixed points are unstable ( |f'(x_s)|>1 )

So, your example is really not calculating any particular number. 
Now you could consider it as a calculation of the series itself. The 
question is
that of repeatability. 

This is not something that can be answered by looking at hardware only. 
Even if you are
running with the same primitive operations, the results could be different. 
Floating point
representation violated distributivity and associativity laws of real 
numbers. Thus, the
error of a certain computation, even if algebraically equivalent, depends 
on the ordering
of operations (if you ever come close to the accuracy limits ~1e-7 for 
floats and ~1e-15 for 
doubles, or something like that). Since different compilers will order 
computation differently,
you cannot really expect to match a diverging series ... 

Standard texts are:
http://www.amazon.com/Nonlinear-Dynamics-And-Chaos-Applications/dp/0738204536
http://www.amazon.com/Accuracy-Stability-Numerical-Algorithms-Nicholas/dp/0898715210

ranko

On Wednesday, February 5, 2014 12:22:54 PM UTC-5, Konrad Hinsen wrote:
>
> --On 5 Feb 2014 05:17:13 -0800 Glen Fraser > 
> wrote: 
>
> > My benchmark iteratively runs a function 100M times: g(x) <-- sin(2.3x) 
> + 
> > cos(3.7x), starting with x of 0. 
>
> A quick look at the series you are computing suggests that it has chaotic 
> behavior. Another quick looks shows that neither of the two values that 
> you see after 100M iterations is a fix point. I'd need to do a careful 
> numerical analysis to be sure, but I suspect that you are computing 
> a close to random number: any numerical error at some stage is amplified 
> in the further computation. 
>
> If you get identical results from different languages, this suggests that 
> they all end up using the same numerical code (probably the C math 
> library). I suggest you try your Python code under Jython, perhaps 
> that will reproduce the Clojure result by also relying on the JVM 
> standard library. 
>
> > In the other languages, I always got the result 0.0541718..., but in 
> > Clojure I get 0.24788989  I realize this is a contrived case, but -- 
> > doing an identical sequence of 64-bit floating-point operations on the 
> > same machine should give the same answer. 
>
> Unfortunately not. Your reasoning would be true if everyone adopted 
> IEEE float operations, but in practice nobody does because the main 
> objective is speed, not predictability. The Intel hardware is close 
> to IEEE, but not fully compatible, and it offers some parameters that 
> libraries can play with to get different results from the same operations. 
>
> Konrad. 
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to 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: Help about using clojure in org mode in Emacs with CIDER

2014-02-02 Thread greg r
The worg documentation for the Clojure language has been updated:
http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html

The installation instructions should result in a current 
Clojure/CIDER/clojure-mode/Leiningen system.

Regards,
Greg

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to 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: Help about using clojure in org mode in Emacs with CIDER

2014-01-28 Thread greg r
Hi Bastien, yes I will post a report at the mailing list today.

Regards,
Greg

On Tuesday, January 28, 2014 12:55:20 AM UTC-5, Bastien Guerry wrote:
>
> Hi Greg, 
>
> greg r > writes: 
>
> > I compared a computer set up with the latest of everything (org/emacs 
> > /CIDER) and compared to an older computer still using nrepl-jack-in 
> > and older versions of everything else.  The behavior is definitely 
> > different with the newer system, and can be seen with a very simple 
> > case: 
>
> Can you report this to the org-mode mailing list? 
> https://lists.gnu.org/mailman/listinfo/emacs-orgmode 
>
> Thanks, 
>
> -- 
>  Bastien 
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to 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: Help about using clojure in org mode in Emacs with CIDER

2014-01-27 Thread greg r
I compared a computer set up with the latest of everything 
(org/emacs/CIDER) and compared to an older computer still using 
nrepl-jack-in and older versions of everything else.  The behavior is 
definitely different with the newer system, and can be seen with a very 
simple case:

Code block:
#+begin_src clojure :results value raw
[1 2 3 4]
#+end_src

New: (CIDER)
#+RESULTS:
[1 2 3 4]

Old: (nrepl)
#+RESULTS:
| 1 | 2 | 3 | 4 |

It appears the conversion to org table is not happening.

Regards,
Greg

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to 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: Help about using clojure in org mode in Emacs with CIDER

2014-01-23 Thread greg r
We had a discussion about this in the cider-emacs group:

https://groups.google.com/forum/#!topic/cider-emacs/xj-HYTAA-D0

Bastien's page on using Overtone with Clojure in org code blocks is very 
informative with regards to setting it all up:

http://bzg.fr/emacs-org-babel-overtone-intro.html

Note that the worg page for Clojure is out of date:

http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html

This references swank-clojure which is depracated.
I would like to edit this page to bring it up to date with Cider, and I 
would like to help
as soon as I figure out the process with keys and git!

Good luck with org-mode, cider and Clojure code blocks.  It's a great way 
to code and experiment, as well
as create dynamic documents.  I've had very good results with the system.

Regards,
Greg

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

2014-01-18 Thread Benjamin R. Haskell

On Sat, 18 Jan 2014, Brian Craft wrote:


http://www.youtube.com/watch?v=OEZZOz6__CY

At about 30 min he mentions that gzip, etc. aren't so interesting here 
because we can use, um.. something transfer, proxies... don't know 
what he's saying. Anyone know what he's talking about?


Slide for context:

{:media-type "application/edn"
 :language "de"
 :charset "UTF-8"
 :encoding "deflate"}

With that on-screen, he says:

"""
...and we have an encoding, which can be for example, deflate or gzip or 
like that, um, which we don't care about a lot, I think, on this side of the 
server, because we can use like transparent proxies to do all those 
on-the-fly gzip things for us, but it's possible.

"""

Presumably, he's talking about something like putting a Clojure app 
behind an nginx frontend server, where handling gzip is as simple as 
adding 'gzip on;' to the 'server {}' configuration block.  (So, you 
don't care about gzip'ing on the Clojure side of the application, you 
care about it on the transparent-proxying-server side.)


--
Best,
Ben

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


Linux Journal July "Intro to Clojure on the Web"

2013-07-01 Thread greg r
by Reuven Lerner.  10 pages.  Compojure is next.

http://www.linuxjournal.com/content/july-2013-issue-linux-journal-networking

Regards,
Greg

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




Re: clojure-west videos clarification

2013-05-30 Thread Benjamin R. Haskell

On Thu, 30 May 2013, Jim - FooBar(); wrote:


Hi all,

I just stumbled upon this: 
http://clojurewest.org/news/2013/5/29/clojurewest-2013-videos-1.html
but I have a question! Can anyone clarify (maybe Alex?) what the dates 
right next to the presentation topic mean? Are they when the talk was 
given or when the talk will be released on infoq?



From that page:


"Videos are listed by the week of release (day will vary)."

--
Best,
Ben

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

2013-05-07 Thread greg r
You might want to check out "Clojure Data Analysis Handbook" by Eric 
Rochester.  There is an example using org.clojure/data.json and Incanter to 
read JSON format into an Incanter dataset.  You might find other recipes in 
the book useful as well:

http://www.packtpub.com/clojure-data-analysis-cookbook/book

I'm going through it (slowly) and learning a lot.  It's not a beginner's 
book.  Full blast functional programming for sure.

Regards,
Greg

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




Re: Clojure 1.5 print-table, org-mode babel, and org-mode HTML gen

2013-03-05 Thread greg r
I think I was wrong about the extra elisp code required for nrepl to 
evaluate babel Clojure code blocks.  This was from last year:

https://groups.google.com/forum/?fromgroups=#!searchin/nrepl-el/babel/nrepl-el/txLYH9tH6AU/hj0NkyF8YZ8J

I checked my .emacs file and the extra code for clojure babel is commented 
out, so the later versions of nrepl must have this feature included.
Too many months ago, I really need to put better notes and comments in my 
.emacs file!

Greg

On Monday, March 4, 2013 4:25:23 PM UTC-5, Mark C wrote:
>
> Very cool. Great looking doc! I just installed LaTeX and TeXworks so it's 
> off to play. (Other than incanter I already have the rest working, 
> including nrepl -  though I have to start up nrepl with nrepl-jack-in. Is 
> that what you were planning on doing? It would be cool to have it launched 
> by the first compile!).
>
>
>

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




Re: Clojure 1.5 print-table, org-mode babel, and org-mode HTML gen

2013-03-03 Thread greg r
Here's a little project I worked on:

https://github.com/Greg-R/incanterchartcustom

I'm just now learning git, so I hope the files are intact in the 
repository.  I cloned to another machine and they appear to be OK.

The Incanter chart PDF document shows what is possible with regard to 
documenting code and showing a nice export result.
The repository also includes the source .org file.  In theory, if you have 
everything set up correctly you can reproduce the
PDF document exactly.  Since it is generating PDF charts, there are lots of 
side-effects and whatever directory you are running
in will get filled up with the chart files.  I used LaTeX snippets within 
the org file to include the chart graphics in the exported tex
file and thus the eventual PDF.

I don't use C-c C-e p.  This doesn't always work, and I prefer C-c C-e l 
which exports the .tex file only.  I open the .tex file with
the Texworks application which has worked really well for me for editing 
LaTeX documents.  Texworks has the ability to jump between
the PDF and the .tex file and vice-versa, which makes troubleshooting much 
easier.

I did a bunch of data processing for work using org, Clojure, and Incanter 
to produce reports in PDF.  I created several Leiningen projects
to attack various aspects of the data manipulation.  Then within Clojure 
code blocks in org, the various namespaces are used to process
data at the appropriate points in the document.  None of the output was 
inserted directly into the org file.  That turned out to be impractical
as some of the generated documents were hundreds of pages long.  The 
Clojure/Incanter code chunks generated .tex files which were included
in the exported output via LaTeX code blocks.  Really in this case the 
org-babel system operated more as a document/code organizer than
as a programming system.  But what an organizer it is!!!  I saved hundreds, 
maybe thousands of man hours of manual document generating.

There were several technologies to learn to get it all to work in harmony:

Clojure
Incanter
Emacs (24.2) (including some Elisp in the .emacs file)
org
babel
Leiningen
LaTeX
Texworks
nrepl (this will require some extra stuff in the .emacs file to get babel 
to work)

It took a lot of work, but I think the org-babel system is really worth it!

Regards,
Greg

On Saturday, March 2, 2013 11:52:07 PM UTC-5, Mark C wrote:
>
> Worked like a charm. Thanks!
>
> Babel is fun. I really like the idea of being able to code in multiple 
> languages in one document - and have return values from one feed another. 
> And I just found out you can include TeX too - just starting to play with 
> that. I'd love to hear more about how you use clojure and org mode together.
>
> Mark
>>
>>
>>

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




Re: Clojure 1.5 print-table, org-mode babel, and org-mode HTML gen

2013-03-02 Thread greg r
Try adding

:results value raw

 to your options.
Here is what the org manual says:

The results are interpreted as raw Org mode code and are inserted directly
into the buffer. If the results look like a table they will be aligned as 
such by Org mode.

org is a fantastic environment for playing with Clojure.  I've got a lot 
done with it.

Regards,
Greg

On Friday, March 1, 2013 11:29:17 PM UTC-5, Mark C wrote:
>
> Sorry in advance if this doesn't turn out to be a clojure-specific 
> problem, but this seemed like a reasonable place to ask..
>
> Context: I'm a heavy org-mode user, so Mike Fogus' recent "usesthis" 
> postmentioning org-mode babel was quite 
> interesting. I got babel working fine 
> (for clojure, elisp, sh) then recalled that print-table in Clojure 1.5 
> outputs in org-mode compatible table format. Awesome. So naturally I'd like 
> to generate nice looking tables using something like:
>
> #+begin_src clojure :exports both
> (with-out-str (print-table [{:a 1 :b 2 :c 3} {:b 5 :a 7 :c "dog"}]))
> #+end_src
>
> (Using with-out-str is needed because print-table of course returns nil)
>
> But what I get when generating HTML (via "C-c C-e b") is not a table, but 
> the literal text of the table markup. I.e. compiling the above source block 
> yeilds:
>
> #+RESULTS: clojure-org-table
> : 
> : | :a |  :c | :b |
> : |+-+|
> : |  1 |   3 |  2 |
> : |  7 | dog |  5 |
>
> This makes sense. But how might one go about getting an HTML table 
> generated?
>
> I can edit the results show above and add some attributes before HTML 
> generation, e.g.
>
> #+CAPTION: This is a table with lines around and between cells
> #+ATTR_HTML: border="2" rules="all" frame="border"
> | :a |  :c | :b |
> |+-+|
> |  1 |   3 |  2 |
> |  7 | dog |  5 |
>
> This yields a nice looking table in HTML, but I would like to eliminate 
> this manual step. Any ideas??
>
> Thanks,
> Mark
>
>

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

2013-02-19 Thread Benjamin R. Haskell

On Sun, 17 Feb 2013, Jarod wrote:

James, Aaron and Jim: thanks for your help, but it still get the old 
error message and another: "Leiningen managed dependencies issue: 
problem resolving following dependencies: [jaad/jaad "0.8.4"]".  If 
anyone has time, my lein version is 1.7.1 and maven version is 2.2.1 
and I used the following steps:

1) I created a new Leningen project that I called "project1".
2) Within the project1 directory, I create sub-directory: "maven_repository"
3) I place the jaad jar file into maven_repository, go to maven_repository and 
run the following:
     mvn install:install-file -Dfile=jaad-0.8.4.jar -DartifactId=jaad 
-Dversion=0.8.4 -DgroupId=jaad -Dpackaging=jar -DlocalRepositoryPath=.


When trying to do this in the past, I used almost that command, but the 
"deploy:deploy-file" task (instead of install:install-file).  And 
instead of:


-DlocalRepositoryPath=.

I used:

-Durl=file:.

Additionally, it might(?) be better if you didn't start out with JAR 
file in the same directory (You'll end up with two copies of the JAR in 
the repo, one of which is unneeded).


So, the full replacement command:

mvn deploy:deploy-file -Dfile=/path/to/external/jaad-0.8.4.jar 
-DartifactId=jaad -Dversion=0.8.4 -DgroupId=jaad -Dpackaging=jar -Durl=file:.

In addition to installing the JAR file, the deploy:deploy-file task 
creates a .pom file and updates the (initially non-existent) 
maven-metadata.xml file.


Other than that, your steps looked the same as what has worked for me in 
the past.


--
Best,
Ben

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

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to read a txt file?

2013-02-01 Thread greg r
slurp works well, however, it reads the file in as a single string.  The 
result may not be readily useable depending on what you are doing.
 
I read in text files using clojure.java.io functions plus the core function 
line-seq.  What you get is a sequence whose elements are the individual 
lines of the file.
Then you can apply the power of the Clojure sequence library functions to 
the problem you are trying to solve.
This gets the text file directly to a data structure which is easily 
processed.
 
Here's a quick example function:
 
(use 'clojure.java.io)
 
(defn grab-file [file-path]
 (with-open [text-file-reader (reader file-path)]
   (do-all (line-seq text-file-reader
 
This returns a sequence of strings.  The file-path parameter is a string 
which is the path to the file.
Other functions in clojure.java.io are very useful for dealing with files.
Note the reader function is wrapped in a with-open function to make sure it 
is properly closed.
 
Regards,
Greg
 
 

On Friday, February 1, 2013 7:17:43 AM UTC-5, Roger75 wrote:

> I'd like to read a txt file using clojure. How do I do that? Any examples?

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

2013-01-30 Thread Kyle R. Burton
On Wed, Jan 30, 2013 at 10:18 AM, Marek Šrank wrote:

> The most simple thing would be to change the default value of *read-eval*
> to false...
>
>
Understanding that this may break existing code (how much?), I think it
would reflect well on the community to make decisions to improve safety and
security, especially with respect to defaults like this.  Avoiding
surprises after deployment is a virtue in my option.

+1

Regards,

Kyle Burton

-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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




Looking for ideas for a hack-night to contribute back

2012-12-21 Thread Kyle R. Burton
All,

We run a Clojure group out of our company's office.  We want to put
together a hack night where we work on something meaningful.  To that end I
thought I'd put that question to the wider community: what could be
valuable to the community for us to work on?  The group has a pretty varied
amount of experience, some of us use Clojure every day, some are new to it.


Regards,

Kyle


-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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

Re: Belgian Clojure base meetup?

2012-12-18 Thread Pierre R
Liege would be not too far

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

Re: Using functions from Java packages

2012-12-17 Thread greg r
Another possibility is the macro memfn.  From the documentation:

http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/memfn

Regards,
Greg

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

Re: Using functions from Java packages

2012-12-17 Thread greg r
Another possibility is the macro memfn.  From the documentation:

http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/memfn

Regards,
Greg

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

Re: another n00b defrecord combination question

2012-12-16 Thread Benjamin R. Haskell

On Sun, 16 Dec 2012, mond wrote:


One small thing Ben... when I try to use the final formulation I receive an 
error:
(def joined-products (map product-with-item products))

user=> (joined-products)
ClassCastException clojure.lang.LazySeq cannot be cast to clojure.lang.IFn  
user/eval241 (NO_SOURCE_FILE:9)

Any ideas?


To evaluate a list, Clojure tries to call the first element as a 
function, with the remaining elements as its arguments.  So, in this 
case:


  (joined-products)

Clojure tries to cast the first element of the list (joined-products) to 
be used as a Clojure function (clojure.lang.IFn), but it's a lazy 
sequence (clojure.lang.LazySeq).


You just don't need the list:

user=> joined-products
(#user.Product{...} #user.Product{...} #user.Product{...} ...)

--
Best,
Ben

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


Re: another n00b defrecord combination question

2012-12-15 Thread Benjamin R. Haskell

On Sat, 15 Dec 2012, mond wrote:


Thanks for picking up the cudgels Ben!


Ha.  It's nice to have reached a point where I feel at-all confident 
with any of this... happy to help.



To be honest I am struggling to repeat your advice in the REPL.  In 
any case, I decided to change the data structures in line with your 
advice and put the IDs into maps rather than the records.


(defrecord Item [name product quantity purchased])

(defrecord Product [name description prices])

(defrecord Price [price tax currency])

(def items [ {:id 1 :item (->Item "Brogues" "P-123" 1 true)}
             {:id 2 :item (->Item "Underpants" "P-345" 2 false)}
             {:id 3 :item (->Item "Shirt" "P-678" 1 true)} ])

(def carts [ (->Cart "Birthday" (first items))
             (->Cart "Xmas" (rest items)) ])

(def products [ {:id "P-1231" :product (->Product "Table" "Coffee Table" (->Price 375 21 
"EURO"))}
                {:id "P-3451" :product (->Product "Chairs" "Set of Four(4) chairs" 
(->Price 200 21 "EURO"))}
                {:id "P-123" :product (->Product "Brogues" "Men's Leather Slip on Brogues" 
(->Price 93.00 21 "EURO"))}
                {:id "P-345" :product (->Product "Underpants" "CK Y Fronts" (->Price 
23.50 21 "EURO"))}
                {:id "P-678" :product (->Product "Shirt" "Slim Fit White Vest Shirt" 
(->Price 45.99 21 "EURO"))}
                {:id "P-6781" :product (->Product "TableCloth" "Classic red and white checks 2m x 
2m" (->Price 17.99 21 "EURO"))} ])

Do you think the zipmap is still the way to go (to resolve the 
'foreign key' or could there be an easier way? I guess the fact that 
only items have to zipmapped is one advantage.


It seems like items and products should still have an :id property, so I 
don't think you need to detach the ID from its entity.  The zipmap'ed 
version is useful as an index, not really as its own structure.  So, it 
ends up as just a single map (not an array of maps) with ID's as keys, 
and the corresponding entity as the value:



(defrecord Item [id name product quantity purchased])

(defrecord Product [id name description prices])

(defrecord Price [price tax currency])

(def items [ (->Item 1 "Brogues" "P-123" 1 true)
             (->Item 2 "Underpants" "P-345" 2 false)
             (->Item 3 "Shirt" "P-678" 1 true) ])

(def products [ (->Product "P-1231" "Table" "Coffee Table" (->Price 375 21 
"EURO"))
                (->Product "P-3451" "Chairs" "Set of Four(4) chairs" (->Price 200 21 
"EURO"))
                (->Product "P-123" "Brogues" "Men's Leather Slip on Brogues" (->Price 
93.00 21 "EURO"))
                (->Product "P-345" "Underpants" "CK Y Fronts" (->Price 23.50 21 
"EURO"))
                (->Product "P-678" "Shirt" "Slim Fit White Vest Shirt" (->Price 45.99 21 
"EURO"))
                (->Product "P-6781" "TableCloth" "Classic red and white checks 2m x 2m" 
(->Price 17.99 21 "EURO")) ])

; two useful indexes(/indices?):

(def prod->item
  "An index from Product ID to an Item"
  (zipmap (map :product items) items))

(def id->product
  "An index from Product ID to a Product"
  (zipmap (map :id products) products))

; Then you can use that to get the products joined with their items:

(defn product-with-item
  "Find the Item info and merge it into the product, without overwriting :id"
  [product]
  (merge-with (fn [a b] a) product (prod->item (:id product

; example usage:

(product-with-item (id->product "P-345"))
;=> #user.Product{:id 2,
; :name "Underpants",
; :description "CK Y Fronts",
; :prices #user.Price{:price 23.5, :tax 21, :currency "EURO"},
; :purchased false,
; :quantity 2,
; :product "P-345"}

(def joined-products (map product-with-item products))
;=> A list of all the products joined with their items

--
Best,
Ben

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


Re: another n00b defrecord combination question

2012-12-15 Thread Benjamin R. Haskell

(responses inline)

On Sat, 15 Dec 2012, mond wrote:


I have defined these types of records for modelling a simple shopping cart:

; An item in the cart
(defrecord Item [id name product quantity purchased])

; The product that relates to the item in the cart
(defrecord Product [id name description prices])

; A price definition
(defrecord Price [price tax-rate currency])


; Sample items
(def items [
(->Item 1 "Brogues" "P-123" 1 true)
(->Item 2 "Underpants" "P-345" 1 false)
(->Item 3 "Shirt" "P-678" 1 true)
])

; Sample products
(def products [
   (->Product "P-123" "Brogues" "Men's Leather Slip on
Brogues" (->Price 93.00 21 "EURO"))
   (->Product "P-345" "Underpants" "CK Y Fronts" (->Price
23.50 21 "EURO"))
   (->Product "P-678" "Shirt" "Slim Fit White Vest Shirt"
(->Price 45.99 21 "EURO"))
   (->Product "P-1231" "Table" "Coffee Table" (->Price 375 21
"EURO"))
   (->Product "P-3451" "Chairs" "Set of Four(4) chairs"
(->Price 200 21 "EURO"))
   (->Product "P-6781" "TableCloth" "Classic red and white
checks 2m x 2m" (->Price 17.99 21 "EURO"))
   ])

My requirement is to combine data from the two collections such that I can
show the detailed product information for any item, for example:

(->Item 3 "Shirt" "Slim Fit White Vest Shirt" (->Price 45.99 21 
"EURO") 1 true)

When I tried to use merge-with union I had an error which surprised me 
since I thought records are also maps:


user=> (merge-with union items products)
ClassCastException user.Product cannot be cast to java.util.Map$Entry
clojure.core/key (core.clj:1465)


It looks like your second response worked around it, but for anyone 
following along: merge-with takes two or more maps, and uses the 
function you pass to merge the values of common keys.  So, the error is 
caused because merge-with expects items and products to be maps (not 
vectors of map-like things).



On Sat, 15 Dec 2012, mond wrote:


I think I am close to answering this myself (which is always nice!)

I have done the necessary joins with map and I can return a product
description

user=> (map (fn [item product] (= (:product item (:id product)))
(:description product)) items products)
("Men's Leather Slip on Brogues" "CK Y Fronts" "Slim Fit White Vest Shirt")


The (= (:product item (:id product))) here is being ignored. 
It "works" because your example arrays happen to have the items and 
products lined up properly (first three products match the items 
in order):


(map (fn [item product]
   (= (:product item (:id product))) ; the result of this comparison is 
thrown away
   (:description product) ; this is the value that is returned
) items products)

If you want to match things up, you might be better off creating maps 
for each category of thing:


; (with items and products as you'd defined them before)
(def product->item (zipmap (map :product items) items))
;=> {"P-123" #user.Item{...}, "P-345" #user.Item{...}, ...}

(def id->product (zipmap (map :id products) products))
;=> {"P-123" #user.Product{...}, "P-345" #user.Product{...}, ...}

(def combined (merge-with union product->item id->product))
;=> {"P-123" #user.Product{... with :quantity and :purchased },
;"P-1231" #user.Product{... with no Item keys ...}, ...etc.



Or a purchased status for the matching item

user=> (map (fn [item product] (= (:product item (:id product)))
(:purchased item)) items products)
(true false true)

But I have my knickers in a twist when I want to get more than one 
value out or a combination of values.


user=> (map (fn [item product] (= (:product item (:id product))) (:id item
:description product)) items products)
(user=> IllegalArgumentException Wrong number of args passed to keyword:
:id  clojure.lang.Keyword.throwArity (Keyword.java:85)

So does anyone have the last bit of syntax to help me take back a list 
of values from the inputs?


Other than the matching issue (the = form isn't being used -- see 
above), the problem with what you've written is that you want a map, 
rather than a list:


(map (fn [item product] {:id item :description product}) items products)

Or if you really want a list, you need to quote it:

(map (fn [item product] '(:id item :description product)) items products)

--
Best,
Ben

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


Re: another n00b defrecord combination question

2012-12-15 Thread Benjamin R. Haskell

On Sat, 15 Dec 2012, Benjamin R. Haskell wrote:


Or if you really want a list, you need to quote it:

(map (fn [item product] '(:id item :description product)) items products)


Oops, wrong.  Rather, you would want clojure.core/list:

(map (fn [item product] (list :id item :description product)) items products)

--
Best,
Ben

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


Re: [ANN] clj-xpath 1.3.3

2012-11-20 Thread Kyle R. Burton
On Tue, Nov 20, 2012 at 10:35 AM, Mark Rathwell wrote:

> You can contact the maintainers at the address found at the bottom of [1]
> and ask them to remove the clj-xpath group, but you probably don't want to
> do that if anyone is using the library.
>
>
Thanks for the link.  I have no idea if anyone is using the library w/o the
group name.  Is there any way to tell via Clojars?


Regards,

Kyle


-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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

Re: [ANN] clj-xpath 1.3.3

2012-11-20 Thread Kyle R. Burton
> The Leiningen coordiates are:
>>
>>   [org.clojars.kyleburton/clj-**xpath "1.3.3"]
>>
>>
> Just curious, why isn't that just [clj-xpath "1.3.3"]? Searching clojars,
> you seem to have uploaded 1.3.0 a while back...
>
>
That was a mistake.  I didn't want to claim a global 'clj-xpath' namespace
on Clojars so I added a namespace.  I'm not sure if I can remove that.



Kyle

-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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

Re: [ANN] clj-xpath 1.3.3

2012-11-20 Thread Kyle R. Burton
> Dependency information is at the very bottom of the document? How are
> newcomers
> supposed to find it? Please make it more visible.
>


Good point.  I've moved the dependency info up towards the top of the
README.


Thanks for the feedback.

Best Regards,

Kyle

-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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

[ANN] clj-xpath 1.3.3

2012-11-19 Thread Kyle R. Burton
clj-xpath is a library that makes it easier to with XPath from Clojure.

I've never announced this library before (or any for that matter).  Someone
recently sent me a pull request to fix an issue in the README (during the
Conj) so I thought I'd announce it to solicit feedback.

The Leiningen coordiates are:

  [org.clojars.kyleburton/clj-xpath "1.3.3"]

An introduction and some documentation is available here:

  http://kyleburton.github.com/clj-xpath/site/

The project is on github here:

  https://github.com/kyleburton/clj-xpath


Best Regards,

Kyle

-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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

Can't go to the Conj, I have 2 tickets

2012-11-13 Thread Kyle R. Burton
Please contact me off list if anyone is interested in purchasing either of
them.

I contacted the organizers and they are transferable.

I'm sorry I'm not going to be able to make it.

Best Regards,

Kyle

-- 
Twitter: @kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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

Re: what is the simplest user auth system possible?

2012-10-26 Thread Pierre R
+1 for Persona. Please give your user a chance to break the cycle of 
password madness ;-)

On Friday, October 26, 2012 1:10:42 PM UTC+2, Dave Sann wrote:
>
> Sorry, I meant to say authentication.
>
> On Friday, 26 October 2012 22:06:48 UTC+11, Dave Sann wrote:
>>
>> For authorisation, I really like mozilla persona (previously browserid) 
>> which I discovered from refheap. javascript lib plus an http request from 
>> the server to validate. really simple.
>>
>> https://login.persona.org/
>>
>> Dave
>>
>>
>>
>> On Friday, 26 October 2012 01:35:53 UTC+11, Stephen Compall wrote:
>>>
>>> On Oct 25, 2012 9:04 AM, "larry google groups"  
>>> wrote:
>>> > For my next step, I need to come up with a user system. My needs are 
>>> minimal: I only need to know when someone is logged in, and I need to 
>>> associate them with some user id (the id will simply be the id from a user 
>>> table kept in MySql). 
>>> >
>>> > I am curious what is the absolutely easiest way to do this?
>>>
>>> The easiest auth system to write is the one that's already written.
>>>
>>> https://github.com/cemerick/friend
>>>
>>> --
>>> Stephen Compall
>>> If anyone in the MSA is online, you should watch this flythrough. 
>>>
>>

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

Re: Some Friend documentation and regarding documentation in general

2012-10-23 Thread Pierre R
Thanks David for the extra doc.

I have had a try with OpenID. Everything works kind of expected.

I had a question about "302 redirection prior to authentication" that I 
posted on github.

Another question is how to link the concept of roles with the openid 
credentials.

IMHO the doc is really lacking and I have to say I was expecting more 
guidance in the code itself.

I guess a lot of stuff obvious to an experienced clojure developers are 
still dark magic to me.

In particular it is rather difficult to understand how to write a 
crendential-fn and this link won't help you ;-)
https://github.com/cemerick/friend/blob/master/docs/credentials.md

For "OpenId" I have blindly used the identity function without much 
understanding ...

I am using Friend to scratch a little auth server. Not sure it is the best 
fit for that purpose. I will see.

I hope Friend is going to be reviewed by an extended community of people 
much more qualified than myself to talk about such matter.

Still docs could be improved and I believe helps could come from pull 
requests to suggest the addition of code comments there and there. 

If I dig far enough in the code, I would be pleased to help.

Thanks for the hard work.

Cheers,

Le mardi 23 octobre 2012 17:50:25 UTC+2, Patrik Sundberg a écrit :
>
> These are great tutorials. Thanks for publishing.
>
> Right now I'm looking for something similar using the OpenID workflow. I 
> see it's there but how I use to for example create a "sign in with google" 
> setup is less clear to me.
>
> Has anyone got a good OpenID example out there somewhere?
>
> On Saturday, October 6, 2012 4:50:05 PM UTC+1, David Della Costa wrote:
>>
>> Hi folks, 
>>
>> I've been pretty slack in communicating via the mailing list, but I 
>> realized today that there is a lot of important dialogue going on here 
>> so I have to make more of an effort to take part--I want to be a part of 
>> this community! 
>>
>> In any case, I've been using Friend a lot lately, since I come from 
>> Ruby-on-Rails-land, and it addresses a lot of the pain points that 
>> Devise does for me. 
>>
>> But (as has been mentioned in other threads quite recently), 
>> documentation is definitely the Clojure community's week point: it's 
>> inconsistent, formatted inconsistently (Ring and Compojure, for example, 
>> are wonderful exceptions), and updated erratically.  When it's good, 
>> it's great; but when it's not, it puts me off from using a library.  For 
>> example, I stayed away from Enlive for months before I realized what a 
>> useful library it is--so I re-wrote the README to suit my tastes 
>> (https://github.com/ddellacosta/enlive). 
>>
>> I think Chas Emerick writes much better docs than much of what 
>> accompanies most Clojure libraries, but he's quite an advanced Clojure 
>> developer, and he's moving very fast--so as a newbie, I had difficulty 
>> even with his relatively good docs for Friend.  And I suspect you'll be 
>> getting more and more folks from the web development world in the next 
>> few years like me.  So it will be good to have things from the 
>> perspective of someone not just trying to grok the libraries that exist, 
>> but also trying to understand how Clojure works, and how the eco-system 
>> fits together. 
>>
>> I've written some material on how to use Friend, including some OAuth2 
>> resources.  I'd appreciate any feedback you can give, I'm pretty new to 
>> Clojure (and Lisp in general). 
>>
>> In any case: 
>>
>> https://github.com/ddellacosta/friend-interactive-form-tutorial 
>> https://github.com/ddellacosta/friend-oauth2-examples 
>> https://github.com/ddellacosta/friend-oauth2 
>>
>> I have a bunch of other Clojure-related stuff on my github account too, 
>> feedback is most welcome! 
>>
>> Cheers, 
>> DD 
>>
>

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

Re: Clojure : a good start for non-programmers?

2012-09-26 Thread greg r

I would go with the book "Simply Scheme, Introducing Computer Science" by 
Harvey and Wright.
Install the Racket system on your computer, and have at it.

http://racket-lang.org/

Once you come up to speed on Scheme, you will have no trouble with core 
Clojure.
But if you venture in the the Java interop, you will have to understand 
object oriented programming.
A good resource for Java is "Objects First with Java, A Practical 
Introduction using BlueJ".

Also you can want watch the Brian Harvey lectures on functional programming 
on Youtube.
Good luck, functional programming is challenging and fun.

Regards,
Greg

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

Clojure : a good start for non-programmers?

2012-09-25 Thread Gregorius R.
Hello Clojurists!

I'm a person in middle age (you know, too old to rock'n'roll, to young to 
die) and would like to programm but starting with functional programming. 
Regarding this i have some questions:

is clojure a good start to learn programming?
which (prerfer free online) is a good tut to start? 
am i to old for this stuff? 

thnx in advance for all responses
Greg

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

Re: slime-ritz help needed on clean emacs 24.2.1 new setup

2012-09-20 Thread greg r
How about trying:

nrepl-jack-in

This is working good here, at least from within a leiningen project.

Regards,
Greg

On Saturday, September 15, 2012 2:39:36 AM UTC-4, sal wrote:
>
> Hi Everyone,
>   Trying to setup emacs 24.2 on mac osx clean setup, nothing else.
>
>   clojure-mode 20120808 installed  Major mode for Clojure code 
> [source: github]
>   nrepl 20120912.248 installed  Client for Clojure nREPL [source: 
> github]
>   nrepl-ritz 20120913 installed  nrepl extensions for ritz 
> [source: github]
>   slime-ritz 20120914 installed  slime extensions for ritz 
> [source: github]
>
> I have following things installed
>
> and my .emacs looks like
> (require 'package)
> (add-to-list 'package-archives
>   '("marmalade" . "http://marmalade-repo.org/packages/";) t)
> (add-to-list 'package-archives
>   '("melpa" . "http://melpa.milkbox.net/packages/";) t)
> (package-initialize)
>
>
> i am able to run clojure-jack-in and start swank server, but never see the 
> command slime-mode, slime-connect in emacs.
>
> Can someone point me to some other setup or how to fix this.
>
> Thanks
>  Sal
>

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

Re: Found bug in contains? used with vectors.

2012-09-03 Thread greg r
You could try the function some.

=> (some #{3} [1 2 3])
3
=> (some #{3} [1 2 5])
nil

This uses a set as a predicate function.

Greg

On Monday, September 3, 2012 7:03:07 AM UTC-4, Goldritter wrote:
>
> I use Clojure 1.4.0 and wanted to use 'contains?' on a vector and get 
> following results:
>
> => (contains? [1 2 3] 3)
> false
> => (contains? [1 2 3] 2)
> true
>
> As it seems 'contains?' does not check for the last entry in the vector.
>
> And an other question.
> Why does contains? returns everytime 'false' when used on a list?
> => (contains? (list 1 2 3) 1)
> false
> => (contains? (list 1 2 3) 2)
> false
> => (contains? (list 1 2 3) 3)
> false
>
>

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

Re: using "lein repl" as the Emacs Inferior Lisp REPL as opposed to a custom script that does "java -jar clojure-1.4.0.jar"

2012-08-26 Thread greg r
Hello, I am also using Leiningen in Ubuntu, and I feel your pain.
One thing I would suggest is to remove anything related to your tool chain 
which was installed by Ubuntu.
(except maybe emacs 24.x).
You clearly have Clojure installed via the usual Ubuntu Software Center or 
related mechanism.
Uninstall it!

I would skip directly to version 2 of Leiningen.
You will find that dependency jars get dropped into the hidden file 
~/.m2/repository,
for example, when you use the "lein install" command that is where they go.

Get clojure mode via the emacs package manager.  Get the latest!
I got stuck on an old version which caused much confusion.  I still see 
version 1.7.1
in the list of packages, whereas I have installed version 1.11.5.  I 
believe this is
due to my .emacs file setting package archives for ELPA, gnu, and 
marmalade, and
some obsolete stuff still exists and hazardous to the newbie.

I don't have anything related to slime or swank or swank-clojure installed 
via the
emacs package manager.  However, I do have lein-swank listed in my 
~/.lein/profile.clj
file.

Another thing to uninstall are any version of slime and swank which were 
installed
via the "Ubuntu Software Center".  These caused lots of confusion.  This 
stuff may
also be hanging out in your ~/.emacs.d directory.

I installed version 24.x emacs manually.  I'm not familiar with Ubuntu 
Precise, but perhaps
that distribution is installing a usable version of emacs.  I had to 
install a few libraries
to get it all going, I think some X window related stuff using the Synaptic 
Package Manager.

M-x clojure-jack-in is the way to fire up a repl running in an emacs buffer.

I've got a working installation, it's easy to use and powerful, but if I 
said I could start from
scratch again and make it work in 5 minutes I would be a liar.  I think the 
best thing to do is a thorough
housecleaning, start from scratch with version 2 leiningen, emacs 24 and 
latest clojure-mode.

Good luck!  I'm test driving nrepl next.
Greg




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

Looking for help with a deadlock issue

2012-07-27 Thread Kyle R. Burton
I encountered a deadlock on one of our production systems (one out of
3) last night.  Looking at a thread dump of the JVM, there are several
(over 200) threads that are all waiting on a
java.util.concurrent.locks.ReentrantLock from Keyword.intern.

I've put up the thread dump and information about the os and jvm versions here:

  https://github.com/relaynetwork/20120727-deadlock-issue

The part of our application that deadlocked is a web service that uses
Compjure and Jetty.  Other parts of the application did not deadlock
(we have AMQP consumers that were still processing successfully).

I have since restarted the service and it is processing again.  I'm
not sure what to look at next, can anyone suggest a next step for
determining the cause?


Best Regards,

Kyle Burton

-- 
Twitter: @kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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


  1   2   3   4   5   >