[ANN] Clojure 1.8.0-alpha5

795 views
Skip to first unread message

Alex Miller

unread,
Sep 11, 2015, 9:41:34 AM9/11/15
to Clojure
Clojure 1.8.0-alpha5 is now available.

Try it via
The 1.8.0-alpha5 release reverts the change made for CLJ-1250 in 1.8.0-alpha3 due to issues covered in CLJ-1793

String Functions

Several new string functions were added to increase portability with ClojureScript and reduce the need for Java interop calls:

  • clojure.string/index-of - search for the index of a char or string in a string
  • clojure.string/last-index-of - search for the index of a char or string backwards in a string
  • clojure.string/starts-with? - true if string starts with a substring
  • clojure.string/ends-with? - true if string ends with a substring
  • clojure.string/includes? - true if string includes a substring
For more info:
Server Socket and REPL 

This feature is a work in progress, and feedback is appreciated!

The Clojure runtime now has the ability to start a socket server at initialization based on system properties. One expected use for this is serving a socket-based REPL, but it also has many other  potential uses for dynamically adding server capability to existing programs without code changes.

A socket server will be started for each JVM system property like "clojure.server.<server-name>". The value for this property is an edn map representing the configuration of the socket server with the following properties:
  • server-daemon - defaults to true, socket server thread doesn't block exit
  • address - host or address, defaults to loopback
  • port - positive integer, required
  • accept - namespaced symbol of function to invoke on socket accept, required
  • args - sequential collection of args to pass to accept
  • bind-err - defaults to true, binds `*err*` to socket out stream
  • client-daemon - defaults to true, socket client thread doesn't block exit
Additionally, there is a repl function provided that is slightly customized for use with the socket server in clojure.core.server/repl.

Following is an example of starting a socket server with a repl listener. This can be added to any existing Clojure program to allow it to accept external REPL clients via a local connection to port 5555.

    -Dclojure.server.repl="{:port 5555 :accept clojure.core.server/repl}"

An example client you can use to connect to this socket repl is telnet:

    $ telnet 127.0.0.1 5555
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    user=> (println "hello")
    hello

See:
* CLJ-1671
* Socket REPL design page

Other changes

Below is a list of the other changes included in alpha5. See the full change log here: https://github.com/clojure/clojure/blob/master/changes.md.

  • CLJ-1319 array-map fails lazily if passed an odd number of arguments
  • CLJ-1766 Serializing+deserializing lists breaks their hash
  • CLJ-1609 Edge case in Reflector's search for a public method declaration
  • CLJ-1586 Compiler doesn't preserve metadata for LazySeq literals
  • CLJ-1232 Functions with non-qualified return type hints will now work without import from other namespace
  • Records and types without fields eval to empty map
  • CLJ-1812 Recently-added test fails on Windows
  • CLJ-1778 let-bound namespace-qualified bindings should throw (if not map destructuring)

Tom Marble

unread,
Sep 15, 2015, 11:19:01 AM9/15/15
to Clojure
On Friday, September 11, 2015 at 8:41:34 AM UTC-5, Alex Miller wrote:
Clojure 1.8.0-alpha5 is now available.
 
 I am pleased to report that this version of Clojure builds fine with the early access version of JDK 9 (w/jigsaw):
http://mail.openjdk.java.net/pipermail/jigsaw-dev/2015-September/004480.html
https://jdk9.java.net/jigsaw/

tmarble@ficelle 141 :) mvn -version
Apache Maven 3.3.3
Maven home: /usr/share/maven
Java version: 1.9.0-ea, vendor: Oracle Corporation
Java home: /home/tmarble/src/oracle/jdk1.9.0
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.1.0-2-amd64", arch: "amd64", family: "unix"
tmarble@ficelle 142 :) time mvn package > build-14.log 2>&1 &
[1] 7124
tmarble@ficelle 143 :) tail -7 build-14.log
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:49 min
[INFO] Finished at: 2015-09-15T10:09:43-05:00
[INFO] Final Memory: 17M/128M
[INFO] ------------------------------------------------------------------------
tmarble@ficelle 144 :)

Regards,

--Tom

Alex Miller

unread,
Sep 15, 2015, 11:58:20 AM9/15/15
to clo...@googlegroups.com
Glad to hear it! 

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

Reply all
Reply to author
Forward
0 new messages