Re: [ANN] Book "The Clojure Standard Library - Annotated Reference"

2016-12-07 Thread Ryan Fowler
I love the idea.

​A gotchas section of some sort could be useful. For instance, a detail
about `case` to consider mentioning is that Java Constants don't work as
tests.

ryans-mbp:~% cat test.clj
(let [incoming-character Character/LINE_SEPARATOR]
  (println "case w/ constant"
   (case incoming-character
 Character/LINE_SEPARATOR :line-separator
 :unknown))
  (println "case w/ int "
   (case incoming-character
 13 :line-separator
 :unknown)))

ryans-mbp:~% java -jar $CLOJURE test.clj
case w/ constant :unknown
case w/ int  :line-separator

​I think I understand why this doesn't work but it feels like it should
work. And without prior knowledge, I don't think I would assume that
constants don't work.

​Ryan​


On Wed, Dec 7, 2016 at 4:57 PM, Alex Miller  wrote:

> This is a cool idea so thanks for working on it.
>
> I was going to buy this (as I buy most of the Clojure books that come out)
> but $48 for an unfinished ebook put me off so I didn't. I totally get why a
> physical book of this length would be that much (because paper is expensive
> right now), but I don't get it with the ebook (particularly EA)? I know you
> likely have little control over this, so it's not really fair to complain
> to you, but maybe you can feed it back to your editor.
>
> While pretty thorough, that case description is still lacking a
> description of one important feature - grouping multiple tests that have
> the same output in a list. Basically this line from the doc string:
>
> (test-constant1 ... test-constantN)  result-expr
>
>
> Example:
>
> (case 3
>   (1 2 3) "1, 2, or 3"
>   4 "4"
>   (5 6 7) "5, 6, or 7")
>
> ;;=> "1, 2, or 3"
>
> I think most people are unaware of this feature and seems like it's the
> kind of thing you'd want in the book.
>
> Alex
>
> On Wednesday, December 7, 2016 at 12:14:29 PM UTC-6, Renzo Borgatti wrote:
>>
>> Hi all,
>>
>> I'm very happy to announce the early access of a new book: "Clojure
>> Standard Library - Annotated Reference" by Manning. Although it's a
>> reference of the roughly 700+ functions (and macros) coming out of the box
>> with the Clojure jar file, it is not designed to read as a boring list.
>> Think of all the Stackoverflow, mailing lists, ClojureDocs, articles, blogs
>> all mashed together to create an essay for each function. The book website
>> is:
>>
>> https://www.manning.com/books/clojure-standard-library
>>
>> It contains now a total of 4 chapters (around 200 pages) or ~30
>> functions, starting with some of the most important available in the
>> standard library. Here's a sample of “case" how it appears on the book
>> http://tinyurl.com/hekc55u to give you an idea of the kind of treatment
>> they get. Needless to say any feedback is highly appreciated. Any question
>> please shout here, personally at reborg*at*reborg.net or on the book
>> forum.
>>
>> Regards,
>> Renzo
>>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from 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: lein repl and own functions

2016-07-14 Thread Ryan Fowler
you might find success with putting some injections in your
~/.lein/profiles.clj file.


{:user {:injections [(defn foo[] (println "foo"))]}}

On Thu, Jul 14, 2016 at 1:13 PM, Cecil Westerhof 
wrote:

> 2016-07-14 20:06 GMT+02:00 Timothy Baldridge :
>
>> There probably is, since the user.clj file can exist anywhere on the
>> classpath. So it should be possible to add an entry to profile.clj and add
>> a classpath folder to some global location.
>>
>> However, I'm not sure I would recommend this approach. IMO, it's better
>> to keep all the development tools for a project with the project itself.
>> With a local user.clj you can check that into git and have it the next time
>> you share/re-download the project
>> ​.
>>
>
> ​It is more for when I am doing lein repl, not for projects. I could make
> a dummy project and always do lein repl there, but I find that a bit of a
> bother. I will look into it.
>
>> ​
>>
>> On Thu, Jul 14, 2016 at 11:50 AM, Cecil Westerhof > > wrote:
>>
>>>
>>> 2016-07-14 18:18 GMT+02:00 Timothy Baldridge :
>>>
 Anything found in src/user.clj will be automatically loaded when lein
 repl starts.

>>>
>>> ​That works only for that directory. With my Bash script the functions
>>> where always included. Is there no way to do it always?​
>>>
>>>
>>>
 On Thu, Jul 14, 2016 at 7:52 AM, Cecil Westerhof <
 cldwester...@gmail.com> wrote:

> When I first worked with Clojure I used a Bash script with had:
> rlwrap java -cp "${CP}" clojure.main --init "${CLOJURE_INIT}"
> --repl
>
> In this way I had several of my own functions in the REPL. Now I
> started again with Clojure I understood I should use ‘lein repl’. Is there
> a method to get my own functions also included when using ‘lein repl’?
>

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

2016-06-12 Thread Ryan Fowler
> On Jun 12, 2016, at 10:45 AM, Alex Miller  wrote:
> 
> Still much to be determined about this but I expect that specs for core will 
> be provided and maintained by us, because while there are a lot of obvious 
> specs in core, there are also a lot of far more subtle ones.

I think this is the right choice and I'm looking forward to seeing the details. 
My gut says that the better error messages alone are going to help 
significantly in convincing colleagues to work through learning Clojure.

Awesome work so far.

Ryan

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


instrumenting clojure.core

2016-06-12 Thread Ryan Fowler
Is there an effort to write specs for Clojure's core namespaces? Apologies
if this has already been addressed.

I've been tinkering with trivial (and probably wrong) fdefs on
clojure.core/map and clojure.core/identity. It seems that the spec
exception messages are way better than what we have now.

Code is here: https://gist.github.com/ryfow/69a64e966d48258dfa9dcb5aa74005eb


=
Before instrumenting clojure.core/map
=
Form: (into [] (map nil [1 2 3] [1 2 3]))
Exception Class:  java.lang.NullPointerException
Message:  nil

Form: (into [] (map 1 [1 2 3] [1 2 3]))
Exception Class:  java.lang.ClassCastException
Message:  java.lang.Long cannot be cast to clojure.lang.IFn

Form: (into [] (map identity 4))
Exception Class:  java.lang.IllegalArgumentException
Message:  Don't know how to create ISeq from: java.lang.Long

=
After instrumenting clojure.core/map
=
Form: (into [] (map nil [1 2 3] [1 2 3]))
Exception Class:  clojure.lang.ExceptionInfo
Message:  Call to #'clojure.core/map did not conform to spec:
In: [0] val: nil fails at: [:args :fn] predicate: ifn?
:clojure.spec/args  (nil [1 2 3] [1 2 3])


Form: (into [] (map 1 [1 2 3] [1 2 3]))
Exception Class:  clojure.lang.ExceptionInfo
Message:  Call to #'clojure.core/map did not conform to spec:
In: [0] val: 1 fails at: [:args :fn] predicate: ifn?
:clojure.spec/args  (1 [1 2 3] [1 2 3])


Form: (into [] (map identity 4))
Exception Class:  clojure.lang.ExceptionInfo
Message:  Call to #'clojure.core/map did not conform to spec:
In: [1] val: 4 fails at: [:args :seq] predicate: sequential?
:clojure.spec/args  (#object[clojure.core$identity 0x15a04efb
"clojure.core$identity@15a04efb"] 4)


=
Before instrumenting clojure.core/identity
=
Form: (into [] (map identity [1 2 3] [1 2 3]))
Exception Class:  clojure.lang.ArityException
Message:  Wrong number of args (2) passed to: core/identity

=
After instrumenting clojure.core/identity
=
Form: (into [] (map identity [1 2 3] [4 5 6]))
Exception Class:  clojure.lang.ExceptionInfo
Message:  Call to #'clojure.core/identity did not conform to spec:
In: [1] val: (4) fails at: [:args] predicate: (cat :one-argument identity),
 Extra input
:clojure.spec/args  (1 4)

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

2016-02-15 Thread Ryan Fowler
Great release, Curtis! I'm looking forward to cleaning up some of my
composition hacks.



On Mon, Feb 15, 2016 at 8:04 AM, Curtis Summers <
curtis.summ...@layerware.com> wrote:

> I'm happy to announce the 0.4.0 release of HugSQL.
>
> HugSQL is a Clojure library for embracing SQL in your projects.
>
> This release focuses on composability features.  Specifically, we now have 
> Clojure
> Expressions  providing the full
> power of Clojure within your SQL templates.  We also have Snippets
>  to create partial SQL statements
> that can be composed into larger queries.
>
> http://www.hugsql.org/
>
>
> Changes from 0.3.x to 0.4.0
>
>- Escape colon in SQL (issue #13
>)
>- def-db-fns-from-string & def-sql-fns-from-string (issue #16
>)
>- Added several functions that operate on individual SQL statements,
>which are useful at the REPL or for one-off composing.  (See Other
>Useful Functions )
>- Specify a function as private and other metadata (issue #17
>)
>- Better support for Returning Execute and Insert w/ Return Keys (See 
> Insert
>Usage ) (issues #8
> and #15
>)
>- Clojure Expressions 
>- Snippets 
>- Parameter Name Deep-Get 
>for drilling down into parameter data
>- Better docs & tests
>
> A big thank you to those of you who submitted suggestions and bugs during
> this cycle.  HugSQL is better because of your input.
>
> What is HugSQL?  HugSQL...
>
>
>-
>- is of the opinion that SQL is the right tool for the job when
>working with a relational database.
>- uses simple conventions in your SQL files to define (at compile
>time) database functions in your Clojure namespace, creating a clean
>separation of Clojure and SQL code.
>- supports runtime replacement of SQL Value Parameters (e.g., where id
>= :id), SQL Identifiers (i.e. table/column names), and SQL Keywords. You
>can also implement your own parameter types.
>- features Clojure Expressions and Snippets providing the full
>expressiveness of Clojure and the composability of partial SQL statements
>when constructing complex SQL queries.
>- has protocol-based adapters supporting multiple database libraries
>and ships with adapters for clojure.java.jdbc (default) and clojure.jdbc
>
> Thanks!
>
> Curtis Summers
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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

2016-02-11 Thread Ryan Fowler
On Tue, Feb 9, 2016 at 12:36 PM, Alex Miller  wrote:

> I'm doing some research on slow Clojure boot time and would be interested
> in collecting info about example use cases where it's been a problem for
> people.
>

​The following snippet helps me visualize load times. It might be helpful
to others.​ The output is a bit long, so I just added the code and
usage/output in a gist at https://gist.github.com/ryfow/4283b64b4dd205d610e8

​​(def ^:dynamic *indent* 0)
(alter-var-root
 #'clojure.core/load
 (fn [orig]
   (fn [& paths]
 (let [t (System/nanoTime)
   r (binding [*indent* (inc *indent*)]
   (apply orig paths))]
   (binding [*out* *err*]
 (println (apply str (repeat *indent* " ")) (/ (- (System/nanoTime)
t) 100.0)  paths)
 (flush))
   r

;; Require namespace in question here
(require 'clojure.core.async)

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

2016-01-25 Thread Ryan Fowler
I just submitted http://dev.clojure.org/jira/browse/CLJ-1886

I was able to narrow down the problem space a little bit, but it's still
gnarly.

Ryan

On Mon, Jan 25, 2016 at 4:27 AM, Nicola Mometto  wrote:

> Can you log this issue in clojure's JIRA?
>
> On Friday, January 15, 2016 at 11:21:17 PM UTC, Ryan Fowler wrote:
>>
>> I've got a head-scratcher.
>>
>> A combination of aot compiling, ring-jetty, slf4j-timbre, timbre and
>> core.async causes "java.lang.NoSuchFieldError: __thunk__0__"
>>
>> I've created a repo that reproduces the problem for me, but I'm out of my
>> depth at this point. Unfortunately I couldn't seem to get rid of any more
>> dependencies.
>>
>> https://github.com/ryfow/weird-aot
>>
>> If anyone is interested in digging around with me on this, please say so.
>> Here's some stack trace to entice you:
>>
>> Exception in thread "main" java.lang.NoSuchFieldError: __thunk__0__,
>> compiling:(/private/tmp/weird-aot/compile.clj:1:1)
>> at clojure.lang.Compiler.load(Compiler.java:7239)
>> at clojure.lang.Compiler.loadFile(Compiler.java:7165)
>> at clojure.main$load_script.invoke(main.clj:275)
>> at clojure.main$script_opt.invoke(main.clj:337)
>> at clojure.main$main.doInvoke(main.clj:421)
>> at clojure.lang.RestFn.invoke(RestFn.java:408)
>> at clojure.lang.Var.invoke(Var.java:379)
>> at clojure.lang.AFn.applyToHelper(AFn.java:154)
>> at clojure.lang.Var.applyTo(Var.java:700)
>> at clojure.main.main(main.java:37)
>> Caused by: java.lang.NoSuchFieldError: __thunk__0__
>> at clojure.tools.analyzer.jvm.utils__init.load(Unknown Source)
>> at clojure.tools.analyzer.jvm.utils__init.(Unknown Source)
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Class.java:340)
>> at clojure.lang.RT.classForName(RT.java:2154)
>> at clojure.lang.RT.classForName(RT.java:2163)
>> at clojure.lang.RT.loadClassForName(RT.java:2182)
>> at clojure.lang.RT.load(RT.java:436)
>> at clojure.lang.RT.load(RT.java:412)
>> at clojure.core$load$fn__5448.invoke(core.clj:5866)
>> at clojure.core$load.doInvoke(core.clj:5865)
>> at clojure.lang.RestFn.invoke(RestFn.java:408)
>> at clojure.core$load_one.invoke(core.clj:5671)
>> at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
>> at clojure.core$load_lib.doInvoke(core.clj:5710)
>> at clojure.lang.RestFn.applyTo(RestFn.java:142)
>> at clojure.core$apply.invoke(core.clj:632)
>> at clojure.core$load_libs.doInvoke(core.clj:5749)
>> at clojure.lang.RestFn.applyTo(RestFn.java:137)
>> at clojure.core$apply.invoke(core.clj:632)
>> at clojure.core$require.doInvoke(core.clj:5832)
>> at clojure.lang.RestFn.invoke(RestFn.java:703)
>> at
>> clojure.tools.analyzer.jvm$loading__5340__auto1169.invoke(jvm.clj:9)
>> at clojure.tools.analyzer.jvm__init.load(Unknown Source)
>> at clojure.tools.analyzer.jvm__init.(Unknown Source)
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Class.java:340)
>> at clojure.lang.RT.classForName(RT.java:2154)
>> at clojure.lang.RT.classForName(RT.java:2163)
>> at clojure.lang.RT.loadClassForName(RT.java:2182)
>> at clojure.lang.RT.load(RT.java:436)
>> at clojure.lang.RT.load(RT.java:412)
>> at clojure.core$load$fn__5448.invoke(core.clj:5866)
>> at clojure.core$load.doInvoke(core.clj:5865)
>> at clojure.lang.RestFn.invoke(RestFn.java:408)
>> at clojure.core$load_one.invoke(core.clj:5671)
>> at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
>> at clojure.core$load_lib.doInvoke(core.clj:5710)
>> at clojure.lang.RestFn.applyTo(RestFn.java:142)
>> at clojure.core$apply.invoke(core.clj:632)
>> at clojure.core$load_libs.doInvoke(core.clj:5749)
>> at clojure.lang.RestFn.applyTo(RestFn.java:137)
>> at clojure.core$apply.invoke(core.clj:632)
>> at clojure.core$require.doInvoke(core.clj:5832)
>> at clojure.lang.RestFn.invoke(RestFn.java:805)
>> at
>> clojure.core.async.impl.ioc_macros$loading__5340__auto675.invoke(ioc_macros.clj:12)
>> at clojure.core.async.impl.ioc_macros__init.load(Unknown Source)
>> at clojure.core.async.impl.i

java.lang.NoSuchFieldError: __thunk__0__

2016-01-15 Thread Ryan Fowler
I've got a head-scratcher.

A combination of aot compiling, ring-jetty, slf4j-timbre, timbre and
core.async causes "java.lang.NoSuchFieldError: __thunk__0__"

I've created a repo that reproduces the problem for me, but I'm out of my
depth at this point. Unfortunately I couldn't seem to get rid of any more
dependencies.

https://github.com/ryfow/weird-aot

If anyone is interested in digging around with me on this, please say so.
Here's some stack trace to entice you:

Exception in thread "main" java.lang.NoSuchFieldError: __thunk__0__,
compiling:(/private/tmp/weird-aot/compile.clj:1:1)
at clojure.lang.Compiler.load(Compiler.java:7239)
at clojure.lang.Compiler.loadFile(Compiler.java:7165)
at clojure.main$load_script.invoke(main.clj:275)
at clojure.main$script_opt.invoke(main.clj:337)
at clojure.main$main.doInvoke(main.clj:421)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.lang.Var.invoke(Var.java:379)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)
Caused by: java.lang.NoSuchFieldError: __thunk__0__
at clojure.tools.analyzer.jvm.utils__init.load(Unknown Source)
at clojure.tools.analyzer.jvm.utils__init.(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:340)
at clojure.lang.RT.classForName(RT.java:2154)
at clojure.lang.RT.classForName(RT.java:2163)
at clojure.lang.RT.loadClassForName(RT.java:2182)
at clojure.lang.RT.load(RT.java:436)
at clojure.lang.RT.load(RT.java:412)
at clojure.core$load$fn__5448.invoke(core.clj:5866)
at clojure.core$load.doInvoke(core.clj:5865)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5671)
at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
at clojure.core$load_lib.doInvoke(core.clj:5710)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$load_libs.doInvoke(core.clj:5749)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$require.doInvoke(core.clj:5832)
at clojure.lang.RestFn.invoke(RestFn.java:703)
at
clojure.tools.analyzer.jvm$loading__5340__auto1169.invoke(jvm.clj:9)
at clojure.tools.analyzer.jvm__init.load(Unknown Source)
at clojure.tools.analyzer.jvm__init.(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:340)
at clojure.lang.RT.classForName(RT.java:2154)
at clojure.lang.RT.classForName(RT.java:2163)
at clojure.lang.RT.loadClassForName(RT.java:2182)
at clojure.lang.RT.load(RT.java:436)
at clojure.lang.RT.load(RT.java:412)
at clojure.core$load$fn__5448.invoke(core.clj:5866)
at clojure.core$load.doInvoke(core.clj:5865)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5671)
at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
at clojure.core$load_lib.doInvoke(core.clj:5710)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$load_libs.doInvoke(core.clj:5749)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$require.doInvoke(core.clj:5832)
at clojure.lang.RestFn.invoke(RestFn.java:805)
at
clojure.core.async.impl.ioc_macros$loading__5340__auto675.invoke(ioc_macros.clj:12)
at clojure.core.async.impl.ioc_macros__init.load(Unknown Source)
at clojure.core.async.impl.ioc_macros__init.(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:340)
at clojure.lang.RT.classForName(RT.java:2154)
at clojure.lang.RT.classForName(RT.java:2163)
at clojure.lang.RT.loadClassForName(RT.java:2182)
at clojure.lang.RT.load(RT.java:436)
at clojure.lang.RT.load(RT.java:412)
at clojure.core$load$fn__5448.invoke(core.clj:5866)
at clojure.core$load.doInvoke(core.clj:5865)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5671)
at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
at clojure.core$load_lib.doInvoke(core.clj:5710)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$load_libs.doInvoke(core.clj:5749)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:632)
at clojure.core$require.doInvoke(core.clj:5832)
at clojure.lang.Rest

Re: [Clojurescript] .getElementById returns NULL

2016-01-03 Thread Ryan Fowler
On Sun, Jan 3, 2016 at 8:04 PM, Nathan Smutz  wrote:

>
> (.log js/console (. js/document getElementById "test-content"))
>
>
​I suspect you need something more like this: ​
 (.log js/console (.getElementById js/document "test-content"))​

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

2012-10-09 Thread Ryan Fowler
Thanks!

It all works. Now I'm killing myself trying to figure out what the heck I 
was doing wrong.

Ryan

On Tuesday, October 9, 2012 7:44:06 PM UTC-5, Stuart Sierra wrote:
>
> clojure.test is weird (my fault) but I don't think it's that weird.
>
> Your 'defmethod' is correct, but it shouldn't need the 'binding' around 
> it. This works for me:
>
> user=> (require '[clojure.test :as t])
>
> user=> (defmethod t/assert-expr 'fail [msg form]
> `(t/do-report {:type :fail :expected nil :actual nil :message 
> ~msg}))
> #
>
> user=> (t/deftest a-test (t/is (fail) "Failure"))
> #'user/a-test
>
> user=> (a-test)
>
> FAIL in (a-test) (NO_SOURCE_FILE:1)
> Failure
> expected: nil
>   actual: nil
>
>

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

adding clojure.test/assert-expr methods

2012-10-09 Thread Ryan Fowler
I'm trying to add some clojure.test/assert-expr methods to help with 
failure reporting and I can't find much information on the topic. I'm 
wondering if I'm on the right track. The only way I've been able to get it 
to work is if the defmethod happens with *ns* bound to 'clojure.test.

The following code appears to work (although the actual method is useless.) 
Is this the proper way to go about adding clojure.test/assert-expr methods? 

(ns blammo.core-test
  (:use clojure.test
blammo.core))

(binding [*ns* 'clojure.test] 
  (defmethod clojure.test/assert-expr 'fail [msg form] 
`(clojure.test/do-report {:type :fail :expected nil :actual nil 
:message ~msg})))

(deftest a-test
(is (fail) "Failure Message"))


Thanks,
Ryan

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