[ANN] Logic WorkBench lwb Rev 2.0.0

2019-05-19 Thread 'Burt' via Clojure
A new version of the logic workbench with a component for combinatory logic, 
together with a ton of examples. See https://github.com/esb-lwb/lwb/wiki.

Burt

-- 
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/fc49cf0e-2970-4a70-901a-6664628e853a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: macroexpand in uberjar

2018-02-15 Thread 'Burt' via Clojure
Thanks Nicola and Justin,

syntax quote works, if the call of the macro is explicitely given in the 
code.
In the real situation, whereI had the problem, the form which contains the 
macro call is generated on the fly by a function.

But your hint helps nethertheless:
I bind the namespace to that in which the macro is defined:

(ns m
  (:gen-class))

(defmacro mx
  [x]
  (list 'y))

(defn -main []
  (binding[*ns* (find-ns 'm)]
(println (macroexpand-1 `(mx P
  (println (macroexpand-1 '(and P Q

 

Am Donnerstag, 15. Februar 2018 12:52:39 UTC+1 schrieb Justin Smith:
>
> To elaborate on Nicola's correct answer, when -main is run from outside 
> its namespace, the binding of mx comes from the current environment (which 
> doesn't see a macro, and likely has no binding for mx). If you use ` in 
> -main, the currently visible binding is properly namespace qualified so 
> that it expands when called from outside the namespace.
>
> On Thu, Feb 15, 2018, 03:12 Nicola Mometto <brob...@gmail.com 
> > wrote:
>
>> Use ` instead of '
>>
>>
>> On 15 Feb 2018, at 08:45, 'Burt' via Clojure <clo...@googlegroups.com 
>> > wrote:
>>
>> Here is something strange, and I don't see why!
>> Can anybody help?
>>
>> This is the code in m.clj
>>
>> (ns m
>>   (:gen-class))
>>
>> (defmacro mx
>>   [x]
>>   (list 'y))
>>
>> (defn -main []
>>   (println (macroexpand-1 '(mx P)))
>>   (println (macroexpand-1 '(and P Q
>>
>>
>> 1 When i load the namespace into a REPL and invoke (-main)
>>
>> the result is (as expected):
>>
>>
>> (y)
>> (clojure.core/let [and__5236__auto__ P] (if and__5236__auto__ 
>> (clojure.core/and Q) and__5236__auto__))
>> => nil
>>
>>
>> 2 When I make an uberjar with leiningen (in IntelliJ with cursive) and run 
>> the jar
>>
>> the result is (not as expected):
>>
>>
>> (mx P)
>> (clojure.core/let [and__5236__auto__ P] (if and__5236__auto__ 
>> (clojure.core/and Q) and__5236__auto__))
>>
>>
>> In the second case the macro mx is not expanded and I have no idea why this 
>> is the case.
>>
>>
>> Kind regards,
>>
>> Burt
>>
>>
>> -- 
>> 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 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.


macroexpand in uberjar

2018-02-15 Thread 'Burt' via Clojure
Here is something strange, and I don't see why!
Can anybody help?

This is the code in m.clj

(ns m
  (:gen-class))

(defmacro mx
  [x]
  (list 'y))

(defn -main []
  (println (macroexpand-1 '(mx P)))
  (println (macroexpand-1 '(and P Q


1 When i load the namespace into a REPL and invoke (-main)

the result is (as expected):


(y)
(clojure.core/let [and__5236__auto__ P] (if and__5236__auto__ (clojure.core/and 
Q) and__5236__auto__))
=> nil


2 When I make an uberjar with leiningen (in IntelliJ with cursive) and run the 
jar

the result is (not as expected):


(mx P)
(clojure.core/let [and__5236__auto__ P] (if and__5236__auto__ (clojure.core/and 
Q) and__5236__auto__))


In the second case the macro mx is not expanded and I have no idea why this is 
the case.


Kind regards,

Burt

-- 
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] Logic Workbench lwb Rev1.0.1

2018-01-31 Thread 'Burt' via Clojure
The Logic Workbench lwb is a box of tools for the propositional logic, 
predicate logic, and linear temporal logic.
It's a playground.

More about lwb: Intro .

Comments welcome

--
Burkhardt Renz
THM (Technische Hochschule Mittelhessen) 

-- 
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 object in eval

2017-03-30 Thread 'Burt' via Clojure
Hi Dennis,

when I quote the whole vector for let, the function that defines the symbol 
D is called
while evaluating the eval form.

But in the context I want to use the object bound to the symbol, the object 
has to be
generated outside of eval and just be used in eval replacing the symbol D 
in f.

Burt

Am Donnerstag, 30. März 2017 10:09:20 UTC+2 schrieb dennis:
>
> You should quote the binding vector:
>
> (let [v '[D (LocalDate/of 2017 03 30)]
>   f '(.getYear D)]
>   (eval `(let ~v ~f)))
>
>
>
> 2017-03-30 16:04 GMT+08:00 'Burt' via Clojure <clo...@googlegroups.com 
> >:
>
>> Hi,
>>
>> I want to pass Java objects to a piece of code via let and then get it 
>> evaluated with eval.
>>
>> An minimal example:
>>
>> (ns eval
>>   (:import (java.time LocalDate)))
>>
>> (let [v ['S (String. "ab")]
>>   f '(.length S)]
>>   (eval `(let ~v ~f)))
>>
>> ; => 2
>>
>> (let [v ['D (LocalDate/of 2017 03 30)]
>>   f '(.getYear D)]
>>   (eval `(let ~v ~f
>>
>> ; => CompilerException java.lang.RuntimeException: Can't embed object in 
>> code, maybe print-dup not defined: 2017-03-30
>>
>>
>> The first example with String works fine and is what I want to do.
>>
>>
>> But if I transfer the example to other Java classes, for example LocalDate I 
>> get an error, see the second example.
>>
>>
>> Can anybody help?
>>
>>
>> Kind regards,
>>
>> Burt
>>
>> -- 
>> 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.
>>
>
>
>
> -- 
> 庄晓丹 
> Email:killm...@gmail.com  xzh...@avos.com 
> 
> Site:   http://fnil.net
> Twitter:  @killme2008
>
>
>

-- 
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.


Java object in eval

2017-03-30 Thread 'Burt' via Clojure
Hi,

I want to pass Java objects to a piece of code via let and then get it 
evaluated with eval.

An minimal example:

(ns eval
  (:import (java.time LocalDate)))

(let [v ['S (String. "ab")]
  f '(.length S)]
  (eval `(let ~v ~f)))

; => 2

(let [v ['D (LocalDate/of 2017 03 30)]
  f '(.getYear D)]
  (eval `(let ~v ~f

; => CompilerException java.lang.RuntimeException: Can't embed object in code, 
maybe print-dup not defined: 2017-03-30


The first example with String works fine and is what I want to do.


But if I transfer the example to other Java classes, for example LocalDate I 
get an error, see the second example.


Can anybody help?


Kind regards,

Burt

-- 
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.


core.logic with 1.9.0-alpha12

2016-09-13 Thread 'Burt' via Clojure
Hi,

with "1.9.0-alpha10" and core.logic "0.8.10":

(ns lwb.nd.rules
  (:refer-clojure :exclude [==])
  (:require [clojure.core.logic :refer :all]))
=> nil

with "1.9.0-alpha12" and core.logic "0.8.10":

(ns lwb.nd.rules
  (:refer-clojure :exclude [==])
  (:require [clojure.core.logic :refer :all]))
CompilerException clojure.lang.ExceptionInfo: Call to clojure.core/fn did 
not conform to spec:
In: [0] val: clojure.core.logic/-inc fails spec: 
:clojure.core.specs/arg-list at: [:args :bs :arity-1 :args] predicate: 
vector?
In: [0] val: clojure.core.logic/-inc fails spec: 
:clojure.core.specs/args+body at: [:args :bs :arity-n] predicate: (cat 
:args :clojure.core.specs/arg-list :prepost (? map?) :body (* any?))
:clojure.spec/args  (clojure.core.logic/-inc [] (bind (this) g))
 #:clojure.spec{:problems ({:path [:args :bs :arity-1 :args], :pred 
vector?, :val clojure.core.logic/-inc, :via [:clojure.core.specs/args+body 
:clojure.core.specs/arg-list :clojure.core.specs/arg-list], :in [0]} {:path 
[:args :bs :arity-n], :pred (cat :args :clojure.core.specs/arg-list 
:prepost (? map?) :body (* any?)), :val clojure.core.logic/-inc, :via 
[:clojure.core.specs/args+body :clojure.core.specs/args+body], :in [0]}), 
:args (clojure.core.logic/-inc [] (bind (this) g))}, 
compiling:(clojure/core/logic.clj:1130:5) 

Is there already a fix for this?

Kind regards,
Burt

-- 
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 restrict the number of test with stest/check

2016-08-03 Thread 'Burt' via Clojure
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.


How to restrict the number of test with stest/check

2016-08-03 Thread 'Burt' via Clojure
Hi,

(stest/check `myfunc) runs very, very long

so i tried

(stest/check `myfunc {:num-tests 2})

but unfortunately that does not restrict the number of test.

Can anybody help?

Kind regards, Burt

-- 
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.