Re: [ANN] 'Elements of Clojure' is complete

2018-12-03 Thread John Schmidt
I have been holding off bying this until it was done, but now it's time to 
get comfy and dive in, exciting!

Thanks for all the inspiring talks and great Clojure libraries throughout 
the years, they've made me a better programmer in general and a better 
Clojure programmer in particular.

On Monday, December 3, 2018 at 12:25:42 AM UTC+1, Zach Tellman wrote:
>
> I'm very happy to announce, only two and a half years after the release of 
> the first chapter, that Elements of Clojure is completely finished.  
> Further details can be found here: 
> https://groups.google.com/forum/#!topic/elements-of-clojure/UUJjqU1rllU.
>
> If you've never heard of the book before, please check out its website: 
> http://elementsofclojure.com/
>
> Zach
>

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

2018-12-03 Thread Sean Corfield
Our full test suite passes with 1.10 RC 3 at World Singles Networks.

This will go into our next production build, some time this week (possibly 
tomorrow).

On Monday, December 3, 2018 at 8:19:25 AM UTC-8, Alex Miller wrote:
>
> 1.10.0-RC3 is now available.
>
> You can try it with clj using:
>
> clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.0-RC3"}}}'
>
> Changes in 1.10.0-RC3:
>
>- CLJ-2447  - 
>clojure.datafy docstring is missing
>- CLJ-2448  - change 
>name of async-require to serialized-require
>
> You can read the full 1.10 changelog here: 
> https://github.com/clojure/clojure/blob/master/changes.md
>

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

2018-12-03 Thread William Swaney
A great excuse to go back and read the early sections again. Thanks for 
this Zach!

Bill

On Sunday, December 2, 2018 at 3:25:42 PM UTC-8, Zach Tellman wrote:
>
> I'm very happy to announce, only two and a half years after the release of 
> the first chapter, that Elements of Clojure is completely finished.  
> Further details can be found here: 
> https://groups.google.com/forum/#!topic/elements-of-clojure/UUJjqU1rllU.
>
> If you've never heard of the book before, please check out its website: 
> http://elementsofclojure.com/
>
> Zach
>

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


[ANN] Serene - generate clojure.spec with GraphQL and extend GraphQL with clojure.spec

2018-12-03 Thread Dom Kiva-Meyer
 

https://github.com/paren-com/serene


Serene ingests GraphQL schemas and outputs Clojure specs. Serene is the 
easiest way to spec an entire API, whether internal or external.


These specs can be used for:

   - validating API input 
   - validating API output 
   - speccing resolvers 
   - speccing functions that receive or return API data 
   - generating mock data that conforms 
   - and anything else where you might use specs 


We announced Serene at Clojure/conj. Here is the video: 
https://www.youtube.com/watch?v=mgSSVTDZvkI


If you're using GraphQL, please give Serene a try.

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


Re: How to use defrecord getBasis to look up record instance field values

2018-12-03 Thread Matching Socks
To be clear: In the example, p1 is not an instance of Person. p1 is just a 
map. An actual record has (at least) all of the basis fields. 

user> (map->Person {:name "foo"})
#user.Person{:name "foo", :age nil, :company nil}

user> (dissoc *1 :age)
{:name "foo", :company nil}  ;; not a record anymore!

user> (assoc *2 :igloo 42)
#user.Person{:name "foo", :age nil, :company nil, :igloo 42}

As a rule of thumb, in Clojure one does not rush to records. If maps are 
good enough, one uses maps.

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

2018-12-03 Thread Jeroen van Dijk
Hi Khalid,

Reflections [1] are a big problem too for Graalvm. Here is a thread of
playing with Clojure and Graalvm [2]. If you follow the links, you will see
some issues I ran into.

Hth,
Jeroen

[1] Ones that are and aren't caught by *warn-on-reflections*
https://github.com/dundalek/closh/pull/105/files#diff-336b8a8dffae65260f854867fc8529b5R9
[2] https://github.com/dundalek/closh/issues/93



On Mon, Nov 26, 2018 at 6:22 PM Khalid Jebbari 
wrote:

> Thanks a lot. So it means Clojure's `eval` is by design incompatible with
> SubstrateVM.
>
> Does anyone know of others hard incompatibilities ?
>
> On Monday, November 26, 2018 at 6:16:20 PM UTC+1, Gary Trakhman wrote:
>>
>> Yes, eval will generate classes in a dynamic classloader, load them, then
>> call methods on the newly formed class/object except for
>> too-simple-to-be-interesting cases.
>>
>> On Mon, Nov 26, 2018 at 11:43 AM Khalid Jebbari 
>> wrote:
>>
>>> Hi,
>>>
>>> I was doing a small experiment with Clojure and GraalVM and ended with
>>> this minimal reproduction case of an incompatibility between Clojure's
>>> `eval` and GraalVM's native-image tool (the program that compiles a JVM
>>> program to a native executable, based on the GraalVM's SubstrateVM
>>> compiler).
>>>
>>> Here's the Clojure program:
>>>
>>> (ns test-cli.main
>>>   (:gen-class))
>>>
>>> (set! *warn-on-reflection* true)
>>>
>>> (defn -main
>>>   "I don't do a whole lot ... yet."
>>>   [& args]
>>>   (println (+ 1 1)) ;; trick to force loading clojure.lang.Numbers, not
>>> working
>>>   (eval (read-string "(+ 1 1)")))
>>>
>>> Using Clojure 1.9.0 and GraalVM version 1.0.0-rc9.
>>>
>>> When I compile it with the
>>> option "--report-unsupported-elements-at-runtime" (which gives a more
>>> precised error message), here's the output when I try executing the
>>> resulting executable:
>>>
>>> Exception in thread "main" java.lang.ClassNotFoundException:
>>> clojure.lang.Numbers, compiling:(NO_SOURCE_PATH:0:0)
>>> at java.lang.Throwable.(Throwable.java:287)
>>> at java.lang.Exception.(Exception.java:84)
>>> at java.lang.RuntimeException.(RuntimeException.java:80)
>>> at
>>> clojure.lang.Compiler$CompilerException.(Compiler.java:6804)
>>> at clojure.lang.Compiler.analyzeSeq(Compiler.java:7010)
>>> at clojure.lang.Compiler.analyze(Compiler.java:6773)
>>> at clojure.lang.Compiler.analyze(Compiler.java:6729)
>>> at clojure.lang.Compiler.analyzeSeq(Compiler.java:6998)
>>> at clojure.lang.Compiler.analyze(Compiler.java:6773)
>>> at clojure.lang.Compiler.analyze(Compiler.java:6729)
>>> at
>>> clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6100)
>>> at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5460)
>>> at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4022)
>>> at clojure.lang.Compiler.analyzeSeq(Compiler.java:7001)
>>> at clojure.lang.Compiler.analyze(Compiler.java:6773)
>>> at clojure.lang.Compiler.eval(Compiler.java:7059)
>>> at clojure.lang.Compiler.eval(Compiler.java:7025)
>>> at clojure.core$eval.invokeStatic(core.clj:3206)
>>> at test_cli.main$_main.invokeStatic(main.clj:7)
>>> at test_cli.main$_main.doInvoke(main.clj:7)
>>> at clojure.lang.RestFn.invoke(RestFn.java:397)
>>> at clojure.lang.AFn.applyToHelper(AFn.java:152)
>>> at clojure.lang.RestFn.applyTo(RestFn.java:132)
>>> at test_cli.main.main(Unknown Source)
>>> at
>>> com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:164)
>>> Caused by: java.lang.ClassNotFoundException: clojure.lang.Numbers
>>> at java.lang.Throwable.(Throwable.java:287)
>>> at java.lang.Exception.(Exception.java:84)
>>> at
>>> java.lang.ReflectiveOperationException.(ReflectiveOperationException.java:75)
>>> at
>>> java.lang.ClassNotFoundException.(ClassNotFoundException.java:82)
>>> at
>>> com.oracle.svm.core.hub.ClassForNameSupport.forName(ClassForNameSupport.java:51)
>>> at
>>> com.oracle.svm.core.hub.DynamicHub.forName(DynamicHub.java:1036)
>>> at clojure.lang.RT.classForName(RT.java:2204)
>>> at clojure.lang.RT.classForNameNonLoading(RT.java:2217)
>>> at clojure.lang.Compiler$HostExpr.maybeClass(Compiler.java:1041)
>>> at clojure.lang.Compiler$HostExpr$Parser.parse(Compiler.java:982)
>>> at clojure.lang.Compiler.analyzeSeq(Compiler.java:7003)
>>> ... 20 more
>>>
>>> I'm no expert in Java/JVM and would like to understand the problem.
>>> According to the SubstrateVM documentation (
>>> https://github.com/oracle/graal/blob/master/substratevm/LIMITATIONS.md)
>>> it can't compile Dynamic Class Loading/Unloading. Is Clojure's `eval` doing
>>> such dynamic loading? Or doing something else not supported by SubstrateVM
>>> as said in the documentation?
>>>
>>> Thanks *a lot* in advance for you answers.
>>>
>>> --
>>> You received this message