Clojure spec check and recovery

2018-04-03 Thread Alex Miller
Yes

-- 
You 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] packthread 0.1.10

2018-04-03 Thread Jason Felice
This release handles `if-some` and `when-some` and supports ClojureScript.

packthread

https://github.com/maitria/packthread

"Heavy" threading macros.
Why?

Because every time you've wanted to:

(-> 42
  (let [x 79]
(+ x))
  inc)

but clojure wouldn't let you.
+>

Threads value through forms in much the same way as ->, except for special
handling of the following forms:
if,
if-not, if-let, if-some, when, when-let, when-not, when-some

The value is threaded through the *then* and *else* clauses independently,
leaving the test conditions alone. If an else clause is missing, it is will
be supplied as though the value had been threaded through identity.

For example,

(+> 42 (if true inc)) ;=> 43
(+> 42 (if false inc)) ;=> 42

In when, when-let, when-not, and when-some forms, the value is threaded
through every form in the body, not just the last.
case

The values being compared are left untouched and the value is threaded
through the expr clause of each condition.

For example,

(+> 42
  (case 1
1 inc
2 dec)) ;=> 43

(+> 42
  (case 2
1 inc
2 dec)) ;=> 41

cond

The test clauses are left untouched and the value is threaded through the
expr clauses of each condition. If there's no :else condition, +> pretends
it was (identity).

For example,

(+> 42
  (cond
(= 1 2)
inc)) ;=> 42

(+> 42
  (cond
(= 1 1)
dec)) ;=> 41

do

The current expr is threaded through the body forms of the do.
let

The current expression is threaded through the body of the let form, with
the bindings in place. For example:

(+> 42
  (let [x 1]
(+ x))) ;=> 43

try

The current expression is threaded through the body of the try form. The
*same* value is threaded through each catchclause and any finally clause.

(+> 42 (try
 inc
 (catch Exception e
   dec)) ;=> 43

(+> 42 (try
 (+ :foo)
 (catch Exception e
   dec))) ;=> 41

(+> 42 (try
 inc
 (finally dec))) ;=> 42

in

Threads inner expressions through a lens

 of value.

lens is a function with two arities - 1 and 2. The 1-arity body is the
"get" function, while the 2-arity body is the "putback" function. "get"
lifts the value into the new context, while "putback" translates the value
back to the original context.

For example,

(+> 42
(in (fn
  ([v] (/ v 2))
  ([v u] (* u 2)))
  inc)) ;=> 85/2

This can be thought of as 'lifting' the body expressions into the 'world
where things are half as large'.

As a special case, if lens is a keyword, in assumes that value is a map and
that sub-key are threaded through the inner expressions.

For example,

(+> {:hello 42}
(in :hello
  (+ 5))) ;=> {:hello 47}

This macro can only be used inside +> or +>>.
+>>

Threads expressions like ->>, except with the handling of the special forms
above.
fn+>

Like fn, except threads the function's first argument through the body
using +> . The parameter vector can be omitted, in which case the resulting
function takes one parameter.

((fn+> [x y] (+ x)) 7 3) ;=> 14
((fn+> inc inc) 42) ;=> 44

Installing

Leiningen  dependency information:

[com.maitria/packthread "0.1.10"]

Usage

(require '[packthread.core :refer :all])

(+> 42
(if true
  inc)) ;=> 43

See core_test.clj

 for examples of usage.
License

Copyright 2014 Maitria

You have permission to use this in any way you like (modify it, sell it,
republish it), provided you agree to all the following conditions:

   - you don't mislead anyone about it
   - you don't interfere with our ability to use it
   - you release us from any claims of liability if it causes problems for
   you

-- 
You 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 unsu

Re: Anyone spent time with Kawa Scheme?

2018-04-03 Thread 'André' via Clojure
Rich has covered some of the motivation of why not extending existing
Lisp->Java integrations, like Kawa and ABCL:

https://www.youtube.com/watch?v=cPNkH-7PRTk, around 3:25


On 04/02/2018 05:53 PM, 'somewhat-functional-programmer' via Clojure wrote:
> I've recently come across Kawa Scheme and am very intrigued by it. 
> It's Java integration is superb like Clojure and it's very fast.  Has
> anyone here used it to build something?
>
> So far I've only tried it with small toy programs.  Things I like
> about it:
>   - Starts up very quickly
>   - Java method notation lends itself to auto-complete
>  (instance:method param1 param2)
>   - Can pre-compile and use it on Android
>   - Repl has line numbers so compilation errors on repl forms have
> source lines
>
> Maybe Kawa fits into a niche that Clojure leaves open with its heavier
> runtime?  Maybe I'm just trying toy programs and those toy programs
> are fast? :-)
>
> One thing that intrigues me here though since java integration is so
> easy with Kawa is the notion of using Clojure's immutable data
> structures from Kawa -- maybe even making a clojure "core" library for
> use from Kawa.
>
> -lc
>
> -- 
> You 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] packthread 0.1.10

2018-04-03 Thread Alan Thompson
If you are interested in alternatives to `clojure.core/->`, you may be
interested in the `it->` macro from the Tupelo library
.  Here is a
summary:

=

Usage examples for tupelo.core/it→
Name:
"it-thread" (literate threading macro)

Homepage: https://github.com/cloojure/tupelo
Lein
coords: [tupelo "0.9.75"]

Usage: clojure

  (it-> ...)

Why?

Because every time you’ve wanted to:

(ns xyz
  (:use tupelo.core))
(it-> 3
  (let [x 9]
(- x it))
  (inc it)
  (- it 6));=> 1

(it-> 42
  (if true
(inc it)
:blah)) ;=> 43
(it-> 42
  (if false
(inc it)
:blah)) ;=> :blah
; works same for `if-not`, `when`, `when-not`, etc.

(it-> 42
  (case 1
1 (inc it)
2 (dec it))) ;=> 43

(it-> 42
  (case 2
1 (inc it)
2 (dec it))) ;=> 41

(it-> 42
  (cond
(= 1 2)
(inc it))) ;=> 42

(it-> 42
  (cond
(= 1 1)
(dec it))) ;=> 41

(it-> 42
  (let [x 1]
(+ it x))) ;=> 43

try

The current expression is threaded through the body of the try form. The
*same* value is threaded through each catchclause and any finally clause.

(ti-> 42
  (try
(inc it)
(catch Exception e
  (dec it))) ;=> 43

(it-> 42
  (try
(+ it :foo)
(catch Exception e
  (dec it ;=> 41

(it-> 42
  (try
(inc it)
(finally
  (+ 10 it ;=> 53
; with anonymous functions
(it-> 7
  ((fn [x y] (* x y)) it 3))  ;=> 21
(it-> 42
  #(-> % inc inc)) ;=> 44



On Tue, Apr 3, 2018 at 8:40 AM, Jason Felice 
wrote:

> This release handles `if-some` and `when-some` and supports ClojureScript.
>
> packthread
>
> https://github.com/maitria/packthread
>
> "Heavy" threading macros.
> Why?
>
> Because every time you've wanted to:
>
> (-> 42
>   (let [x 79]
> (+ x))
>   inc)
>
> but clojure wouldn't let you.
> +>
>
> Threads value through forms in much the same way as ->, except for
> special handling of the following forms:
>
> if,
> if-not, if-let, if-some, when, when-let, when-not, when-some
>
> The value is threaded through the *then* and *else* clauses
> independently, leaving the test conditions alone. If an else clause is
> missing, it is will be supplied as though the value had been threaded
> through identity.
>
> For example,
>
> (+> 42 (if true inc)) ;=> 43
> (+> 42 (if false inc)) ;=> 42
>
> In when, when-let, when-not, and when-some forms, the value is threaded
> through every form in the body, not just the last.
> case
>
> The values being compared are left untouched and the value is threaded
> through the expr clause of each condition.
>
> For example,
>
> (+> 42
>   (case 1
> 1 inc
> 2 dec)) ;=> 43
>
> (+> 42
>   (case 2
> 1 inc
> 2 dec)) ;=> 41
>
> cond
>
> The test clauses are left untouched and the value is threaded through the
> expr clauses of each condition. If there's no :else condition, +> pretends
> it was (identity).
>
> For example,
>
> (+> 42
>   (cond
> (= 1 2)
> inc)) ;=> 42
>
> (+> 42
>   (cond
> (= 1 1)
> dec)) ;=> 41
>
> do
>
> The current expr is threaded through the body forms of the do.
> let
>
> The current expression is threaded through the body of the let form, with
> the bindings in place. For example:
>
> (+> 42
>   (let [x 1]
> (+ x))) ;=> 43
>
> try
>
> The current expression is threaded through the body of the try form. The
> *same* value is threaded through each catchclause and any finally clause.
>
> (+> 42 (try
>  inc
>(catch Exception e
>  dec)) ;=> 43
>
> (+> 42 (try
>  (+ :foo)
>(catch Exception e
>  dec))) ;=> 41
>
> (+> 42 (try
>  inc
>(finally dec))) ;=> 42
>
> in
>
> Threads inner expressions through a lens
> 
>  of value.
>
> lens is a function with two arities - 1 and 2. The 1-arity body is the
> "get" function, while the 2-arity body is the "putback" function. "get"
> lifts the value into the new context, while "pu

Re: D&D + Clojure?

2018-04-03 Thread Shaun Gilchrist
Also interested!

On Tue, Mar 27, 2018 at 1:58 PM Larry Christensen  wrote:

> That would be super cool, I knew I couldn't be the only D&D Clojurist out
> there. I'll look into the details and get back to you. I'll may just open
> source it on Github, which should make it easy.
>
>
> On Tuesday, March 27, 2018 at 2:42:34 PM UTC-6, tbc++ wrote:
>
>> Nice! I think I used this app the other day when working on a campaign
>> and didn't know it was using Clojure. I'd be open to contribute in my spare
>> time. What's the process for getting involved?
>>
>> Timothy Baldridge
>>
> On Tue, Mar 27, 2018 at 2:03 PM, Larry Christensen 
>> wrote:
>>
> I have a Dungeons & Dragons app built in Clojure and ClojureScript. With The
>>> Original OrcPub  and The New OrcPub
>>>  I have about 300K monthly users and have been
>>> used by millions of people over the past few years. I'm looking for people
>>> who might want to contribute to building some cool features for a fun app!
>>>
>>> -Larry Christensen a.k.a RedOrc
>>> Supreme Leader
>>> OrcPub
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>>
>> To post to this group, send email to clo...@googlegroups.com
>>
>>
>>> Note that posts from new members are moderated - please be patient with
>>> your first post.
>>> To unsubscribe from this group, send email to
>>>
>> clojure+u...@googlegroups.com
>>
>>
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>>
>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to clojure+u...@googlegroups.com.
>>
>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> “One of the main causes of the fall of the Roman Empire was that–lacking
>> zero–they had no way to indicate successful termination of their C
>> programs.”
>> (Robert Firth)
>>
> --
> You 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.


clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom

2018-04-03 Thread Renata Soares
Good Night,

I have this function:

(defn treat-requests [key-request collection]
(let [selecteds (filter #((keyword key-request) %) input)]
(doseq [item selecteds]
(swap! collection conj item

where input is an output of clojure.data.json/read-str and swap is giving 
this following error:

clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom

How can I solve it?

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.


Re: clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom

2018-04-03 Thread 'André' via Clojure
|collection| probably isn’t an atom. Do you have a fully working snippet?

On 04/03/2018 08:24 PM, Renata Soares wrote:

> Good Night,
>
> I have this function:
>
> (defn treat-requests [key-request collection]
> (let [selecteds (filter #((keyword key-request) %) input)]
> (doseq [item selecteds]
>    (swap! collection conj item
>
> where input is an output of clojure.data.json/read-str and swap is
> giving this following error:
>
> clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom
>
> How can I solve it?
>
> 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: clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom

2018-04-03 Thread Base
Swap requires an atom as an input. 

https://clojuredocs.org/clojure.core/swap!

If you are trying to perform swap! on a collection that was just read from 
json/read-str then it is probably not an atom, and you would need to 
convert it to an atom before doing this. 

However, generally there are specific use cases where you would want to use 
an atom (concurrency), but most of the time you would just want to use a 
regular data structure unless concurrency is an issue with what you are 
doing with the data. 

Read this as well.

https://clojure.org/reference/atoms

On Tuesday, April 3, 2018 at 6:24:27 PM UTC-5, Renata Soares wrote:
>
> Good Night,
>
> I have this function:
>
> (defn treat-requests [key-request collection]
> (let [selecteds (filter #((keyword key-request) %) input)]
> (doseq [item selecteds]
> (swap! collection conj item
>
> where input is an output of clojure.data.json/read-str and swap is giving 
> this following error:
>
> clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom
>
> How can I solve it?
>
> 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.


Re: clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom

2018-04-03 Thread Renata Soares
I was passing as a parameter with @ before... it worked when i passed just 
the atom name. Thanks.

Em terça-feira, 3 de abril de 2018 20:36:58 UTC-3, André escreveu:
>
> collection probably isn’t an atom. Do you have a fully working snippet?
>
> On 04/03/2018 08:24 PM, Renata Soares wrote:
>
> Good Night,
>
> I have this function:
>
> (defn treat-requests [key-request collection]
> (let [selecteds (filter #((keyword key-request) %) input)]
> (doseq [item selecteds]
> (swap! collection conj item
>
> where input is an output of clojure.data.json/read-str and swap is giving 
> this following error:
>
> clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom
>
> How can I solve it?
>
> 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 clo...@googlegroups.com 
> Note that posts from new members are moderated - please be patient with 
> your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com 
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+u...@googlegroups.com .
> For more options, visit https://groups.google.com/d/optout.
>
> ​
>

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


Re: clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom

2018-04-03 Thread Renata Soares
Thanks for the tips!

Em terça-feira, 3 de abril de 2018 20:39:25 UTC-3, Base escreveu:
>
> Swap requires an atom as an input. 
>
> https://clojuredocs.org/clojure.core/swap!
>
> If you are trying to perform swap! on a collection that was just read from 
> json/read-str then it is probably not an atom, and you would need to 
> convert it to an atom before doing this. 
>
> However, generally there are specific use cases where you would want to 
> use an atom (concurrency), but most of the time you would just want to use 
> a regular data structure unless concurrency is an issue with what you are 
> doing with the data. 
>
> Read this as well.
>
> https://clojure.org/reference/atoms
>
> On Tuesday, April 3, 2018 at 6:24:27 PM UTC-5, Renata Soares wrote:
>>
>> Good Night,
>>
>> I have this function:
>>
>> (defn treat-requests [key-request collection]
>> (let [selecteds (filter #((keyword key-request) %) input)]
>> (doseq [item selecteds]
>> (swap! collection conj item
>>
>> where input is an output of clojure.data.json/read-str and swap is giving 
>> this following error:
>>
>> clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom
>>
>> How can I solve it?
>>
>> 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.


Re: clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom

2018-04-03 Thread Timothy Baldridge
I think you're calling `deref` on the collection before passing it in? What
it's saying is that `swap!` expects an atom and you handed it a vector. So
either pass in the atom, or return a updated collection by replacing the
call to `swap!` and the `doseq` with `(into collection selecteds)`

On Tue, Apr 3, 2018 at 5:24 PM, Renata Soares 
wrote:

> Good Night,
>
> I have this function:
>
> (defn treat-requests [key-request collection]
> (let [selecteds (filter #((keyword key-request) %) input)]
> (doseq [item selecteds]
> (swap! collection conj item
>
> where input is an output of clojure.data.json/read-str and swap is giving
> this following error:
>
> clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom
>
> How can I solve it?
>
> 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.
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
You 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: Anyone spent time with Kawa Scheme?

2018-04-03 Thread 'André' via Clojure
They maybe relevant too:

https://www.youtube.com/watch?v=2V1FtfBDsLU, around 1h4min


On 04/03/2018 05:29 PM, 'André' via Clojure wrote:
>
> Rich has covered some of the motivation of why not extending existing
> Lisp->Java integrations, like Kawa and ABCL:
>
> https://www.youtube.com/watch?v=cPNkH-7PRTk, around 3:25
>
>
> On 04/02/2018 05:53 PM, 'somewhat-functional-programmer' via Clojure
> wrote:
>> I've recently come across Kawa Scheme and am very intrigued by it. 
>> It's Java integration is superb like Clojure and it's very fast.  Has
>> anyone here used it to build something?
>>
>> So far I've only tried it with small toy programs.  Things I like
>> about it:
>>   - Starts up very quickly
>>   - Java method notation lends itself to auto-complete
>>  (instance:method param1 param2)
>>   - Can pre-compile and use it on Android
>>   - Repl has line numbers so compilation errors on repl forms have
>> source lines
>>
>> Maybe Kawa fits into a niche that Clojure leaves open with its
>> heavier runtime?  Maybe I'm just trying toy programs and those toy
>> programs are fast? :-)
>>
>> One thing that intrigues me here though since java integration is so
>> easy with Kawa is the notion of using Clojure's immutable data
>> structures from Kawa -- maybe even making a clojure "core" library
>> for use from Kawa.
>>
>> -lc
>>
>> -- 
>> You 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: Anyone spent time with Kawa Scheme?

2018-04-03 Thread 'somewhat-functional-programmer' via Clojure
Thank you for posting these video links along with the time markers.  I thought 
I'd enjoyed all of Rich Hickey's presentations before but I actually hadn't 
seen his "Clojure for Lisp Programmers".  Clojure is the only lisp I "know" 
(still relatively a beginner) but have been fortunate enough to use full-time 
for the last few years -- given my Java background, I naturally had started 
with his "Clojure for Java Programmers".

I did not intend to suggest that Clojure should have been a library to a Scheme 
or Common Lisp.  I love the language as it is and not having a prior lisp 
background, absolutely appreciated watching the "Clojure for Lisp Programmers" 
(as now having some lisp experience, I could more fully appreciate some of 
Clojure's roots).  I've dabbled with toy programs in both ABCL/SBCL as well as 
Kawa mostly out of curiosity.

My reasons for asking my questions about other people's use of Kawa is that the 
performance characteristics of its runtime made me think maybe it may be 
applicable to some areas where Clojure may be a tougher choice (Android, CLI 
utilities).  I think Clojure startup time correlates with how many vars 
defined, and startup time of my projects increases with var counts.  I'm 
curious if any more thought has gone into this topic on the wiki: 
https://dev.clojure.org/pages/viewpage.action?pageId=950293.

I can't give up writing software in an immutable/functional style after using 
Clojure for a couple of years, and was starting to think about what a program 
using Kawa could look like using Clojure's immutable data structures and STM.

What I've settled into doing for using Clojure for CLI utilities thus far has 
been to just leave an instance running a socket repl on my machine always 
running and connect to it via rlwrap and socat (only using it interactively 
though):

rlwrap  socat STDIN TCP4:localhost:

Anyhow, thanks again for the video link, always a treat to watch a Rich Hickey 
Clojure talk that I hadn't seen before.

‐‐‐ Original Message ‐‐‐
On April 4, 2018 3:23 AM, 'André' via Clojure  wrote:

> They maybe relevant too:
>
> https://www.youtube.com/watch?v=2V1FtfBDsLU, around 1h4min
>
> On 04/03/2018 05:29 PM, 'André' via Clojure wrote:
>
>> Rich has covered some of the motivation of why not extending existing 
>> Lisp->Java integrations, like Kawa and ABCL:
>>
>> https://www.youtube.com/watch?v=cPNkH-7PRTk, around 3:25
>>
>> On 04/02/2018 05:53 PM, 'somewhat-functional-programmer' via Clojure wrote:
>>
>>> I've recently come across Kawa Scheme and am very intrigued by it.  It's 
>>> Java integration is superb like Clojure and it's very fast.  Has anyone 
>>> here used it to build something?
>>>
>>> So far I've only tried it with small toy programs.  Things I like about it:
>>>   - Starts up very quickly
>>>   - Java method notation lends itself to auto-complete
>>>  (instance:method param1 param2)
>>>   - Can pre-compile and use it on Android
>>>   - Repl has line numbers so compilation errors on repl forms have source 
>>> lines
>>>
>>> Maybe Kawa fits into a niche that Clojure leaves open with its heavier 
>>> runtime?  Maybe I'm just trying toy programs and those toy programs are 
>>> fast? :-)
>>>
>>> One thing that intrigues me here though since java integration is so easy 
>>> with Kawa is the notion of using Clojure's immutable data structures from 
>>> Kawa -- maybe even making a clojure "core" library for use from Kawa.
>>>
>>> -lc
>>>
>>> --
>>> You 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 messag