Re: if nil is true

2017-01-29 Thread 'Alan Forrester' via Clojure
On 30 Jan 2017, at 07:34, Sayth Renshaw  wrote:

> Hi
> 
> If nil is true 
> 
> clojure-noob.core> (nil? nil)
> true
> 
> Then why doesn't nil return from this statement as the first true value?

This expression is a function invocation. The function is the first item in the 
list and the argument is the second. So this expression asks if nil is nil, 
which is true.

I cut the rest of your examples since they make similar mistakes. You don’t 
understand clojure very well, you may want to read the docs:

https://clojure.org/reference/reader

This isn’t an attack, just a statement of fact.

Alan

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


if nil is true

2017-01-29 Thread Sayth Renshaw
Hi

If nil is true 

clojure-noob.core> (nil? nil)
true

Then why doesn't nil return from this statement as the first true value?

clojure-noob.core> (or false nil true)
true

Sausages does as expected.

clojure-noob.core> (or false "sausages" true)
"sausages"

Thanks

Sayth

-- 
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: A more mathematical kind of set object in clojure

2017-01-29 Thread Herwig Hochleitner
2017-01-29 21:15 GMT+01:00 Michael Lindon :

> Not quite what I'm looking for. There is an assigment in the Functional
> Programming in Scala coursera course called "funsets" - purely functional
> sets. A set is defined by its characteristic functions (a predicate) and
> source code can be found here
>

Looking at it from a functional perspective, it still might be though.
Consider: You can treat any set as a predicate, but to treat a predicate as
a set, you need to add enumeration (as Christian hinted).

https://mwclearning.com/sourcecode/scala/funsets/src/
> main/scala/funsets/FunSets.scala
>

The enumeration scheme in this scala object is very simplistic: It works
for integers between -1000 and 1000. Besides being incomplete, this can
easily lead to unnecessarily exponential runtimes:

> /**
>  * The bounds for `forall` and `exists` are +/- 1000.
>  */
> val bound = 1000

> /**
>  * Returns whether all bounded integers within `s` satisfy `p`.
>  */
> def forall(s: Set, p: Int => Boolean): Boolean = {
>   val filteredSet = filter(s, p)
>   def iter(a: Int): Boolean = {
> if (contains(s, a) && !contains(filteredSet, a)) false
> else if (a > bound) true
> else iter(a + 1)
>   }
>   iter(-bound)
> }

> /**
>  * Returns whether there exists a bounded integer within `s`
>  * that satisfies `p`.
>  */
> def exists(s: Set, p: Int => Boolean): Boolean = forall(s, union(s,p))

Constraint programming offers a much more sophisticated approach
towards enumeration, eagerly skipping whole subsets based on excluded
ranges. Maybe that's what the coursera is aiming for ...

-- 
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: newbie trying to mod a clojure based game

2017-01-29 Thread James Reeves
If you have Leiningen installed, then run:

lein cljsbuild once

The compiled Javascript will be in target/app.js

Admittedly this isn't very obvious to beginners unless you happen to guess
what the cljsbuild plugin does.

- James

On 29 January 2017 at 23:45, James Thorne  wrote:

> I'm trying to mod a game called epitaph from github
> https://github.com/mkremins/epitaph
>
> The cljs files inside the src are easy enough to understand and I
> foolishly thought modding those were all that was needed.
> I signed up to github, forked and modded, found out this task was not so
> simple, abandoned the github and moved the modded files to my pc (when I
> figure this out I'll return to github)
> I now understand those files need to be compiled into javascript which is
> what the index file actually uses, part of the AOT compiling.
> I did the quickstart https://github.com/clojure/
> clojurescript/wiki/Quick-Start and figured out how to compile something
> basic,
> However since this was done in leiningen, I had to install that but still
> don't know how to compile using that (the tutorial talks about how to build
> a project.clj file but not how to actually use one for AOT compiling).
> I still don't know how to get the epitaph project.clj file to do it's
> thing and compile the pretty src files into ugly javascript
>
> So if anyone here is kind enough to help a utter novice out by showing how
> to use leiningen to compile the files for the epitaph game I would be very
> happy.
>
> --
> 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.


newbie trying to mod a clojure based game

2017-01-29 Thread James Thorne
I'm trying to mod a game called epitaph from github 
https://github.com/mkremins/epitaph

The cljs files inside the src are easy enough to understand and I foolishly 
thought modding those were all that was needed.
I signed up to github, forked and modded, found out this task was not so 
simple, abandoned the github and moved the modded files to my pc (when I 
figure this out I'll return to github)
I now understand those files need to be compiled into javascript which is 
what the index file actually uses, part of the AOT compiling.
I did the quickstart 
https://github.com/clojure/clojurescript/wiki/Quick-Start and figured out 
how to compile something basic,
However since this was done in leiningen, I had to install that but still 
don't know how to compile using that (the tutorial talks about how to build 
a project.clj file but not how to actually use one for AOT compiling).
I still don't know how to get the epitaph project.clj file to do it's thing 
and compile the pretty src files into ugly javascript

So if anyone here is kind enough to help a utter novice out by showing how 
to use leiningen to compile the files for the epitaph game I would be very 
happy.

-- 
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] trapperkeeper 1.4.1

2017-01-29 Thread Timothy Washington
Is trapperkeeper still actively being developed and maintained? I'm having
trouble using trapperkeeper with the core specs in Clojure 1.9. And these
are the last 2 substantive commits that I see.

   - Dec 8 2016
   

   - Oct 19 2016
   



Is this something we can still use and build on, for our underlying
services?


Thanks
Tim


On Mon, May 23, 2016 at 4:22 PM, Joe Pinsonault 
wrote:

> Today we released puppetlabs/trapperkeeper v1.4.1 to clojars.
>
> There is a single bugfix in this release: TK-375
> .
>
> TK-375 resolves startup issues for users that use a bootstrap.cfg inside
> their project's jar file.
>
> For more info see the CHANGELOG and docs
>
> CHANGELOG: https://github.com/puppetlabs/trapperkeeper/blob/
> master/CHANGELOG.md#140
> Trapperkeeper github wiki: https://github.com/puppetlabs/trapperkeeper
> /wiki
>
> --
> 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: A more mathematical kind of set object in clojure

2017-01-29 Thread Christian Weilbach
Am 29.01.2017 um 21:15 schrieb Michael Lindon:
> Not quite what I'm looking for. There is an assigment in the Functional
> Programming in Scala coursera course called "funsets" - purely
> functional sets. A set is defined by its characteristic functions (a
> predicate) and source code can be found here
> 
> https://mwclearning.com/sourcecode/scala/funsets/src/main/scala/funsets/FunSets.scala
> 
> this is the sort of thing I am looking for.

What do you expect exactly from such an implementation? The definition
by the characteristic function might make elements of a set in theory
computably enumerable, but it is not practical to get a materialized
view. You can only query membership. Maybe if you can create a
persistent datastructure over characteristic functions you can actually
compose such a datastructure, but in fact you just compose predicates
(as is also done in FunSets.scala) and reify them as a type there.
If you just want such an implementation to fulfill part of Clojure's
contracts for sets, you would implement the corresponding interface:
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/IPersistentSet.java

But you would have to throw on some of these methods and I am not sure
what the benefits are. You can always create new interfaces (protocols)
ofc. Do you have a concrete problem in mind?

Best,
Christian



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


signature.asc
Description: OpenPGP digital signature


Re: A more mathematical kind of set object in clojure

2017-01-29 Thread Michael Lindon
Not quite what I'm looking for. There is an assigment in the Functional 
Programming in Scala coursera course called "funsets" - purely functional 
sets. A set is defined by its characteristic functions (a predicate) and 
source code can be found here 

https://mwclearning.com/sourcecode/scala/funsets/src/main/scala/funsets/FunSets.scala

this is the sort of thing I am looking for.

On Saturday, January 28, 2017 at 5:06:49 PM UTC-5, Herwig Hochleitner wrote:
>
> core.logic's CLP(FD) extensions, for finite domains, might also suit your 
> needs: https://github.com/clojure/core.logic/wiki/Features#clpfd​
>

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