clojure.algo.monads - no tests for monadic laws

2021-03-30 Thread Rostislav Svoboda
Hi, the test_monads.clj contains test cases for some arbitrary values but
no test cases against monadic laws. I wonder why is it so? It's not really
necessary to have them (everything works), but it won't hurt to have them
around, I'd say. At least for learning purposes.
What do you think?

Thanks

Direct link:
https://github.com/clojure/algo.monads/blob/master/src/test/clojure/clojure/algo/test_monads.clj

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


Re: symbol is not a symbol in (def (symbol "x") ...) ???

2020-10-05 Thread Rostislav Svoboda
This is pure gold - your answers! Thanks a lot. So the take outs and key
ideas for me are:

- The syntax quote '`', unquote '~' and I expect also the unquote splicing
'~@' can be nested.
- A global var doesn't need to be created by the `def` (in macro). Use the
`intern` function directly (and be aware of possible lazy evaluation).
- There's more to `macroexpand` than just the debugging. Think out of the
box!*

At the first glance I like the "use `intern`" idea at most and I'll give it
a try it the following form:
(defn def-stuff [x] (intern *ns* (symbol x) x))
(map def-stuff [...])
This way, I naively hope, I can reason about it the functional-programming
way:
Just create a function and map it over something. No code generation or
expansion trickery involved.

Again, thank you very much, I consider adding your examples to
https://clojuredocs.org/clojure.core/def

Bost

*as always :)


Le lun. 5 oct. 2020 à 13:02, Jeremy Heiler  a
écrit :

> Do you know about macroexpand?
>
> user=> (defmacro m1 [v] `(def (symbol ~v)))
> #'user/m1
> First argument to def must be a Symbol
> user=> (macroexpand '(m1 "foo"))
> (def (clojure.core/symbol "foo"))
> user=> (defmacro m2 [v] `(def ~(symbol v)))
> #'user/m2
> user=> (macroexpand '(m2 "foo"))
> (def foo)
>
> The trick here is that you need to convert v into a symbol when the macro
> is expanded, not at runtime.
>
> On Oct 2, 2020 at 3:37:52 PM, Rostislav Svoboda <
> rostislav.svob...@gmail.com> wrote:
>
>> I have a problem with `def` in macros. I'd like to create a bunch of
>> following definitions:
>>
>> (def foo "FOO")
>> (def bar "BAR")
>> (def baz "BAZ")
>>
>> So I wrote a macro:
>>
>> user=> (defmacro def-stuff [v] `(def (symbol ~v)
>> (clojure.string/upper-case ~v)))
>> #'user/def-stuff
>>
>> And I'd like to do map this macro over a vector of strings:
>>
>> user=> (map (fn [n] (def-stuff n)) ["foo" "bar" "baz"])
>> Syntax error compiling def at (REPL:1:14).
>> First argument to def must be a Symbol
>>
>> A little check indicates that everything should be fine:
>> user=> (symbol? (symbol "foo"))
>> true
>>
>> but it is not:
>> user=> (def (symbol "foo") "FOO")
>> Syntax error compiling def at (REPL:1:1).
>> First argument to def must be a Symbol
>>
>> ???
>> Interestingly enough:
>>
>> user=> (defmacro def-stuff [v] `(def v (clojure.string/upper-case ~v)))
>> #'user/def-stuff
>> user=> (map (fn [n] (def-stuff n)) ["foo" "bar" "baz"])
>> (#'user/v #'user/v #'user/v)
>>
>> Strangely enough a `v` gets (re)defined.
>>
>> To me it looks like the lexical-binding of macro-parameters is ignored if
>> there's a `(def  ...)` inside this macro.
>>
>> Can anybody explain what's going on here please? 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/clojure/CAEtmmex6Kn%3DQ8AZ-AyYoZLpYVu7%2BWnX3u7vQBgydiA%2B1jUt9Rw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/clojure/CAEtmmex6Kn%3DQ8AZ-AyYoZLpYVu7%2BWnX3u7vQBgydiA%2B1jUt9Rw%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop recei

symbol is not a symbol in (def (symbol "x") ...) ???

2020-10-02 Thread Rostislav Svoboda
I have a problem with `def` in macros. I'd like to create a bunch of
following definitions:

(def foo "FOO")
(def bar "BAR")
(def baz "BAZ")

So I wrote a macro:

user=> (defmacro def-stuff [v] `(def (symbol ~v) (clojure.string/upper-case
~v)))
#'user/def-stuff

And I'd like to do map this macro over a vector of strings:

user=> (map (fn [n] (def-stuff n)) ["foo" "bar" "baz"])
Syntax error compiling def at (REPL:1:14).
First argument to def must be a Symbol

A little check indicates that everything should be fine:
user=> (symbol? (symbol "foo"))
true

but it is not:
user=> (def (symbol "foo") "FOO")
Syntax error compiling def at (REPL:1:1).
First argument to def must be a Symbol

???
Interestingly enough:

user=> (defmacro def-stuff [v] `(def v (clojure.string/upper-case ~v)))
#'user/def-stuff
user=> (map (fn [n] (def-stuff n)) ["foo" "bar" "baz"])
(#'user/v #'user/v #'user/v)

Strangely enough a `v` gets (re)defined.

To me it looks like the lexical-binding of macro-parameters is ignored if
there's a `(def  ...)` inside this macro.

Can anybody explain what's going on here please? 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/CAEtmmex6Kn%3DQ8AZ-AyYoZLpYVu7%2BWnX3u7vQBgydiA%2B1jUt9Rw%40mail.gmail.com.


Re: Building klipse demands too much

2020-06-27 Thread Rostislav Svoboda
> There are some instructions in the
> https://github.com/viebel/klipse/blob/master/contributing.md
> also about deploying to clojars (at the bottom):
> lein with-profile deploy deploy clojars
> but "deploy deploy" is really written twice there so I'm not sure if it's
correct or not. The
> ./scripts/build
>seems to be running fine but it produces only a js file.

It seems like "deploy deploy" (twice) is correct. And
lein with-profile deploy install
produces a 59kB large jar file - that's about the expected size. It's just
the
lein install
which is running indefinitely.

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


Re: Building klipse demands too much

2020-06-27 Thread Rostislav Svoboda
> It looks like it's meant to be compiled into a js file, rather than a
local maven dependency

There are some instructions in the
https://github.com/viebel/klipse/blob/master/contributing.md
also about deploying to clojars (at the bottom):
lein with-profile deploy deploy clojars
but "deploy deploy" is really written twice there so I'm not sure if it's
correct or not. The
./scripts/build
seems to be running fine but it produces only a js file.

$ bash -c ./scripts/build
[Figwheel] Validating figwheel-main.edn
[Figwheel] figwheel-main.edn is valid \(ツ)/
[Figwheel] Compiling build plugin to
"resources/public/plugin/public/cljs-out/plugin-main.js"
Jun 27, 2020 10:35:18 PM com.google.javascript.jscomp.LoggerErrorManager
println
WARNING: WARNING - unknown @define variable
figwheel.core.load_warninged_code

Jun 27, 2020 10:35:18 PM com.google.javascript.jscomp.LoggerErrorManager
printSummary
WARNING: 0 error(s), 1 warning(s)
[Figwheel] Successfully compiled build plugin to
"resources/public/plugin/public/cljs-out/plugin-main.js" in 111.289 seconds.
[Figwheel] Validating figwheel-main.edn
[Figwheel] figwheel-main.edn is valid \(ツ)/
[Figwheel] Compiling build plugin_prod to
"resources/public/plugin_prod/public/cljs-out/plugin_prod-main.js"
Jun 27, 2020 10:36:47 PM com.google.javascript.jscomp.LoggerErrorManager
println
WARNING: WARNING - unknown @define variable
figwheel.core.load_warninged_code

Jun 27, 2020 10:36:47 PM com.google.javascript.jscomp.LoggerErrorManager
printSummary
WARNING: 0 error(s), 1 warning(s)
[Figwheel] Successfully compiled build plugin_prod to
"resources/public/plugin_prod/public/cljs-out/plugin_prod-main.js" in 70.3
seconds.


Le sam. 27 juin 2020 à 23:09, James Reeves  a écrit :

> I started it up on MacOS and also found that after only a few minutes,
> there was a 4GB jar. This is clearly not correct, and a 110GB jar is
> definitely not correct.
>
> However, I don't see anything in the README about lein install being the
> right way to install this. It looks like it's meant to be compiled into a
> js file, rather than a local maven dependency.
>
> On Sat, 27 Jun 2020 at 21:52, Rostislav Svoboda <
> rostislav.svob...@gmail.com> wrote:
>
>> I'm trying to build klipse. I launched
>> lein install
>> more than 3.5 hours ago. It's still running and the
>> target/klipse-7.9.7.jar is >110GB (gigabytes) large and increasing... :( Is
>> that normal? Does anybody know what the space and time requirements are?
>>
>> I issued a ticket https://github.com/viebel/klipse/issues/371 already
>> (sorry for duplicating) but I hope here I reach a larger audience and get
>> the answer quicker - before my HDD breaks apart.
>>
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/clojure/CAEtmmez6_488LoQzw%2BZ327ANPOyG%3DrM4L%2Bs6du-hY3RSvD3rbA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/clojure/CAEtmmez6_488LoQzw%2BZ327ANPOyG%3DrM4L%2Bs6du-hY3RSvD3rbA%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>
>
> --
> James Reeves
> booleanknot.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/CALg24jRxUXPC7nAso%3DDdYvjZffez9Jt717Akjqe23h%2Bhvs9-xA%40mail.gmail.com
> <https://groups.google.com/d/m

Building klipse demands too much

2020-06-27 Thread Rostislav Svoboda
I'm trying to build klipse. I launched
lein install
more than 3.5 hours ago. It's still running and the target/klipse-7.9.7.jar
is >110GB (gigabytes) large and increasing... :( Is that normal? Does
anybody know what the space and time requirements are?

I issued a ticket https://github.com/viebel/klipse/issues/371 already
(sorry for duplicating) but I hope here I reach a larger audience and get
the answer quicker - before my HDD breaks apart.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/CAEtmmez6_488LoQzw%2BZ327ANPOyG%3DrM4L%2Bs6du-hY3RSvD3rbA%40mail.gmail.com.


Re: Announcement: clj-paper-print Clojure library for easy printing on actual paper.

2020-06-14 Thread Rostislav Svoboda
> I just wanted to announce the release of my project: clj-paper-print

Could you put a picture (i.e. a scan) of a document printed using your
library in the README.md? So that people A) actually see what exactly
to expect from your library and B) better remember your work.
And just to have a higher noise-to-information ratio - instead of just
adding, please consider replacing the
plate-Impressio-Librorum-engraving-drawing-Nova-Reperta-1605.jpg with
the actual scan ;-)

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


Re: WebApp authentication and authorization - up-to-date information?

2020-03-21 Thread Rostislav Svoboda
> Every year or two I go looking for something like this, or at least a
guide or tutorial.  And every time, I encounter at least one of the
following:
>  - A key element of the guide is outdated or depends on a library which
is outdated (and where in some cases there is a reference made that
everyone should switch to library Y, but then they're on their own to
figure out how to use Y in this context)

agree

>  - One or more element of the simple app is not illustrated in complete
detail, but the author points the reader to a tutorial for that element
elsewhere... except that some of the guides use boot while some use lein
while some use deps (which itself isn't necessarily a huge deal, but forces
the beginner to start diving into build/dependency management tools rather
than getting a first app built)

agree

>  - The guide doesn't cover a complete app

agree

> For whatever reason, searches for Clojure-related topics tend to
(largely/only) turn up results that are 5+ years old.  That's an eternity
in internet time.  Yes there are some great current libraries that probably
do everything one might need, but still there are roadblocks which
beginners will encounter where the answers are nonexistent or outdated.

agree

> With respect to database interaction, I know of but haven't used Korma
(which now appears to be dead?), HugSQL, and others.  Of course there's
straight JDBC Java use (whereby I should just write my own thin JDBC
wrappers like I did back in the Java Server Pages days...?).  <- If that's
the answer, then I have no problem doing it; but I would suspect there's
some other pattern that leverages some of the strengths of Clojure a bit
more.  This one current example is basically useless:
https://devcenter.heroku.com/articles/clojure-web-application .   It
illustrates enough to show that Clojure can route and respond to http
requests, and it can touch a database; but surely it is not an example of
how people actually write Clojure web apps.

agree

> In contrast, there are numerous Django and Rails guides which illustrate
the complete process of building a web app with their language+framework.
They even tend to include some amount of tests and even
internationalization (as well as authentication, database interaction, and
sometimes API/json cases).
>
> Most of us don't get hired into Clojure companies, so any learning and
doing is more of an evening/solo activity.

agree. BTW it's 1 a.m. over here

It's 99% ... no, it's really like somebody's reading my mind and describing
the my situation. Uff.

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


WebApp authentication and authorization - up-to-date information?

2020-03-21 Thread Rostislav Svoboda
I have difficulties finding up-to-date information, tutorials, articles,
blog posts etc. concerning WebApp authentication and authorization.

The most "recent" useful articles I found are from 2015 and 2014:
https://rundis.github.io/blog/2015/buddy_auth_part2.html
https://blog.knoldus.com/google-sign-in-using-clojure/

Uhm, my google-fu is getting weak... can anyone help please? Thanks

Bost

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


Re: Online Clojure COVID-19 Hackathon

2020-03-17 Thread Rostislav Svoboda
> > We are organizing an online Clojure hackathon for studying COVID-19
data.
>
> I think I'll a bit of a head start :) https://github.com/Bost/corona_cases.
PRs appreciated.

FYI my project consumes data from the https://github.com/ExpDev07/co
ronavirus-tracker-api provided by this web service https://coronavirus
-tracker-api.herokuapp.com/all
(https://github.com/ExpDev07/coronavirus-tracker-api).
Unfortunately this data is always delayed by some 12 to 24 hours.

I'd would be great if somebody could have a look at the https://github.com/
CSSEGISandData/COVID-19/issues/558#issuecomment-599426644 , especially at
the activities around the Corona Data Scrapper https://github.com/lazd/
coronadatascraper/ and create e.g. a web service providing the latest data
in the same format as the coronavirus-tracker-api web service.

I don't have any time left to follow the development around the Corona Data
Scrapper and had to give up on proving the top latest information down the
line of consumption :-(

Thanks


Coronavirus disease 2019 (COVID-19) information on Telegram Messenger https
://t.me/corona_cases_bot

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


Re: Online Clojure COVID-19 Hackathon

2020-03-17 Thread Rostislav Svoboda
> We are organizing an online Clojure hackathon for studying COVID-19 data.

I think I'll a bit of a head start :) https://github.com/Bost/corona_cases

Anyway, PRs very much appreciated.

Bost


Coronavirus disease 2019 (COVID-19) information on Telegram Messenger
https://t.me/corona_cases_bot


Le mar. 17 mars 2020 à 21:30, Daniel Slutsky  a
écrit :

> Hello everybody.
>
> We are organizing an online Clojure hackathon for studying COVID-19 data.
>
> Please mark your preferred dates:
> https://twitter.com/scicloj/status/1240010550555353088
>
> Wishing you good health and better times.
>

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


Re: [ANN] nREPL 0.6

2019-02-06 Thread Rostislav Svoboda
> I’ve done 0 work on this release

Out of Earth's population 7,682,276,358 there's not more than 10K aof
people being capable of doing the "0 work" on this release.
So: One big and great: Thank You All Guys!

Bost

PS: On the other hand: NOBODY, not even the comrade Stalin is so
great, not fit in a coffin... :)

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

2019-01-31 Thread Rostislav Svoboda
Hi Alex,

> quote is a special form that returns the value you pass it, without evaluation

Aah! "without evaluation" is the key! Now it makes sense. Yea you
mentioned it before already, but it takes twice the effort to undo and
re-comprehend an acquired misconception. Thank you so much!

Would you mind if I add this example to
http://clojuredocs.org/clojure.core/quote ?
It's basically your explanation in the REPL.

;; Quote returns the argument you pass it, without evaluation. So:
;; In the expression `(quote 42)` the argument is the number 42 and...
user> (= (quote 42) 42)
true ;; ... it is returned without any evaluation and...
user> (= (type (quote 42)) (type 42) java.lang.Long)
true ;; ... as expected, without changing it's type.

;; In the expression `(quote (quote 42))` the argument is the list of
two elements
;; `(quote 42)` and...
user> (= (quote (quote 42)) (list (read-string "quote") (read-string "42")))
true ;; ... and it is returned without any evaluation and...
user> (= (type (quote (quote 42))) (type (list "1st-elem" "2nd-elem"))
 clojure.lang.PersistentList)
true ;; ... again, without changing it's type.


Bost

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

2019-01-30 Thread Rostislav Svoboda
Hi Alex,

> You can see the special cases of nil, false, and true in the LispReader here 
> if you're curious:
> https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L393-L413

I think it's not the special case of nil, false and true what's
causing me headache. I'm having difficulties wrapping my head around
following:

;; First quoting doesn't change the type:
user=> (= (type 42) (type (quote 42)))
true
;; But consequent quoting changes the type. Ugh ???
user=> (= (type 42) (type (quote (quote 42
false

My conclusion: a state has been introduced to the computation.
(presumably by the quote)
Or am I missing here something?

Bost

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

2019-01-29 Thread Rostislav Svoboda
Hi Alex,

> Sets are treated as predicate functions which are valid when they produce a 
> logically true value.

So then my question boils down to:
Why is then (boolean (quote nil)) => false and (boolean (quote
anything)) => true?
And this boils down to:
Why a type of quoted symbol (type (quote nil)) is nil and not
clojure.lang.Symbol as is it the case for (type (quote anything))?
Here the source says:
(defn type
  "Returns the :type metadata of x, or its Class if none"
  {:added "1.0"
   :static true}
  [x]
  (or (get (meta x) :type) (class x)))

And if I put few println's here, I see that in both cases (type (quote
nil)), (type (quote anything)) the input arg x is nil, IOW the
information "the arg x has a type of quoted symbol" is lost here. IOW
the clojure.core/type eagerly reports the type of e.g.:
(type (quote true)) => java.lang.Boolean
(type (quote "foo")) => java.lang.String
(type (quote nil)) => nil
(type (quote 1)) => java.lang.Long
etc. when I expect clojure.lang.Symbol, as for:
(type (quote anything)) => clojure.lang.Symbol

Hmm... *if* this type-hiding is a bug then I guess it's crawling too
deeply to fix it, right? :)
Anyway, thank you for your response, Alex!

Bost


Le mar. 29 janv. 2019 à 21:40, Alex Miller  a écrit :
>
> Sets are treated as predicate functions which are valid when they produce a 
> logically true value. Sets with logically false values nil or false will fail 
> this check. This is not a spec thing, but a general thing to be aware of in 
> Clojure when using sets as functions.
>
> If you want nils, use (s/gen nil?).
> If you want falses, use (s/gen false?).
> If you want either, the simplest thing is probably (s/gen (s/nilable 
> false?)), but keep in mind that the s/nilable generator is constructed to 
> only produce nils 10% of the time, so you'll get 10% nils, 90% falses.
>
> You could also use the more cumbersome (s/gen (s/nonconforming (s/or :n nil? 
> :f false?))) which should give you about 50/50 mix.
>
>
> On Tuesday, January 29, 2019 at 2:23:50 PM UTC-6, Bost wrote:
>>
>> Could anybody explain please why I can't get a sample of falses or
>> quoted nils / falses here?
>>
>> foo.core> (clojure-version)
>> "1.10.0"
>> foo.core> (require '[clojure.spec.gen.alpha :as gen]
>>'[clojure.spec.alpha :as s])
>> nil
>> foo.core> (gen/sample (s/gen #{'nil}))
>> Error printing return value (ExceptionInfo) at
>> clojure.test.check.generators/such-that-helper (generators.cljc:320).
>> Couldn't satisfy such-that predicate after 100 tries.
>>
>>
>> Other interesting and/or relevant cases are:
>>
>> foo.core> (gen/sample (s/gen #{'n}))
>> (n n n n n n n n n n)
>> foo.core> (gen/sample (s/gen #{true}))
>> (true true true true true true true true true true)
>> foo.core> (gen/sample (s/gen #{'true}))
>> (true true true true true true true true true true)
>> foo.core> (gen/sample (s/gen #{false}))
>> Error printing return value (ExceptionInfo) at
>> clojure.test.check.generators/such-that-helper (generators.cljc:320).
>> Couldn't satisfy such-that predicate after 100 tries.
>> foo.core> (gen/sample (s/gen #{'false}))
>> Error printing return value (ExceptionInfo) at
>> clojure.test.check.generators/such-that-helper (generators.cljc:320).
>> Couldn't satisfy such-that predicate after 100 tries.
>> foo.core> (gen/sample (s/gen #{nil}))
>> Error printing return value (ExceptionInfo) at
>> clojure.test.check.generators/such-that-helper (generators.cljc:320).
>> Couldn't satisfy such-that predicate after 100 tries.
>>
>>
>> Thanx
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from 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.


(gen/sample (s/gen #{'nil})): Couldn't satisfy such-that predicate

2019-01-29 Thread Rostislav Svoboda
Could anybody explain please why I can't get a sample of falses or
quoted nils / falses here?

foo.core> (clojure-version)
"1.10.0"
foo.core> (require '[clojure.spec.gen.alpha :as gen]
   '[clojure.spec.alpha :as s])
nil
foo.core> (gen/sample (s/gen #{'nil}))
Error printing return value (ExceptionInfo) at
clojure.test.check.generators/such-that-helper (generators.cljc:320).
Couldn't satisfy such-that predicate after 100 tries.


Other interesting and/or relevant cases are:

foo.core> (gen/sample (s/gen #{'n}))
(n n n n n n n n n n)
foo.core> (gen/sample (s/gen #{true}))
(true true true true true true true true true true)
foo.core> (gen/sample (s/gen #{'true}))
(true true true true true true true true true true)
foo.core> (gen/sample (s/gen #{false}))
Error printing return value (ExceptionInfo) at
clojure.test.check.generators/such-that-helper (generators.cljc:320).
Couldn't satisfy such-that predicate after 100 tries.
foo.core> (gen/sample (s/gen #{'false}))
Error printing return value (ExceptionInfo) at
clojure.test.check.generators/such-that-helper (generators.cljc:320).
Couldn't satisfy such-that predicate after 100 tries.
foo.core> (gen/sample (s/gen #{nil}))
Error printing return value (ExceptionInfo) at
clojure.test.check.generators/such-that-helper (generators.cljc:320).
Couldn't satisfy such-that predicate after 100 tries.


Thanx

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

2018-03-03 Thread Rostislav Svoboda
@linux_users_not_using_the_bash_shell:
clj & clojure are bash scripts and are to be found in
https://github.com/clojure/brew-install.git


2018-03-03 15:27 GMT+01:00 Alex Miller :
> A new version of the Clojure tools (clj, clojure) is now available (see
> https://clojure.org/guides/getting_started).
>
> Just some bug fixes in this version:
>
> * FIX linux-install - use mkdir -p to ensure parent dirs are created
> * FIX brew install - move man page installation from formula to install.sh
> * FIX TDEPS-45 - don't swipe -h flag if main aliases are in effect
> * FIX TDEPS-47 - use classpath cache with -Sdeps
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from 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] Clojure 1.9.0 is now available!

2017-12-09 Thread Rostislav Svoboda
To give you a bit of an explanation - I'd like to use
clojure/clojurescript for scripting... I was reading the:
http://blog.brunobonacci.com/2017/08/10/lumo-vs-planck-vs-clojure-vs-pixie/
and got curious how does the 1.9.0 behave when talking about startup times.
(Oh BTW notice that lumo and planck compute wrong results, how lovely :)

> If it is all extra startup time, that could be due to loading spec and 
> def'ing extra Clojure 1.9 Vars during initialization.

It really looks like it is the startup time. Unfortunately:

> start with "java -cp  ..." to get an apples to apples comparison

makes not much of a difference. Anyway, thank you for the (correctly
computing :-) 1.9.0!


Bost


time java -jar 
/home/bost/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar
-e '(defn Σ [n] (reduce + (range (inc n (println (Σ (* 1000 1000
10)))'
#'user/Σ
500500
1.47user 0.07system 0:00.79elapsed 194%CPU (0avgtext+0avgdata
197744maxresident)k
0inputs+64outputs (0major+45783minor)pagefaults 0swaps

time java -cp 
/home/bost/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar:/home/bost/.m2/repository/org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar:/home/bost/.m2/repository/org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar
clojure.main -e '(defn Σ [n] (reduce + (range (inc n (println (Σ
(* 1000 1000 10)))'
#'user/Σ
500500
2.30user 0.04system 0:00.95elapsed 246%CPU (0avgtext+0avgdata
213724maxresident)k
0inputs+64outputs (0major+49720minor)pagefaults 0swaps



time java -jar 
/home/bost/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar
-e '(defn Σ [n] (reduce + (range (inc n (println (Σ (* 1000 1000
100)))'
#'user/Σ
50005000
2.10user 0.13system 0:01.49elapsed 150%CPU (0avgtext+0avgdata
730068maxresident)k
0inputs+64outputs (0major+178898minor)pagefaults 0swaps

time java -cp 
/home/bost/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar:/home/bost/.m2/repository/org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar:/home/bost/.m2/repository/org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar
clojure.main -e '(defn Σ [n] (reduce + (range (inc n (println (Σ
(* 1000 1000 100)))'
#'user/Σ
50005000
3.10user 0.25system 0:01.90elapsed 176%CPU (0avgtext+0avgdata
740780maxresident)k
0inputs+64outputs (0major+182178minor)pagefaults 0swaps



time java -jar 
/home/bost/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar
-e '(defn Σ [n] (reduce + (range (inc n (println (Σ (* 1000 1000
1000)))'
#'user/Σ
55
9.31user 0.24system 0:08.64elapsed 110%CPU (0avgtext+0avgdata
743596maxresident)k
0inputs+64outputs (0major+183306minor)pagefaults 0swaps

time java -cp 
/home/bost/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar:/home/bost/.m2/repository/org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar:/home/bost/.m2/repository/org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar
clojure.main -e '(defn Σ [n] (reduce + (range (inc n (println (Σ
(* 1000 1000 1000)))'
#'user/Σ
55
9.72user 0.25system 0:08.51elapsed 117%CPU (0avgtext+0avgdata
749604maxresident)k
0inputs+64outputs (0major+185270minor)pagefaults 0swaps



2017-12-09 6:23 GMT+01:00 Alex Miller :
>
> On Friday, December 8, 2017 at 7:54:23 PM UTC-6, Bost wrote:
>>
>> Hi, first of all: thanks for the 1.9.0!
>> And now issue: it looks like the 1.9.0 is slower than 1.8.0. Is there
>> any --turbo switch to flip?
>
>
> I think to be a better comparison, I would do clj -Spath to grab your
> classpath and in both cases start with "java -cp  ..." to get an
> apples to apples comparison. The clj script is fast compared to Clojure
> startup but it is checking and comparing files time for multiple files to
> determine whether it can use the cached classpath.
>
> Second I don't think you're doing enough work or enough timings here to
> necessarily get past the JVM hotspot compilation overhead and see times that
> are worth comparing. If you want to benchmark the time for the reduce, I
> would add criterium and exclude the startup time. My expectation would be
> that the times are pretty similar as little has changed that should affect
> what you're doing here.
>
> Startup time through clojure.main (which you're doing in both cases) does
> currently have a side effect of loading spec and the core specs which adds
> about 0.1-0.2 s. Startup time on AOT'ed code NOT going through clojure.main
> can usually avoid these.
>
>
>>
>>
>> Bost
>>
>>
>> time java -jar
>> /home/bost/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar
>> -e '(defn Σ [n] (reduce + (range (inc n (println (Σ (* 1000
>> 1000)))'
>> #'user/Σ
>> 5050
>> 1.31user 0.04system 0:00.65elapsed 205%CPU (0avgtext+0avgdata
>> 101872maxresident)k
>> 0inputs+64outputs (0major+21822minor)pagefaults 0swaps
>>
>> time clj -e '(defn Σ [n] (reduce + (range (inc n (println (Σ (*
>> 1000 1000)))'
>> #'user/Σ
>> 5050

Re: [ANN] Clojure 1.9.0 is now available!

2017-12-08 Thread Rostislav Svoboda
Hi, first of all: thanks for the 1.9.0!
And now issue: it looks like the 1.9.0 is slower than 1.8.0. Is there
any --turbo switch to flip?

Bost


time java -jar 
/home/bost/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar
-e '(defn Σ [n] (reduce + (range (inc n (println (Σ (* 1000
1000)))'
#'user/Σ
5050
1.31user 0.04system 0:00.65elapsed 205%CPU (0avgtext+0avgdata
101872maxresident)k
0inputs+64outputs (0major+21822minor)pagefaults 0swaps

time clj -e '(defn Σ [n] (reduce + (range (inc n (println (Σ (*
1000 1000)))'
#'user/Σ
5050
2.03user 0.05system 0:00.92elapsed 226%CPU (0avgtext+0avgdata
108284maxresident)k
0inputs+64outputs (0major+25522minor)pagefaults 0swaps



time java -jar 
/home/bost/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar
-e '(defn Σ [n] (reduce + (range (inc n (println (Σ (* 1000 1000
10)))'
#'user/Σ
500500
1.72user 0.08system 0:00.88elapsed 204%CPU (0avgtext+0avgdata
199204maxresident)k
0inputs+64outputs (0major+46108minor)pagefaults 0swaps

time clj -e '(defn Σ [n] (reduce + (range (inc n (println (Σ (*
1000 1000 10)))'
#'user/Σ
500500
2.63user 0.09system 0:01.27elapsed 214%CPU (0avgtext+0avgdata
210056maxresident)k
0inputs+64outputs (0major+50405minor)pagefaults 0swaps



time java -jar 
/home/bost/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar
-e '(defn Σ [n] (reduce + (range (inc n (println (Σ (* 1000 1000
100)))'
#'user/Σ
50005000
2.17user 0.23system 0:01.59elapsed 151%CPU (0avgtext+0avgdata
729756maxresident)k
0inputs+64outputs (0major+178749minor)pagefaults 0swaps

time clj -e '(defn Σ [n] (reduce + (range (inc n (println (Σ (*
1000 1000 100)))'
#'user/Σ
50005000
2.95user 0.28system 0:01.87elapsed 172%CPU (0avgtext+0avgdata
739368maxresident)k
0inputs+64outputs (0major+182736minor)pagefaults 0swaps



time java -jar 
/home/bost/.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar
-e '(defn Σ [n] (reduce + (range (inc n (println (Σ (* 1000 1000
1000)))'
#'user/Σ
55
9.34user 0.27system 0:08.75elapsed 109%CPU (0avgtext+0avgdata
744520maxresident)k
0inputs+64outputs (0major+183953minor)pagefaults 0swaps

time clj -e '(defn Σ [n] (reduce + (range (inc n (println (Σ (*
1000 1000 1000)))'
#'user/Σ
55
10.52user 0.25system 0:09.29elapsed 115%CPU (0avgtext+0avgdata
752244maxresident)k
0inputs+104outputs (0major+189351minor)pagefaults 0swaps


2017-12-08 23:17 GMT+01:00 Jose Figueroa Martinez :
> Excelent news! Thank you all for your effort.
>
> It feels like christmas but earlier :-D
>
> "We wish you a merry christmas and a happy new Clojure!"
>
> José FM
>
>
> El viernes, 8 de diciembre de 2017, 13:35:39 (UTC-6), Alex Miller escribió:
>>
>> Clojure 1.9 is now available!
>>
>>
>> Clojure 1.9 introduces two major new features: integration with spec and
>> command line tools.
>>
>>
>> spec (rationale, guide) is a library for describing the structure of data
>> and functions with support for:
>>
>> Validation
>> Error reporting
>> Destructuring
>> Instrumentation
>> Test-data generation
>> Generative test generation
>> Documentation
>>
>> Clojure integrates spec via two new libraries (still in alpha):
>>
>> spec.alpha - spec implementation
>> core.specs.alpha - specifications for Clojure itself
>>
>> This modularization facilitates refinement of spec separate from the
>> Clojure release cycle.
>>
>> The command line tools (guide, reference) provide:
>>
>> Quick and easy install
>> Clojure REPL and runner
>> Use of Maven and local dependencies
>> A functional API for classpath management (tools.deps.alpha)
>>
>> The installer is available for Mac developers in brew, for Linux users in
>> a script, and for more platforms in the future.
>>
>> For more information, see the complete list of all changes in Clojure 1.9
>> for more details.
>>
>>
>> Contributors
>>
>>
>> Thanks to all of the community members who contributed to Clojure 1.9
>> (first time contributors in bold):
>>
>> Adam Clements
>> Andy Fingerhut
>> Brandon Bloom
>> Cameron Desautels
>> Chad Taylor
>> Chris Houser
>> David Bürgin
>> Eli Lindsey
>> Gerrit Jansen Van Vuuren
>> Ghadi Shayban
>> Greg Leppert
>> Jason Whitlark
>> Johan Mena
>> Jozef Wagner
>> Lee Yen-Chin
>> Matthew Boston
>> Michael Blume
>> Michał Marczyk
>> Nicola Mometto
>> Ruslan Al-Fakikh
>> Steffen Dienst
>> Steve Miner
>> Yegor Timoshenko
>> Zhuang XiaoDan
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe 

Re: mysql and clojure

2017-10-19 Thread Rostislav Svoboda
Have a look at dbcon.clj and db.clj in my https://github.com/Bost/ufo
It's a rather minimal example of clojure/clojurescript + mysql


2017-10-19 15:10 GMT+02:00 Damien Mattei :
> Thank Lubomir,
> it works, i'm new to Clojure and did not use the name space the right way, i
> had to remove [mysql/mysql-connector-java "5.1.38"] also , do not know
> why...
>
> here is the working code and result:
>
> (ns jclojure.core
> (:gen-class)
> (:require [clojure.java.jdbc :as jdbc] )
> )
>
> ;(ns jclojure.core
> ;(:gen-class)
> ;(:require [clojure.java.jdbc :as jdbc]
> ;  [mysql/mysql-connector-java "5.1.38"]))
>
>
> (defn -main
>   "I don't do a whole lot ... yet."
>   [& args]
>
>   ;(:require [clojure.java [jdbc :as sql]])
>
>   ;(require '[clojure.java.jdbc :as jdbc])
>
>   ;(ns dbns
>;   (:require [clojure.java.jdbc :as jdbc]
>   ;[mysql/mysql-connector-java "5.1.38"]))
>
>   ;(use 'clojure.java.jdbc)
>
>   (println "Hello, World!")
>
>   (let [
> db-host "localhost"
> db-port 3306
> db-name "sidonie"
> ]
>
> (def db {
>  :classname "com.mysql.jdbc.Driver" ; must be in classpath
>  :subprotocol "mysql"
>  :subname (str "//" db-host ":" db-port "/" db-name)
> ; Any additional keys are passed to the driver
> ; as driver-specific properties.
>  :user "mattei"
>  :password "sidonie2"}))
>
> ;(jdbc/query db ["SELECT * FROM Sigles"])
>
>   (jdbc/query db
>   ["select * from Sigles"]
>   {:row-fn println}  )
>
>   ;(jdbc/with-connection db
> ;(jdbc/with-query-results rows
> ; ["select * from Sigles"]
> ; (println rows)))
>
>
>   )
>
> [mattei@moita jclojure]$ lein run
> Hello, World!
> {:sigle ApJ, :intitulé AstroPhysical Journal}
> {:sigle ApJS, :intitulé AstroPhysical Journal - supplement}
> {:sigle A, :intitulé Astronomy and Astrophysics}
> {:sigle A, :intitulé Astronomy and Astrophysics - supplement series}
> {:sigle A.A.W., :intitulé Acta Astronomica Warszawa}
> {:sigle ABO, :intitulé Annals Bosscha Observatory}
> {:sigle ABS, :intitulé Annals Bosscha Sterrenwacht}
> {:sigle ADONU, :intitulé Annals Dearborn Observatory - Northwestern
> University}
> {:sigle AJ, :intitulé Astronomical Journal}
> {:sigle AJS, :intitulé Astronomical Journal - supplement}
> {:sigle AN, :intitulé Astronomische Nachrichten}
> {:sigle AORB, :intitulé Annales de l'Observatoire Royal de Belgique}
> {:sigle AOS, :intitulé Annales de l'Observatoire
>
> ...
>
>
> Damien
>
>
>
> On Thursday, October 19, 2017 at 12:49:31 PM UTC+2, Lubomir Konstantinov
> wrote:
>>
>> Bad case of copy pasta?
>>
>> You have am extra namespace definition:
>>
>>   (ns dbns
>>   (:require [clojure.java.jdbc :as jdbc]
>>   [mysql/mysql-connector-java "5.1.38"]))
>>
>> You need to remove it, and move the require clause up in your ns:
>>
>> (ns jclojure.core
>> (:gen-class)
>> (:require [clojure.java.jdbc :as jdbc]
>>   [mysql/mysql-connector-java "5.1.38"]))
>>
>> On Thursday, 19 October 2017 13:37:08 UTC+3, Damien Mattei wrote:
>>>
>>> hello again,
>>>
>>> i tried dozen of web example about mysql and clojure but it doen't work,
>>> here is some of my code:
>>>
>>> for dependencies:
>>>
>>> (defproject jclojure "0.1.0-SNAPSHOT"
>>>   :description "clojure JVM source code for Sidonie web interface
>>> administration"
>>>   :url "https://sidonie.oca.eu;
>>>   :license {:name "Eclipse Public License"
>>>   :url "http://www.eclipse.org/legal/epl-v10.html"}
>>>
>>>   :dependencies [
>>>   [org.clojure/clojure "1.8.0"]
>>>   [mysql/mysql-connector-java "5.1.38"]
>>>   [org.clojure/java.jdbc "0.7.3"]
>>>   ]
>>>
>>>   :main ^:skip-aot jclojure.core
>>>   :target-path "target/%s"
>>>   :profiles {:uberjar {:aot :all}})
>>>
>>>
>>> the code (some of...):
>>>
>>> (ns jclojure.core
>>> (:gen-class))
>>>
>>> (defn -main
>>>   "I don't do a whole lot ... yet."
>>>   [& args]
>>>
>>>   ;(:require [clojure.java [jdbc :as sql]])
>>>
>>>   ;(require '[clojure.java.jdbc :as jdbc])
>>>
>>>   (ns dbns
>>>   (:require [clojure.java.jdbc :as jdbc]
>>>   [mysql/mysql-connector-java "5.1.38"]))
>>>
>>>   ;(use 'clojure.java.jdbc)
>>>
>>>   (println "Hello, World!")
>>>
>>>   (let [
>>> db-host "localhost"
>>> db-port 3306
>>> db-name "sidonie"
>>> ]
>>>
>>> (def db {
>>>  :classname "com.mysql.jdbc.Driver" ; must be in classpath
>>>  :subprotocol "mysql"
>>>  :subname (str "//" db-host ":" db-port "/" db-name)
>>> ; Any additional keys are passed to the driver
>>> ; as driver-specific properties.
>>>  :user "mattei"
>>>  :password "sidonie2"}))
>>>
>>> ;(jdbc/query db ["SELECT * FROM Sigles"])
>>>
>>>   (jdbc/with-connection db
>>> (jdbc/with-query-results rows
>>>  ["select * from 

Re: [ANN] Automatically generate your specs and types

2017-10-13 Thread Rostislav Svoboda
A hint to a casual reader just trying stuff out:

$ lein new hello
$ cd hello
# added {:user {:plugins [[lein-typed "0.4.2"]]}} to ~/.lein/profiles.clj
# added [org.clojure/core.typed "0.4.2"] to project.clj
$ lein typed infer-type hello.core
CompilerException java.lang.RuntimeException: No such namespace: t,
compiling:(hello/core.clj:5:1)
clojure.lang.Compiler.analyze (Compiler.java:6688)
clojure.lang.Compiler.analyze (Compiler.java:6625)
clojure.lang.Compiler$InvokeExpr.parse (Compiler.java:3766)
clojure.lang.Compiler.analyzeSeq (Compiler.java:6870)
clojure.lang.Compiler.analyze (Compiler.java:6669)
clojure.lang.Compiler.analyze (Compiler.java:6625)
clojure.lang.Compiler$BodyExpr$Parser.parse (Compiler.java:6001)
clojure.lang.Compiler$FnMethod.parse (Compiler.java:5380)
clojure.lang.Compiler$FnExpr.parse (Compiler.java:3972)
clojure.lang.Compiler.analyzeSeq (Compiler.java:6866)
clojure.lang.Compiler.analyze (Compiler.java:6669)
clojure.lang.Compiler.eval (Compiler.java:6924)
Caused by:
RuntimeException No such namespace: t
clojure.lang.Util.runtimeException (Util.java:221)
clojure.lang.Compiler.resolveIn (Compiler.java:7134)
clojure.lang.Compiler.resolve (Compiler.java:7108)
clojure.lang.Compiler.analyzeSymbol (Compiler.java:7069)
clojure.lang.Compiler.analyze (Compiler.java:6648)
clojure.lang.Compiler.analyze (Compiler.java:6625)

You need to:
1. Remove the [org.clojure/clojure "1.8.0"] from project.clj
2. Undo the changes in src/hello/core.clj

And then it will work:

$ lein typed infer-type hello.core
Initializing core.typed ...
Building core.typed base environments ...
Finished building base environments
"Elapsed time: 2829.892198 msecs"
core.typed initialized.
Refreshing runtime inference
Instrumenting def init hello.core/foo in hello.core

Testing hello.core-test

FAIL in (a-test) (core_test.clj:7)
FIXME, I fail.
expected: (= 0 1)
  actual: (not (= 0 1))

Ran 1 tests containing 1 assertions.
1 failures, 0 errors.
Inferring types for hello.core ...
Aliasing clojure.core.typed as t in hello.core
generate-tenv: 1 infer-results
finished squash-horizonally
Start follow-all
end follow-all
start remove unreachable aliases
end remove unreachable aliases
done populating
Output annotations to  #object[java.net.URL 0x738a39cc
file:/tmp/hello/src/hello/core.clj]
Finished inference, output written to hello.core



2017-10-13 23:46 GMT+02:00 Ambrose Bonnaire-Sergeant :
> This is pretty much the extent of my macro heuristics: binding forms are
> often the first argument, and it's usually a vector. Also, [& body]
> arguments
> are common.
>
>
> On Friday, October 13, 2017 at 5:44:07 PM UTC-4, Ambrose Bonnaire-Sergeant
> wrote:
>>
>> Potentially. Actually, it currently instruments and gathers data about
>> macros, but doesn't
>> output them because I haven't thought of very good heuristics to guess
>> specs for common
>> macros (in particular heterogeneous/repeating lists and vectors are
>> troublesome, I haven't
>> tried outputting any spec regex ops).
>>
>> Thanks,
>> Ambrose
>>
>> On Friday, October 13, 2017 at 3:54:22 PM UTC-4, Colin Fleming wrote:
>>>
>>> This looks great! Can this be used to infer macro specs based on examples
>>> of usage?
>>>
>>> On 14 October 2017 at 04:30, Ambrose Bonnaire-Sergeant
>>>  wrote:

 Hi,

 Happy to announce a new set of tools to automatically
 generate types and specs for your projects.

 Dependency information:
 1. core.typed
 [org.clojure/core.typed "0.4.2"]
 2. lein-typed
 [lein-typed "0.4.2"]
 3. boot-typedclojure
   [org.typedclojure/boot-typedclojure "0.1.0"]

 Tutorial:
 Here's how to try it out (for Lein projects using clojure.test):

 1. Add {:user {:plugins [[lein-typed "0.4.2"]]}} to your
 ~/.lein/profiles.clj
 2. Add a runtime dependency to [org.clojure/core.typed "0.4.2"] in your
 chosen Lein project.clj
 3. To infer specs: Run lein typed infer-spec 
 4. To infer types: Run lein typed infer-type 

 WARNING: This tool rewrites your files. Only try with backed up code.

 Some examples:
 clj-time:
 - Spec setup + spec results
 - Types setup + types results

 cheshire
 - Spec setup + spec results
 - Types setup + types results

 (Note: use the latest core.typed versions to reproduce on your machines)

 Hints:
 This tool instruments your namespace and runs your test suite. This
 can be expensive. Try these options:

Choose lein test selectors (here: [:integration :generative]
 selectors)
   lein typed infer-spec  :test-selectors "[:integration
 :generative]"

Timeout individual tests (1000ms timeout)
   lein typed infer-spec  :test-timeout-ms 1000

 If annotation generation hangs, try these options:

Disable recursive type inference
   lein typed infer-spec  :infer-opts "{:no-squash-vertically

Re: Clojurecademy: Learning Clojure Made Easy

2017-10-03 Thread Rostislav Svoboda
> Which part(s) is preventing you from contributing?

Please the remove that sign-up wall, Terms-of-service nonse and alike.

You know what we mean, don't you?

If you think your users (= us) need some kind notifications,
suspend-resume (i.e. save-load) functionality etc. then make it
optional please.
And if your real goal is earning money, then consider using some kind
of in-app-purchase mechanism.
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: Clojurecademy: Learning Clojure Made Easy

2017-10-02 Thread Rostislav Svoboda
It looks like I can't learn clojure using your site unless I sign up
with my email and such.
Hmm... Until now I went pretty far with learning clojure without
signing up anywhere.
So what are your reasons for demanding a sign up?
Thanks.


2017-10-02 18:47 GMT+02:00 Ertuğrul Çetin :
> Hi everyone,
>
> I've created site called Clojurecademy which seems like Codecademy for
> Clojure with powerful DSL to create courses. Feel free to provide feedback
> so we can improve Clojure adoption together!
>
> Link: https://clojurecademy.com
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/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] Clojure 1.9.0-alpha19

2017-09-02 Thread Rostislav Svoboda
Next time I'll send you the Contributor Agreement and a pull request
just to get to the list of contributors :)

2017-09-02 5:45 GMT+02:00 Alex Miller :
> Due to the new dependence on external jars, these instructions will be 
> different in Clojure 1.9. We will be providing additional tooling to make 
> this easier but that's still a work in progress.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from 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: SRSLY? (= (true? identity) (false? identity)) => true

2017-09-02 Thread Rostislav Svoboda
Aaaah! :)
My math books say booleans can't be true and false in the same time.
I made a mistake assuming that the identity function just because it
exists somewhere as an object in the memory is of a boolean type and
as such it's boolean value is true. Well, everybody here - thank you!

Just for the record: The type of:
- function 'identity' is "function with type signature: Any -> Any"
- functions: 'true?, false?, not'  is "function with type signature:
Any -> Boolean"

So following evaluations are perfectly valid:
(true? identity) -> false
(false? identity) -> false
(not identity) -> false

These functions should not be expected produce the boolean opposite of
each other's result, even if it's a bit strange at the first glance.

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

2017-09-01 Thread Rostislav Svoboda
> identity isn't a boolean, so neither true? nor false? should return true for 
> it

But then why it should return 'false'?

2017-09-02 6:04 GMT+02:00 Justin Smith <noisesm...@gmail.com>:
> identity isn't a boolean, so neither true? nor false? should return true for
> it
>
>
> On Fri, Sep 1, 2017 at 9:01 PM Rostislav Svoboda
> <rostislav.svob...@gmail.com> wrote:
>>
>> > (true? identity) -> false
>> > (false? identity) -> false
>> > (= false false) -> true
>>
>> Well:
>> (= identity identity) -> true
>>
>> My math books say booleans can't be true and false in the same time.
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from 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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from 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: SRSLY? (= (true? identity) (false? identity)) => true

2017-09-01 Thread Rostislav Svoboda
> You seem to be confused about what true? and false? are intended to do.

No no, it's not me who's confused about booleans. It's the computer :)

2017-09-02 5:59 GMT+02:00 Justin Smith <noisesm...@gmail.com>:
> You seem to be confused about what true? and false? are intended to do.
>
> +user=> (doc true?)
> -
> clojure.core/true?
> ([x])
>   Returns true if x is the value true, false otherwise.
> nil
> +user=> (doc false?)
> -
> clojure.core/false?
> ([x])
>   Returns true if x is the value false, false otherwise.
> nil
>
>
> On Fri, Sep 1, 2017 at 8:57 PM Rostislav Svoboda
> <rostislav.svob...@gmail.com> wrote:
>>
>> > This is what I would expect - the identity function is neither the value
>> > true, or the value false
>>
>> Hmm. No matter what's the value of the identity, the functions
>> 'true?', 'false?', 'not' should then return an exception (or something
>> else) instead of a boolean.
>>
>> 2017-09-02 5:49 GMT+02:00 Mark Engelberg <mark.engelb...@gmail.com>:
>> > (true? identity) -> false
>> > (false? identity) -> false
>> > (= false false) -> true
>> >
>> > On Fri, Sep 1, 2017 at 8:43 PM, Rostislav Svoboda
>> > <rostislav.svob...@gmail.com> wrote:
>> >>
>> >> Hi, can anybody explain it please?
>> >>
>> >> $ java -cp clojure-1.8.0.jar clojure.main
>> >> Clojure 1.8.0
>> >> user=> (= (true? identity) (false? identity))
>> >> true
>> >>
>> >> And in 1.9.0-alpha19 it behaves the same.
>> >>
>> >> thx Bost
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> >> Groups "Clojure" group.
>> >> To post to this group, send email to clojure@googlegroups.com
>> >> Note that posts from new members are moderated - please be patient with
>> >> your first post.
>> >> To unsubscribe from this group, send email to
>> >> clojure+unsubscr...@googlegroups.com
>> >> For more options, visit this group at
>> >> http://groups.google.com/group/clojure?hl=en
>> >> ---
>> >> You received this message because you are subscribed to the Google
>> >> Groups
>> >> "Clojure" group.
>> >> To unsubscribe from 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 post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from 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 b

Re: SRSLY? (= (true? identity) (false? identity)) => true

2017-09-01 Thread Rostislav Svoboda
> (true? identity) -> false
> (false? identity) -> false
> (= false false) -> true

Well:
(= identity identity) -> true

My math books say booleans can't be true and false in the same time.

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

2017-09-01 Thread Rostislav Svoboda
> This is what I would expect - the identity function is neither the value 
> true, or the value false

Hmm. No matter what's the value of the identity, the functions
'true?', 'false?', 'not' should then return an exception (or something
else) instead of a boolean.

2017-09-02 5:49 GMT+02:00 Mark Engelberg <mark.engelb...@gmail.com>:
> (true? identity) -> false
> (false? identity) -> false
> (= false false) -> true
>
> On Fri, Sep 1, 2017 at 8:43 PM, Rostislav Svoboda
> <rostislav.svob...@gmail.com> wrote:
>>
>> Hi, can anybody explain it please?
>>
>> $ java -cp clojure-1.8.0.jar clojure.main
>> Clojure 1.8.0
>> user=> (= (true? identity) (false? identity))
>> true
>>
>> And in 1.9.0-alpha19 it behaves the same.
>>
>> thx Bost
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from 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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from 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.


SRSLY? (= (true? identity) (false? identity)) => true

2017-09-01 Thread Rostislav Svoboda
Hi, can anybody explain it please?

$ java -cp clojure-1.8.0.jar clojure.main
Clojure 1.8.0
user=> (= (true? identity) (false? identity))
true

And in 1.9.0-alpha19 it behaves the same.

thx Bost

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

2017-03-24 Thread Rostislav Svoboda
> Wow, looks like pretty brazen theft of the Clojure logo.

Or alternativelly: the idea of "ownership" might be simply overrated.
Especially so when it comes to intelectual property.
The real reason why things get stolen or - when talking about
programms - hacks is not
because there are ugly people out there, but because they can be
stolen or hacked.

Give up the idea of ownership, i.e. make your ideas open source and
they won't be stolen.
Prove your programms to be mathematically correct and they won't be hacked.


2017-03-24 18:53 GMT+01:00 David Della Costa :
> Wow, looks like pretty brazen theft of the Clojure logo.
>
> This company appears to be based in Singapore, but targeting Japanese folks
> interested in Chinese-language learning.
>
> http://www.chinese-semi.com/about.php
>
>
>
>
>
> 2017-03-24 10:40 GMT-04:00 Nobuyuki Inaba :
>>
>> Hi,
>>
>> I had just found a site  ( http://www.chinese-semi.com/optin/ ) today.
>> This site is Chinese free mail magazine site.
>> The site seems to use Clojure logo. Does Clojure have relations with the
>> site?
>>
>> Please let me know if anyone knows about it.
>>
>> Best regards,
>> Nobuyuki Inaba
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from 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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from 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: Getting information from a hashmap that is inside anothe hashmap

2016-11-22 Thread Rostislav Svoboda
(->> human2 :char :eye-colour) or
(-> human2 :char :eye-colour) or
((human2 :char) :eye-colour) or
(:eye-colour (:char human2)) all variants work.

Either way it looks like you're asking a very basic question.
I recomend you to go over http://clojurekoans.com/ or read some
tutorial, quick start guide etc.


2016-11-22 11:42 GMT+01:00 'Rickesh Bedia' via Clojure
:
> Lets say I have:
> (def human {:firstname "John" :surname "Smith"})
> To get the firstname I would run (human :firstname) and this would give
> "John"
>
> However if I now have
> (def human2 {:name "Bob" :char {:eye-colour "brown" :hair-colour
> "red"}})
> how would I get the eye-colour? Would it be (human2 :char :eye-colour). I
> just want the eye-colour
>
> Thanks in advance
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/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: complex made simple?

2016-10-18 Thread Rostislav Svoboda
1. Use Yoneda Lemma. Its intuitive explanation is:
You work at a particle accelerator. You want to understand some particle. All
you can do are throw other particles at it and see what happens. If you
understand how your mystery particle responds to all possible test particles at
all possible test energies, then you know everything there is to know about your
mystery particle.

2. Use Howard Curry isomorphism. It states something like:
A program is a proof that from a given business problem a certain solution
(proposed by a business domain expert) can really be derived. I.e. it's not the
programmer solving problems. All the solutions exist per se already. The
programmer just connects a problem with a particular solution by writing some
code.

So:
- For every method using global variables create its functional version with
  object types, e.g.:
old: int foo(int x) { return x + this.y;}
new: Integer fooFunctional(Integer x, Integer y) { return x + y;}

- For every function create its fully typed version:
old: Integer fooFunctional(Integer x, Integer y) { return x + y;}
new: FooType fooFunctionalTyped(XType x, YType y) { return x + y;}

where XType and YType may be e.g. only odd or even Integers and FooType is
an union of XType and YType.

- simplify your type system

- profit! :)

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

2016-04-06 Thread Rostislav Svoboda
I think I have. But I didn't do any particular measurements around it.
I have a habit of living on a rather bleeding edge.
So it might be a bunch cumulative performance improvements starting in
linux-kernel going all the way through
java 1.8, clojure 1.8, emacs-25, cider and I dunno what else resulting
in "Huh we're bit faster than before. Nice. Thx."

2016-04-06 22:21 GMT+02:00 Piyush Katariya :
>
> Has anybody experienced the performance boost by switching to Clojure
> version 1.8 (and direct linking) ?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from 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: internet access required?

2016-02-20 Thread Rostislav Svoboda
have you tried
lein deps :tree
?

2016-02-20 20:27 GMT+01:00 andrea crotti :
> This might be a Cider issue more than Clojure but I'm not sure.
>
> Sometimes on train/plane I try to work on some Clojure project and I
> normally don't manage to start the REPL inside Emacs.
>
> The issue calling (cider-jack-in) is the following:
>
> Starting nREPL server via lein update-in :dependencies conj
> \[org.clojure/tools.nrepl\ \"0.2.12\"\] -- update-in :plugins conj
> \[refactor-nrepl\ \"2.2.0-SNAPSHOT\"\] -- update-in :plugins conj
> \[cider/cider-nrepl\ \"0.11.0-SNAPSHOT\"\] -- repl :headless...
>
> error in process sentinel: nrepl-server-sentinel: Could not start
> nREPL server: Could not transfer artifact
> refactor-nrepl:refactor-nrepl:pom:2.2.0-SNAPSHOT from/to clojars
> (https://clojars.org/repo/): clojars.org
>
> but the weird thing I don't have that plugin declared as SNAPSHOT
> version anywhere, and in fact doing a "lein repl" from the terminal
> works fine instead.
>
> I tried to look in the Cider code and can't find anything there
> either, so any idea where that comes from?
> And a more general question there unless I use -SNAPSHOT versions,
> there should be no case when lein needs to reconnect to clojars if all
> the dependencies were already downloaded right?
>
> Thanks
>
> PS. this is my .lein/profiles_clj btw:
>
> {:user
>  {:dependencies
>   [[pjstadig/humane-test-output "0.6.0"]
>[org.clojure/tools.nrepl "0.2.12"]
>[acyclic/squiggly-clojure "0.1.4"]
>[spyscope "0.1.5"]
>[org.clojure/tools.namespace "0.2.4"]
>[io.aviso/pretty "0.1.8"]
>[im.chit/vinyasa "0.1.2"]
>[org.clojure/tools.trace "0.7.8"]]
>
>   :plugins
>   [[cider/cider-nrepl "0.10.2"]
>[lein-annotations "0.1.0"]
>[com.jakemccrary/lein-test-refresh "0.7.0"]
>[lein-checkall "0.1.1"]
>[lein-droid "0.3.5"]
>[lein-githooks "0.1.0"]
>[lein-shell "0.4.0"]
>[lein-ancient "0.6.7" :exclusions [org.clojure/core.cache]]
>[lein-try "0.4.3"]
>[lein-midje "3.1.3"]
>[nodisassemble "0.1.3"]
>[lein-cloverage "1.0.3"]
>[refactor-nrepl "2.0.0"]
>]}
>  }
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from 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: CIDER 0.10 is out!

2015-12-04 Thread Rostislav Svoboda
Yea :)

2015-12-04 1:49 GMT+01:00 Mimmo Cosenza :
> thanks. You rock
> mimmo
>
>> On 04 Dec 2015, at 01:10, Edward Knyshov  wrote:
>>
>> Congratulations! You made a great work.
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with your 
>> first post.
>> To unsubscribe from this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from 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 post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from 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] Dominator - Virtual DOM in ClojureScript

2015-05-12 Thread Rostislav Svoboda
 Dominator brings the simplicity and performance of the Virtual-DOM
project to ClojureScript.

Is this the same kind of Virtual DOM as in facebook react? I.e. is
Dominator a react replacement (written in cljs, of course)?

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


Re: [ANN] Chestnut 0.7.0

2015-03-07 Thread Rostislav Svoboda
 I tested the v 0.7.0 of chestnut and I encountered the following error.
 The v 0.6.0 works fine.

 $ lein new chestnut test-app
 Retrieving chestnut/lein-template/0.7.0/lein-template-0.7.0.pom from clojars
 Retrieving chestnut/lein-template/0.7.0/lein-template-0.7.0.jar from clojars
 Exception in thread main java.lang.ExceptionInInitializerError

mine works fine:

$ lein new chestnut test-app
Retrieving chestnut/lein-template/0.7.0/lein-template-0.7.0.pom from clojars
Retrieving chestnut/lein-template/0.7.0/lein-template-0.7.0.jar from clojars
Generating fresh Chestnut project.
README.md contains instructions to get you started.
$

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

2015-03-03 Thread Rostislav Svoboda
Great work! Thank you

On 28 February 2015 at 17:14, Jean Niklas L'orange
jeann...@hypirion.com wrote:
 Hello fellow Clojurians,

 I am happy to announce that I have finished my blogpost series on the
 persistent
 vector. It consists of five parts:

 The basic algorithms
 Indexing
 The tail optimisation
 Transients
 Performance (which is a summary of this detailed blogpost)

 I hope this will help you to get a good understanding of how the algorithms
 on
 the data structure work, how the optimisations work, and how efficient it is
 on
 the JVM.

 Constructive criticism, both positive and negative, is appreciated.

 Enjoy!

 (NB: I haven't gotten around to fix the illustrations in part 3, so
 unfortunately it will be a bit hard to read if you print it out in
 grayscale.
 It's on my todo-list.)

 -- Jean Niklas L'orange

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

2015-03-03 Thread Rostislav Svoboda
Hi Jean

 The tail optimisation
 http://hypirion.com/musings/understanding-clojure-transients

It took me a second to find out how the graphs for the vector-trie and
tail correspond to each other.
Please consider slightly deeper explanation or add some visual clues.
Something like:
http://picpaste.com/pics/tails-colored.1425379672.png

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

2014-10-14 Thread Rostislav Svoboda
+1 Bitcoins
I can't use paypal.


On 10 October 2014 06:46, Eric Normand ericwnorm...@gmail.com wrote:
 Hello,

 To plug my own videos, the LispCast core.async videos are coming out soon! I
 have a strict deadline of before the conj. You can get on the mailing list
 to get a discount when they come out. You'll also get a core.async
 cheatsheet for signing up.

 http://purelyfunctional.tv/core-async

 They are definitely good for the beginner level. They only assume basic
 Clojure knowledge.

 Rock on!
 Eric

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

2014-09-21 Thread Rostislav Svoboda
Thank you Daniel.

IDidMount/did-mount works for me. BTW good om lifecycle explanation
can be found here:
http://josf.info/blog/2014/09/18/first-ompressions-a-conceptual-look-at-om/

On 18 September 2014 10:18, Daniel Kersten dkers...@gmail.com wrote:

 Forgot to add: IDidMount/did-mount only gets called after mounting.  If you 
 want to run code after later renders you can use IDidUpdate.

 On 18 Sep 2014 09:16, Daniel Kersten dkers...@gmail.com wrote:

 In Om, a good place to put things that need render to have been called is in 
 IDidMount. You can get the DOM node for your component with (om/get-node 
 owner) or (om/get-node owner ref) if you want a sprcific node with a :ref 
 attribute set.

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

2014-09-17 Thread Rostislav Svoboda
Concerning sortable tables, at the moment I do following (don't laugh):

cp https://github.com/google/closure-library/blob/master/closure/goog/ui/
tablesorter.js resources/public/js/out/goog/ui/

index.html:
html
...
body
div id=dbase0/div
script src=http://fb.me/react-0.11.1.js;/script
script src=js/out/goog/base.js type=text/javascript/script
script src=js/main.js type=text/javascript/script
script type=text/javascriptgoog.require(om_async
.client);/script
script type=text/javascriptgoog.require(goog.ui.TableSorter
);/script
...
/body
/html

client.cljs:
(defn table-sorter [elem-id]
  (let [el (gdom/getElement elem-id)]
(if (nil? el)
  (println (str ERROR: (gdom/getElement \ elem-id \) is nil))
  (let [component (TableSorter.)
alphaSort goog.ui.TableSorter.alphaSort
numericSort goog.ui.TableSorter.numericSort
reverseSort (goog.ui.TableSorter.createReverseSort numericSort)]
(.decorate component el)
(.setSortFunction component 1 alphaSort)
(.setSortFunction component 2 reverseSort)

...

;; pseudo code here:
(dom/table #js {:id table-id :onMouseOver (fn [] (table-sorter table-id))}
   (dom/thead nil
  (apply dom/tr nil
 (map #(dom/th nil %) table-header-values)))
   (apply dom/tbody nil
  (apply dom/tr nil
 (map #(dom/td nil %) table-rows-values)))



I.e. the table-sorter function makes my tables sortable but I have to
postpone it's execution until the dom/table get's rendered.
$(document).ready(..) and/or jayq.macros/ready don't work so I hack the
meat with :onMouseOver

I started to fight with sortable tables just a few hours ago so some more
googling and/or your help might lead to better result.
Thx in advance

Bost


On 17 September 2014 16:40, Daniel doubleagen...@gmail.com wrote:

 I could have said that in a slightly less vitriolic way.  Apologies.


 On Tuesday, September 16, 2014 8:45:37 AM UTC-5, Sam Ritchie wrote:

 I fully agree that with more features, the library would be useful to a
 larger range of folks :) Pull requests welcome, as always.

 I'm developing each component as needed as I convert paddleguru.com over
 to Om. The input components and basic tables, panels, buttons and navbars
 came first; the rest are on their way.

 My thought on open source is, document well and release early. There's no
 reason to keep all the existing stuff closed because the tables module
 isn't fully sexed out.

   Daniel doubleagen...@gmail.com
  September 16, 2014 at 7:17 AM
 Good work.  Although I hate to say it, It's of little use for most
 projects without more out-of-the-box table options eg searchable, sortable,
 paginated, never-ending.

 On Wednesday, August 27, 2014 2:05:27 PM UTC-5, Sam Ritchie wrote:
 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 ---
 You received this message because you are subscribed to the Google Groups
 Clojure group.
 To unsubscribe from 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.
   Sam Ritchie sritchi...@gmail.com
  August 27, 2014 at 1:05 PM
  This release adds a bunch of new active components - notably, dropdown
 buttons, split dropdown buttons and a navbar. The navbar allowed me to beef
 up the doc site with a proper navbar, more pages and client-side javascript
 navigation using Secretary and Html5 pushState:

 http://om-bootstrap.herokuapp.com

 Code:

 https://github.com/racehub/om-bootstrap

 Leiningen:

 [racehub/om-bootstrap 0.2.6]


 RELEASE NOTES:

 - Upgraded Clojurescript dependency on the doc site to get around this
 bug: http://dev.clojure.org/jira/browse/CLJS-839. Added a note.

 This hash code bug was causing `bs-class-set`'s internal lookup in
 `class-map` to sporadically fail in Safari 7.0.x.

 From https://github.com/racehub/om-bootstrap/pull/13:
 - `om-bootstrap.util/clone-with-props` can now clone proper om
 components by injecting extra attributes into the om cursor.
 - `:on-select` handlers on top level nav elements now get called if set,
 along with the current nav-item `:on-select` handlers

 ### New Components

 - `dropdown-mixin` (mixins.cljs)
 - `menu-item`, `dropdown-menu`, `dropdown` (button.cljs)
 - `split` (ie, SplitButton) (button.cljs)
 - `navbar` (ie, SplitButton) (button.cljs)



 --
 Sam Ritchie (@sritchie)
 Paddleguru Co-Founder
 703.863.8561
 www.paddleguru.com
 Twitter http://twitter.com/paddleguru // Facebook
 http://facebook.com/paddleguru

  --
 You received this message because you 

Re: ANN: Om 0.7.0

2014-08-01 Thread Rostislav Svoboda
Thanx a lot guys!

 The biggest change is depending on ClojureScript 0.0-2277 and

BTW the Using it section of README.md still says 0.0-2173:

(defproject foo 0.1.0
  ...
  :dependencies [[org.clojure/clojure 1.5.1]
 [org.clojure/clojurescript 0.0-2173]
 [om 0.7.0]]
  ...)

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

2013-12-13 Thread Rostislav Svoboda
 I can’t know what problems people encounter is they don’t tell me.

You may ask somebody to test your changes before you publish them.
Pardon me in case you did so. It seems like people were not listening.
Anyway you should be prepared for this eventuality too and have an
undo-scenario.

Bost

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


Re: [ANN] Clojure Cheatsheet for Emacs

2013-08-12 Thread Rostislav Svoboda
 The number of cheatsheets is growing (this is a good thing IMO)

It's not about having one brilliant cheatsheet. The ultimate goal is to get
rid off them all.

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


Re: [ANN] Clojure Cheatsheet for Emacs

2013-08-12 Thread Rostislav Svoboda
What would we like to have is a language easy to learn without any
need for a cheatsheet.

On 13 August 2013 02:10, Devin Walters dev...@gmail.com wrote:
 Could you clarify: Why is that a good goal?

 '(Devin Walters)

 On Aug 12, 2013, at 12:09 PM, Rostislav Svoboda
 rostislav.svob...@gmail.com wrote:

 The number of cheatsheets is growing (this is a good thing IMO)

 It's not about having one brilliant cheatsheet. The ultimate goal is to get
 rid off them all.

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

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



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




Re: I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger.

2013-05-28 Thread Rostislav Svoboda
This might not be the proper example: If (/ 2 n) throws Divide by
zero then n == zero

On 28 May 2013 15:40, Lee Spector lspec...@hampshire.edu wrote:

 On May 27, 2013, at 8:31 PM, Charles Harvey III wrote:
 If you haven't tried out Light Table, it shows you the values of local 
 variables. It is a pretty nice feature.


 I love the ideas behind LightTable and I check it out from time to time.

 Checking it out now, though, regarding this issue, I don't see access to 
 locals at the time of an exception. For example:

 (defn bad [n] (/ 2 n))

 (defn bad-caller [x] (bad (- x 3)))

 (bad-caller 3)

 I get an exception:

 java.lang.ArithmeticException: Divide by zero
   Numbers.java:156 clojure.lang.Numbers.divide
  Numbers.java:3667 clojure.lang.Numbers.divide
   NO_SOURCE_FILE:8 ltfoo.core/bad
  NO_SOURCE_FILE:12 ltfoo.core/bad-caller
  NO_SOURCE_FILE:16 ltfoo.core/eval4706

 but I don't see anywhere the value of n in bad at the time of the exception.

  -Lee

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



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




Re: unusual question: how do you get morale?(or moral support)

2013-05-12 Thread Rostislav Svoboda
Well everything in life - especially in engineering - has its ups and
downs. Teamwork is the key!
https://www.youtube.com/watch?v=Nebd9yoraac
:)

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




Re: What's the difference between a sequence and a seq?

2013-04-25 Thread Rostislav Svoboda
+100. Thx a lot!

On 25 April 2013 13:45, fb friedrich.boe...@gmail.com wrote:
 the conceptional differences between collection and sequences are confusing
 quite a bit.
 A nice wrap up by Tim McCormack can be found here:

 http://www.brainonfire.net/files/seqs-and-colls/main.html
 (via Sean Corfield)

 -fb

 Am Sonntag, 31. März 2013 14:58:15 UTC+2 schrieb Alice:

 On http://clojure.org/lazier,

   Changed: (rest aseq) - returns a logical collection (Sequence) of
 the remaining items, not (necessarily) a seq

 rest simply calls RT.more and here's the code of RT.more:

   static public ISeq more(Object x){
 if(x instanceof ISeq)
   return ((ISeq) x).more();
 ISeq seq = seq(x);
 if(seq == null)
   return PersistentList.EMPTY;
 return seq.more();
   }

 So, it seems to return just a seq and not some logical collection?

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



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




Re: [ANN] Linode compromise possibly affecting Clojars

2013-04-16 Thread Rostislav Svoboda
Whata an [ANN] !!!
Please change the subject to [linode-compromise 1.0.0]
:)

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




Basic multiplication incorrent?!?

2013-04-09 Thread Rostislav Svoboda
Can anyone explain me please why I get:

Clojure 1.5.1
user= (* 148.52 0.0256)
3.80211206

The correct result should be:
https://www.google.com/search?q=148.52+*+0.0256
3.802112

If you don't believe me try it on: http://tryclj.com/

thx

Bost

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

2013-04-09 Thread Rostislav Svoboda
I see. I did some testing. It's not clojure, it's not java, it's deeper.

People of planet Earth! Stop wasting time on SETI if your machines
can't properly calculate 148.52 * 0.0256 !!!

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




Re: core.logic: Database context monad

2013-04-05 Thread Rostislav Svoboda
I found this http://gradworks.umi.com/3380156.pdf on
http://www.cs.indiana.edu/~webyrd/

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




Re: ANN Introducing Clochure: a better Clojure

2013-04-01 Thread Rostislav Svoboda
This is a step back. The only way for the future is xml: bracket+ 1
2/bracket
Michael: I'm about to send you a patch. Just let me fill the contributor
agreement...

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

2012-11-05 Thread Rostislav Svoboda
Nice!
Could you please add some screenshots? You know a picture attracts
more attention than 100 words. (Thx in advance!)
BTW You don't need to hope - it is useful!

Bost


On 5 November 2012 16:29, Mimmo Cosenza mimmo.cose...@gmail.com wrote:
 Hi,
 I started a short series of tutorials on ClojureScript that I'm writing in
 my spare time.

 You can find them at

 https://github.com/magomimmo/modern-cljs

 hope could be useful...and to have enough time to go on with the next
 ones...

 Mimmo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: codeq

2012-10-10 Thread Rostislav Svoboda
Isn't it somehow related to the thread we had here few X ago: Idea
around SCMs and Clojure
https://groups.google.com/forum/?fromgroups=#!topic/clojure/9N15TA_mJKo

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: appengine-magic: Argument must not be null.

2012-09-11 Thread Rostislav Svoboda
Ok, it has nothing to do with clojure it's a GAE issue. Just in case
someone trips over it too, the app must be started using
  lein appengine-prepare
  lein appengine-dev-appserver foo-dev

from bash, instead of
  (use 'foo.core)
  (in-ns 'foo.core)
  (ae/serve foo-app)

from REPL. See the section Managing multiple environments  in
README.md. And yea as you might have guessed an access to REPL using
vimclojure with nailgun doesn't work anymore. Sweet, isn't it?

Bost

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


appengine-magic: Argument must not be null.

2012-09-10 Thread Rostislav Svoboda
Hi,
I'm trying to execute the multipart/form-data example from
https://github.com/gcv/appengine-magic.git but it seems like the
blob-key in the

  (GET /serve/:blob-key {{:strs [blob-key]} :params :as req}
   (blobs/serve req blob-key)))

is null. The error is:

Problem accessing /serve/15d3fa23ba7b4a20a4977b5941e28cb2. Reason:
Argument must not be null.
Caused by:
java.lang.IllegalArgumentException: Argument must not be null.
at com.google.appengine.api.blobstore.BlobKey.init(BlobKey.java:24)

If I change it to:
  (GET /serve/:blob-key {{:strs [blob-key]} :params :as req}
   (blobs/serve req (:blob-key (:params req)

then I get:

Problem accessing /serve/15d3fa23ba7b4a20a4977b5941e28cb2. Reason:
INTERNAL_SERVER_ERROR
Caused by:
java.lang.NullPointerException
at 
com.google.appengine.api.blobstore.dev.ServeBlobFilter.calculateContentRange(ServeBlobFilter.java:88)

does anyone know what am I doing wrong?

thx Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Rich's The Value of Values and REST

2012-08-24 Thread Rostislav Svoboda
 I just enjoy the speeches better by standing back a little bit.

Actually I'm quite annoyed that Rich doesn't say anything about how
important is to be able to forget facts, irreversibly filter things
out and reinvent the wheel again. Imagine a huge database full of
facts you're simply not interested in. What is it good for?

BTW there are stories about people not been able to forget. They
remember every useless trivia, quarrel or conflict they ever
experienced and they have to go over and over every good or bad memory
just to recall things like Did I meet you before or after 2005?.
Pretty much like our databases: select * from the
5TB-useless-stuff.txt what happened between BIG-BANG and NOW

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: The Value of Values

2012-08-24 Thread Rostislav Svoboda
See the thread The Value of Values started by Conrad Barski

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Idea around SCMs and Clojure

2012-07-19 Thread Rostislav Svoboda
 It would be more interesting to see a version control system based on
 storing an abstract syntax tree

hmm, interesting idea... such a SCM would need to have the code
compiled at every commit/checkout, right? How would that work for
large projects? And what about let's say rebase -i master topic
where master and topic differ by a large number or commits? And would
that work for reflection? And what about self modifying code (macros)?

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Idea around SCMs and Clojure

2012-07-17 Thread Rostislav Svoboda
 You want do diffs

I think you need to concentrate on a way how a diff is made and
defined if you want to improve the way how a VCS works. I.e. current
VCSs use something like this:

@ some line numbers @
- replacing that old line...
+ ... with this new line

which works well for a machine, but it's (almost always) meaningless
for a human mainly because a VCS knows nothing about the language your
file is written in.
This has some huge implications. Even with a good GUI editor, when you
compare files, you see just some blocks of text being
deleted/inserted/changed or shifted. So the meaning of the diff is
quite often pretty hard to understand.

IMO the next generation of VCSs must be content-aware working with
content-aware diffs

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Idea around SCMs and Clojure

2012-07-17 Thread Rostislav Svoboda
 I don't think so.  After some practice you can read patches as if they
 were finest prose. ;-)

Yea, for prose they work. I believe that. But I'm paid for writing code :)

 There are already special-purpose, format-dependent diff/patch tools,
 e.g., XMLdiff, various binary diff/patch tools, and some more.

I believe that too. But where are they? There are topics and themes
you cannot miss. Like clojure. And there are topics and themes no one
talks about - the special-purpose diff tools. I have a suspicion they
somehow do not meet the needs. Can you point us to any?

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 and the Anti-If Campaign

2012-05-24 Thread Rostislav Svoboda
After seeing [1] from Rich Hickey I wondered what he means with
replace if statements with polymorphic functions? Why and how
exactly should I do it? Your blogpost opened my eyes. Thanks a lot
Dominikus

Bost

[1] http://www.infoq.com/presentations/Simple-Made-Easy

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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} Clojure-control 0.3.4 released

2012-05-10 Thread Rostislav Svoboda
I took the steps from your README.md and it seems like something's
missing :( see below

Bost

bost@bost-desktop:~/dev$ rm -rf mycontrol/
bost@bost-desktop:~/dev$ lein1 version
Leiningen 1.7.1 on Java 1.7.0_04 Java HotSpot(TM) Client VM
bost@bost-desktop:~/dev$ lein1 plugin install control 0.3.5
[INFO] Unable to find resource 'control:control:jar:0.3.5' in
repository central (http://repo1.maven.org/maven2)
Installing shell wrapper to /home/bost/.lein/bin/clojure-control
Copying 2 files to /tmp/lein-f0119cb7-6660-4181-aeed-149113f38fc1/lib
Including control-0.3.5.jar
Including clojure-1.3.0.jar
Including tools.cli-0.2.1.jar
Created control-0.3.5.jar
bost@bost-desktop:~/dev$ lein1 new mycontrol
Created new project in: /home/bost/dev/mycontrol
Look over project.clj and start coding in mycontrol/core.clj
bost@bost-desktop:~/dev$ cd mycontrol/
bost@bost-desktop:~/dev/mycontrol$ lein1 control init
bost@bost-desktop:~/dev/mycontrol$ cat
classes/ control.clj  .gitignore   project.clj  README   src/
   test/
bost@bost-desktop:~/dev/mycontrol$ cat control.clj
(defcluster :default-cluster
  :clients [
{:host localhost :user root}
  ])

(deftask :date echo date on cluster  []
  (ssh date))
bost@bost-desktop:~/dev/mycontrol$ lein1 control run default-cluster date
Empty hosts for cluster default-cluster
Exception in thread main java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at jline.ConsoleRunner.main(ConsoleRunner.java:69)
Caused by: java.lang.RuntimeException: Empty hosts for cluster
default-cluster (NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval(Compiler.java:5440)
at clojure.lang.Compiler.eval(Compiler.java:5391)
at clojure.core$eval.invoke(core.clj:2382)
at clojure.main$eval_opt.invoke(main.clj:235)
at clojure.main$initialize.invoke(main.clj:254)
at clojure.main$script_opt.invoke(main.clj:270)
at clojure.main$main.doInvoke(main.clj:354)
at clojure.lang.RestFn.invoke(RestFn.java:551)
at clojure.lang.Var.invoke(Var.java:390)
at clojure.lang.AFn.applyToHelper(AFn.java:193)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.main.main(main.java:37)
... 5 more
Caused by: java.lang.RuntimeException: Empty hosts for cluster default-cluster
at control.core$do_begin.invoke(core.clj:353)
at leiningen.control$run_control.invoke(control.clj:30)
at leiningen.control$run.doInvoke(control.clj:97)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.control$control.doInvoke(control.clj:136)
at clojure.lang.RestFn.invoke(RestFn.java:464)
at clojure.lang.Var.invoke(Var.java:377)
at clojure.lang.AFn.applyToHelper(AFn.java:172)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.core$apply_task.invoke(core.clj:262)
at leiningen.core$_main.doInvoke(core.clj:329)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.core$_main.invoke(core.clj:332)
at user$eval42.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:5424)
... 16 more

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Getting started

2012-05-10 Thread Rostislav Svoboda
On 10 May 2012 19:57, Chris McBride cmm7...@gmail.com wrote:
 Also you generally don't invoke the clojure jar directly. Instead have lein
 do that for you.
 http://www.unexpected-vortices.com/clojure/brief-beginners-guide/development-env.html#clojure-projects

No, please stop. Zeno, you MUST get the java -cp clojure-1.4.0.jar
clojure.main working! It is the very core the life and the universe.
If this does not work your system is completely broken and nothing can
be relied upon.

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


code as data vs. code injection vulnerability

2012-05-09 Thread Rostislav Svoboda
I think the topic 'code injection vulnerability' is never out of date
especially if you treat data as a code.
Unfortunately googling for - clojure code injection vulnerability -
returns 'nil'.

Any ideas? Comments? Opinions?

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: code as data vs. code injection vulnerability

2012-05-09 Thread Rostislav Svoboda
On 9 May 2012 15:35, Tassilo Horn tass...@member.fsf.org wrote:
 Simply don't `eval` code/data from sources you don't trust.

In a client-server architecture the thing I (i.e. the server) don't
trust is the client... and I'm not sure if I can ignore him just like
that :)

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: code as data vs. code injection vulnerability

2012-05-09 Thread Rostislav Svoboda
On 9 May 2012 15:57, Walter Tetzner robot.ninja.saus...@gmail.com wrote:
 I feel like *read-eval* should default to false, and you should have to
 explicitly bind it to true. Either that, or there should be 'safe' versions
 of

Many people just copy-paste code snippets to their source files/repl
withouth really knowing if they are safe or not safe.

IMO it might help to rename the *read-eval* to something like
*read-eval-ACHTUNG-danger*. For me - as a newbie - it's a better
proplem indicator than just a simple true/false

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: code as data vs. code injection vulnerability

2012-05-09 Thread Rostislav Svoboda
On 9 May 2012 17:31, Tassilo Horn tass...@member.fsf.org wrote:
 you should bind *read-eval* to false when reading data from unknown sources.

This is the point! On one hand I need to evaluate data from a client
on the other hand I'd like to filter out things like rm -rf /, drop
table users etc. To me it looks like a contradiction impossible to
circumvent. So I ask if there's anything like best practices or even
better something like a concept of access rights or prepared
statements in clojure?. AFAIK there isn't any. So this problem must be
solved on the host platforms (database, operating system etc). To me
this looks much like a wheel-reinventing...

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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] The It starts to look like a real App, 1.2.0 release of the Clojure Namespace Browser (clj-ns-browser)

2012-05-06 Thread Rostislav Svoboda
Hi Frank,
I cleaned everything and created a new project from scratch. It still
does not work but I get another error:

$ rm -rf ~/.lein/
$ rm -rf ~/.m2/
$ lein new clj-browser-test
$ cd clj-browser-test/

# here I added :dev-dependencies [[clj-ns-browser 1.2.0]] to the project.clj

$ cat project.clj
(defproject clj-browser-test 0.1.0-SNAPSHOT
  :description FIXME: write description
  :url http://example.com/FIXME;
  :license {:name Eclipse Public License
:url http://www.eclipse.org/legal/epl-v10.html}
  :dependencies [[org.clojure/clojure 1.3.0]]
  :dev-dependencies [[clj-ns-browser 1.2.0]]
  )

$ lein deps
$ lein repl
user= (use 'clj-ns-browser.sdoc)
FileNotFoundException Could not locate clj_ns_browser/sdoc__init.class
or clj_ns_browser/sdoc.clj on classpath:   clojure.lang.RT.load
(RT.java:430)

Below is the exact output of the commands I executed in bash

Bost


bost@bost-desktop:~/dev$ rm -rf ~/.lein/
bost@bost-desktop:~/dev$ rm -rf ~/.m2/
bost@bost-desktop:~/dev$ lein version
Downloading Leiningen now...
--2012-05-06 11:37:27--
https://github.com/downloads/technomancy/leiningen/leiningen-2.0.0-preview3-standalone.jar
Resolving github.com (github.com)... 207.97.227.239
Connecting to github.com (github.com)|207.97.227.239|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: 
http://cloud.github.com/downloads/technomancy/leiningen/leiningen-2.0.0-preview3-standalone.jar
[following]
--2012-05-06 11:37:28--
http://cloud.github.com/downloads/technomancy/leiningen/leiningen-2.0.0-preview3-standalone.jar
Resolving cloud.github.com (cloud.github.com)... 54.240.162.204,
54.240.162.132, 54.240.162.220, ...
Connecting to cloud.github.com
(cloud.github.com)|54.240.162.204|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9369016 (8.9M) [application/java-archive]
Saving to: 
`/home/bost/.lein/self-installs/leiningen-2.0.0-preview3-standalone.jar'

100%[=]
9,369,016   1.73M/s   in 5.2s

2012-05-06 11:37:33 (1.73 MB/s) -
`/home/bost/.lein/self-installs/leiningen-2.0.0-preview3-standalone.jar'
saved [9369016/9369016]

Leiningen 2.0.0-preview3 on Java 1.7.0_03 Java HotSpot(TM) Client VM
bost@bost-desktop:~/dev$ lein new clj-browser-test
Generating a project called clj-browser-test based on the 'default' template.
bost@bost-desktop:~/dev$ cd clj-browser-test/
bost@bost-desktop:~/dev/clj-browser-test$ gvim project.clj

(gvim:23279): Gnome-WARNING **: Accessibility: failed to find module
'libgail-gnome' which is needed to make this application accessible

(gvim:23279): GLib-GObject-WARNING **: cannot retrieve class for
invalid (unclassed) type `invalid'
bost@bost-desktop:~/dev/clj-browser-test$
** (gvim:23279): WARNING **: Unable to create Ubuntu Menu Proxy:
Timeout was reached

bost@bost-desktop:~/dev/clj-browser-test$ cat project.clj
(defproject clj-browser-test 0.1.0-SNAPSHOT
  :description FIXME: write description
  :url http://example.com/FIXME;
  :license {:name Eclipse Public License
:url http://www.eclipse.org/legal/epl-v10.html}
  :dependencies [[org.clojure/clojure 1.3.0]]
  :dev-dependencies [[clj-ns-browser 1.2.0]]
  )
bost@bost-desktop:~/dev/clj-browser-test$ lein deps
Retrieving org/clojure/clojure/1.3.0/clojure-1.3.0.pom
from http://repo1.maven.org/maven2/
Retrieving org/sonatype/oss/oss-parent/5/oss-parent-5.pom
from http://repo1.maven.org/maven2/
Retrieving org/clojure/clojure/1.3.0/clojure-1.3.0.jar
from http://repo1.maven.org/maven2/
bost@bost-desktop:~/dev/clj-browser-test$ lein repl
Retrieving org/clojure/tools.nrepl/0.2.0-beta1/tools.nrepl-0.2.0-beta1.pom
from http://repo1.maven.org/maven2/
Retrieving org/clojure/pom.contrib/0.0.25/pom.contrib-0.0.25.pom
from http://repo1.maven.org/maven2/
Could not find artifact clojure-complete:clojure-complete:pom:0.2.1 in
central (http://repo1.maven.org/maven2)
Retrieving clojure-complete/clojure-complete/0.2.1/clojure-complete-0.2.1.pom
(1k)
from http://clojars.org/repo/
Could not find artifact org.thnetos:cd-client:pom:0.3.3 in central
(http://repo1.maven.org/maven2)
Retrieving org/thnetos/cd-client/0.3.3/cd-client-0.3.3.pom (2k)
from http://clojars.org/repo/
Could not find artifact clj-http:clj-http:pom:0.2.1 in central
(http://repo1.maven.org/maven2)
Retrieving clj-http/clj-http/0.2.1/clj-http-0.2.1.pom (3k)
from http://clojars.org/repo/
Retrieving org/apache/httpcomponents/httpclient/4.1.2/httpclient-4.1.2.pom
from http://repo1.maven.org/maven2/
Retrieving 
org/apache/httpcomponents/httpcomponents-client/4.1.2/httpcomponents-client-4.1.2.pom
from http://repo1.maven.org/maven2/
Retrieving org/apache/httpcomponents/project/4.1.1/project-4.1.1.pom
from http://repo1.maven.org/maven2/
Retrieving org/apache/httpcomponents/httpcore/4.1.2/httpcore-4.1.2.pom
from http://repo1.maven.org/maven2/
Retrieving 

clojure-1.4.0.jar missing in ~/.m2

2012-05-05 Thread Rostislav Svoboda
Hi, my project.clj contains

  :dependencies [[org.clojure/clojure 1.4.0]
 [noir-cljs 0.3.0]
 [jayq 0.1.0-alpha1]
 [fetch 0.1.0-alpha2]
 [crate 0.1.0-alpha3]
 [noir 1.3.0-beta2]]

but 'lein deps' does not download any clojure-1.4.0.jar only
clojure-1.3.0.jar and clojure-1.2.1.jar

$ cd ~/.m2/repository/org/clojure/clojure/
$ find . -name clojure*
./1.3.0-alpha5/clojure-1.3.0-alpha5.pom
./1.3.0-alpha5/clojure-1.3.0-alpha5.pom.sha1
./1.2.0/clojure-1.2.0.pom
./1.2.0/clojure-1.2.0.pom.sha1
./1.3.0/clojure-1.3.0.jar.sha1
./1.3.0/clojure-1.3.0.jar
./1.3.0/clojure-1.3.0.pom
./1.3.0/clojure-1.3.0.pom.sha1
./1.4.0/clojure-1.4.0.pom
./1.4.0/clojure-1.4.0.pom.sha1
./1.2.1/clojure-1.2.1.pom.sha1
./1.2.1/clojure-1.2.1.pom
./1.2.1/clojure-1.2.1.jar

does anyone know what am I missing? I tried both:
Leiningen 2.0.0-preview3
Leiningen 1.7.1

thx

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: new with clojure, need help!

2012-05-05 Thread Rostislav Svoboda
 i need a more basic guidence on how to install the nessecery plugins
 to eclipse, and what to do with them...

eclipse IDE may look like a good idea but in the beginning it just
increases the amount of work you need to do and troubles you need to
overcome. Just start with the REPL and any reasonably simple text
editor. Then, after you gain some skills, you may try to use eclipse
with ccw, but the chances are high you gonna end up using only vim
or emacs

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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] The It starts to look like a real App, 1.2.0 release of the Clojure Namespace Browser (clj-ns-browser)

2012-05-05 Thread Rostislav Svoboda
I put
  :dev-dependencies [[clj-ns-browser 1.2.0]]

to my project.clj and did:

$ lein deps
Copying 46 files to /home/bost/dev/webcli/lib
[WARNING] Overriding profile: 'null' (source: pom) with new instance
from source: pom
[WARNING] Overriding profile: 'null' (source: pom) with new instance
from source: pom
[WARNING] Overriding profile: 'null' (source: pom) with new instance
from source: pom
Copying 29 files to /home/bost/dev/webcli/lib/dev

$ lein repl
REPL started; server listening on localhost port 27581
IllegalStateException escape-html already refers to:
#'hiccup.core/escape-html in namespace: hiccup.page
clojure.lang.Namespace.warnOrFailOnReplace (Namespace.java:88)
clojure.core=

when I comment out the
;  :dev-dependencies [[clj-ns-browser 1.2.0]]
then everything works as before

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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-1.4.0.jar missing in ~/.m2

2012-05-05 Thread Rostislav Svoboda
On 6 May 2012 01:37, Kurt Harriger kurtharri...@gmail.com wrote:
 When i first upgraded to clojure 1.4 i had a similar issue with lein not 
 downloading updated dependencies. It tirned out to be an invalid version 
 range dependency spec in midje that caused it to fail silently. Perhaps try 
 removing all other dependencies first and try again.

Kurt, you are right:

  :dependencies [[org.clojure/clojure 1.4.0]
; [noir-cljs 0.3.0]
; [jayq 0.1.0-alpha1]
; [fetch 0.1.0-alpha2]
; [crate 0.1.0-alpha3]
; [noir 1.3.0-beta2]
 ]

$ lein deps
Downloading: org/clojure/clojure/1.4.0/clojure-1.4.0.jar from
repository central at http://repo1.maven.org/maven2
Copying 1 file to /home/bost/dev/webcli/lib

$ find ~/.m2/repository/org/clojure/clojure/ -name clojure-1.4.0.jar
/home/bost/.m2/repository/org/clojure/clojure/1.4.0/clojure-1.4.0.jar

but when I activate the dependencies again:

  :dependencies [[org.clojure/clojure 1.4.0]
 [noir-cljs 0.3.0]
 [jayq 0.1.0-alpha1]
 [fetch 0.1.0-alpha2]
 [crate 0.1.0-alpha3]
 [noir 1.3.0-beta2]
 ]
I get:
$ lein repl
REPL started; server listening on localhost port 55066
user= (clojure-version)
1.3.0

My guess is that any of the dependencies I defined in my project.clj contains
:dependencies [[org.clojure/clojure 1.3.0] ... ]
so it overrides my [org.clojure/clojure 1.4.0]

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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-1.4.0.jar missing in ~/.m2

2012-05-05 Thread Rostislav Svoboda
Guys, I need to thank you both. Now it works:

  :dependencies [
 [org.clojure/clojure 1.4.0]
 [colorize 0.1.1 :exclusions [org.clojure/clojure]]
 [noir-cljs 0.3.0]
 [jayq 0.1.0-alpha1]
 [fetch 0.1.0-alpha2]
 [crate 0.1.0-alpha3]
 [noir 1.3.0-beta2]
 ]

$ lein deps
Copying 46 files to /home/bost/dev/webcli/lib
$ lein repl
REPL started; server listening on localhost port 19200
user= (clojure-version)
1.4.0

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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] lein-exec 0.2.0 – Scripting in Clojure

2012-04-23 Thread Rostislav Svoboda
yet another pearl on necklace

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: xml: parse -- edit -- emit

2012-04-18 Thread Rostislav Svoboda
 It seems build.clojure.org now uses Java 6

on the top of http://build.clojure.org/ stays:

All projects build on Sun/Oracle JDK 1.5. -test-matrix jobs test
multiple JDKs and Clojure versions.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: New(er) Clojure cheatsheet hot off the presses

2012-04-16 Thread Rostislav Svoboda
I just checked the http://clojure.org/cheatsheet seing there just the
old version without any tooltips. Would anyone put there a new one
with tooltips? Thx

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Cheap way to find function (defn) name using a macro?

2012-03-28 Thread Rostislav Svoboda
 Sorry, I should explained using code what I am looking for:

Oh yea!!!

 (defmacro find-name []
  ;; some magic here
  ..)

 (defn foo []
  ..
  (println (find-name)) ; should print foo
  ..)

 I am looking for a way to write the `find-name` macro. So, you can see
 I want to use it with regular functions defined using `defn`.

you may start here
https://groups.google.com/forum/?fromgroups#!topic/clojure/RZIFCLWNKuk
and especially - take a look at the macro written by Henk Boom in that thread:

(defmacro nlet [name args  body]
(let [arg-names (take-nth 2 args)
  arg-inits (and args (take-nth 2 (rest args)))]
  `((fn ~name [~@arg-names] ~@body) ~@arg-inits)))

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Cheap way to find function (defn) name using a macro?

2012-03-28 Thread Rostislav Svoboda
 Steve – Your example is already compact, but maybe it can be made even
 cheaper by specifying maxDepth of 1:
 http://docs.oracle.com/javase/6/docs/api/java/lang/management/ThreadMXBean.html#getThreadInfo(long,
 int)

@Shantanu: What about the defn0 macro from Steve:

(defmacro defn0 [name  fdcls]
 `(let [~'%0 (symbol (name (ns-name *ns*)) (name '~name))]
(defn ~name ~@fdcls)))

(defn0 foo [a b]
(println Running function%0 : (+ a b)))

user= (foo 1 2)
Running function user/foo : 3
nil

Is't it what do you need?

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Converting proxy to a macro

2012-03-27 Thread Rostislav Svoboda
 If anyone could help that would be great.

try to start with writing a function like:

user= (def code '(proxy [java.util.Observer] [] (update [o arg]
(println arg
#'user/code
user= (cons 'observer (list (first (first (next code))) (next (next code))) )
(observer java.util.Observer ([] (update [o arg] (println arg

when you have you function ready then take a look at
http://www.learningclojure.com/2010/09/clojure-macro-tutorial-part-i-getting.html
and go through all 3 parts of this tutorial. It gives a good example
how to turn your function to a macro

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Converting proxy to a macro

2012-03-27 Thread Rostislav Svoboda
user= (def c1 '(proxy [java.util.Observer] [] (update [o arg]
(println arg
#'user/c1
user= (def c2 (list (first (first (next c1))) (next (next c1
#'user/c2
user= (def c3 (first (next c2)))
#'user/c3
user= (def c4 (first (next c3)))
#'user/c4
user= (cons 'observer (list (first c2) [] c4))
(observer java.util.Observer [] (update [o arg] (println arg)))

and now just the macro :)

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 cheatsheet with tooltips (alpha)

2012-03-27 Thread Rostislav Svoboda
 I think a tool like you describe sounds like a fun hack to write but I don't 
 see how it has anything to do with the cheat sheet.

A tool that writes the code instead of you cannot be called a sheet
anymore. It's cheating in its *purest* form :) But I repeat: Don't get
excited too much. To make such a tool means to make your computer
think. So all we can do is to make a tool which help you to get over
the initial stages o learning clojure.

Maybe the very first implementation of this tool could just throw a
bunch of examples from http://clojuredocs.org/ at you...

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 cheatsheet with tooltips (alpha)

2012-03-26 Thread Rostislav Svoboda
 if there are any strong feelings about how to make the cheatsheet more of a 
 modular, queryable structure than it currently is.

The key question is Why do we need a cheatsheet? Well, the learning
curve is steep. I.e. there are things like [1] quite many functions
and [2] they are hard to remember and [3] the REPL is by no means
beginner friendly etc.

What can be done about it ?
We can reduce the amount of functions. I doubt this would work. Or we
develop tools like this queryable cheatsheets with tooltips etc. Or...
well, basically most of the time I personally have a problem like:

I have [1 2 3 4 5 6 7 8 9] and (a b c d). How do I make (:a [1 2] :b
[4 5] } {:c [6 7] [:d {8 9}]) from it?

I was thinking about a clojure function which applies some frequently
used patterns (combinations of map, apply, into, assoc, vector, list
etc.) on my input parameter and compares the result with the last
parameter. And it prints the combination if they are equal or gives me
the best nearest guess. I realized it's a job for a macro... something
like discussed on
http://www.learningclojure.com/2010/09/clojure-macro-tutorial-part-i-getting.html

What do you think about that?

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 cheatsheet with tooltips (alpha)

2012-03-26 Thread Rostislav Svoboda
 It's certainly a non-trivial problem

To solve this problem would mean 'to make computer think'. That's why
I only mentioned 'frequently used patterns'. But it would be a great
tool to help learn clojure.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 cheatsheet with tooltips (alpha)

2012-03-26 Thread Rostislav Svoboda
 I have a repo called sente that is largely a blank slate. Would you be 
 interested in collaborating on this?

Yes I'm *definitely* interested but I doubt I'd gonna be much useful for you.

 If so let me know your github username and ill add you to the project.

Thank you but I think it brings more if we exchange our ideas and
patches here on the mailing list.

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 cheatsheet with tooltips (alpha)

2012-03-25 Thread Rostislav Svoboda
I personally find this one better:
http://homepage.mac.com/jafingerhut/files/cheatsheet-clj-1.3.0-v1.4-tooltips/cheatsheet-title-attribute.html

The tooltips appear right at the place where I'm looking and pointing
my mouse, and they tend to appear always at the same place - below the
mouse and line I'm reading.

 There are still some problems with this, but it is ready for experimental 
 use, at least.  Alex, please don't put this on clojure.org -- it ain't ready 
 yet.

 http://homepage.mac.com/jafingerhut/files/cheatsheet-clj-1.3.0-v1.4-tooltips/cheatsheet-full.html

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 cheatsheet with tooltips (alpha)

2012-03-24 Thread Rostislav Svoboda
Hi Andy

On 24 March 2012 11:15, Andy Fingerhut andy.finger...@gmail.com wrote:
 There are still some problems with this, but it is ready for experimental 
 use, at least.  Alex, please don't put this on clojure.org -- it ain't ready 
 yet.

 http://homepage.mac.com/jafingerhut/files/cheatsheet-clj-1.3.0-v1.4-tooltips/cheatsheet-full.html

 Give it a test drive and see what you think.

Slick! :)

I tested the tooltips on chrome, firefox and even on my android. On
chrome I find the tooltip boxes too transparent. On firefox the
transparency is fine but the tooltip font size is bigger than the
font-size used on the page (which IMO could be larger anyway) On the
android, well yea no tooltips appear :) so you need to do this back 
forth clicking as before. Interestingly when you go back then a
tooltip is placed behind the screen edges and it's kind of difficult
to get rid of it. The same appearance like reported here:

 The tooltips themselves seem pretty nice, but on smaller windows, they are
 sometimes placed behind the edges and thus not visible:
 http://i.imgur.com/YA4gF.png

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 Toolbox

2012-03-24 Thread Rostislav Svoboda
A nice list of tools and libraries I stumbled upon. Enjoy!

http://www.clojure-toolbox.com/

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


Re: New(er) Clojure cheatsheet hot off the presses

2012-03-23 Thread Rostislav Svoboda
Hi Andy

 If anyone has suggestions for what you would like to see added to the 
 cheatsheet

It'd be great to have a tooltip appearing at every function I go over
with my mouse. Typically I click on a function just to realize Oh,
this is not the one I need so I have to go back. And this back 
forth repeats several times. IMO tooltips would make such a search
much faster and smoother. (Thx in advance)

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 on android over CLI

2012-03-09 Thread Rostislav Svoboda
On 8 March 2012 11:14, Jim - FooBar(); jimpil1...@gmail.com wrote:
 There is a clojure repl for android...

Jim, my goal is to be able to write android apps in clojure. But to
develop an app in clojure on a PC is pain: The android emulator eats a
lot of memory and takes minutes to start, 'ant debug install' takes
about 1 minute to complete. The JVM (1.7.0_03-b04) running this
command crashes quite regularly. In short: a continuous development is
simply impossible.

So I bought myself a shiny new phone to eliminate some of these
obstacles and I'm trying to set up a decent development environment on
the android. In the 1st step I want to connect from the PC to the
android (over telnet or ssh) and launch the clojure REPL from a bash
running on the android. But as I wrote in the prev post the 'java -jar
clojure-${ver}.dex.jar clojure.main' doesn't work.

regards

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 on android over CLI

2012-03-07 Thread Rostislav Svoboda
Hi. I'm trying to run:
java -cp clojure-${VERSION}.jar clojure.main

on an Android phone from bash (using the 'terminal-ide' app) but I
can't make it past the error bellow. I did the jar-to-dex conversion
using:
dx --verbose --dex --output=clojure-${VERSION}.dex.jar
clojure-${VERSION}.jar

for clojure-1.3.0.jar, clojure-1.3.0-slim.jar and even for the clojure
clone for Android Neko Toolkit from Daniel Solano Gómez:
https://github.com/sattvik/clojure.git

Does anyone know what I missed? Thx in advance

Bost


  Now searching: clojure-1.3.0.dex.jar
found
java.lang.ExceptionInInitializerError
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.spartacusrex.spartacuside.external.java.main(java.java:124)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ExceptionInInitializerError
at clojure.main.clinit(main.java:20)
... 4 more
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException:
Could not locate clojure/core__init.class or clojure/core.clj on
classpath:
at clojure.lang.Util.runtimeException(Util.java:165)
at clojure.lang.RT.clinit(RT.java:319)
... 5 more
Caused by: java.io.FileNotFoundException: Could not locate
clojure/core__init.class or clojure/core.clj on classpath:
at clojure.lang.RT.load(RT.java:430)
at clojure.lang.RT.load(RT.java:398)
at clojure.lang.RT.doInit(RT.java:434)
at clojure.lang.RT.clinit(RT.java:316)
... 5 more


In case of the clojure clone for Daniel Solano Gómez:

  Now searching: clojure-1.4.0-master-SNAPSHOT.dex.jar
found
java.lang.ExceptionInInitializerError
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.spartacusrex.spartacuside.external.java.main(java.java:124)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ExceptionInInitializerError
at clojure.main.clinit(main.java:20)
... 4 more
Caused by: java.lang.ExceptionInInitializerError
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:234)
at java.lang.Class.forName(Class.java:181)
at clojure.lang.RT.clinit(RT.java:235)
... 5 more
Caused by: java.lang.ExceptionInInitializerError
at android.os.Build$VERSION.clinit(Build.java:75)
... 9 more
Caused by: java.lang.UnsatisfiedLinkError: native_get
at android.os.SystemProperties.native_get(Native Method)
at android.os.SystemProperties.get(SystemProperties.java:59)
at android.os.Build.getString(Build.java:216)
at android.os.Build.clinit(Build.java:27)
... 10 more

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Bret Victor's live editable game in ClojureScript

2012-03-02 Thread Rostislav Svoboda
Hi Chris

 I think you may have actually missed the point in the video :) There's
 no pausing necessary - if I made the guy move on his own and changed
 his speed, you'd see it happen immediately.

The thing is, in order to change the speed of the guy you need to
refocus your eyes from the guy and start to scroll up and down in the
code panel on the left. And then, 30 sec later(!) when you find the
place where the speed is defined then you need to take a look at the
keyboard to see where your fingers are and... grrr :(

And then when you want to change the color you need to do the same
again... grrr :(

And if you use different keyboard layouts and start to type 'magenta'
or '#XYZ' then you realise 'Oh merde. Where are the '#' and 'm' keys?
Which keyboard layout am I using right now?' On french, german and
english keyboards the characters like '()#$[] are mapped somewhere
else. On the french keyboard even the 'm' is not there where you would
look for it... grrr :(

And then when you finally found the right place in the code and the
right keyboard layout you come to the point where you want to select
'exactly this(!) shade of azure blue' and you start to wonder what the
hell is color code for it... grrr :(

So no a slider for speed and color change makes a *huge* difference

 Based on what I've heard so far, my implementation is actually more
 real than what Victor himself created and does everything except for
 the slider/color-picker in his demo.

Well, yes that's true. I find your work really great!

cheers

Bost

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Bret Victor's live editable game in ClojureScript

2012-03-01 Thread Rostislav Svoboda
Hi Chris,

While trying to modify the src/coding/client/editor.cljs I realised you put the
resources/public/cljs/coding/client/*.js
to the repository. It's just 2 hours ago I saw the ClojureScript for
first time, but to me these files look like generated...

(cljsc/build src/coding/client/editor.cljs {:output-dir
resources/public/cljs/coding/client :output-to
resources/public/cljs/coding/client/editor.js})

complains about waltz/macros__init.class missing on the classpath so
instead of reinventing the wheel I'd better ask you how do you
generate these js-files?

thx

Bost

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