Re: How to coerce to bigint ?

2015-04-04 Thread Jens Bendisposto
Just for the records You can still use auto-promotion with primed 
operators like *', +' etc. 

=> (* 10 100)

java.lang.ArithmeticException: integer overflow

=> (*' 10 100)

1000N


-- 
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.7.0-alpha6 released

2015-04-04 Thread Alex Miller
Yes, I'll get that in the next release, I forgot to put it in there...

On Saturday, April 4, 2015 at 6:45:07 PM UTC-5, Andy Fingerhut wrote:
>
> I believe that change is due to this commit from early March 2015: 
> https://github.com/clojure/clojure/commit/692645c73c86d12c93a97c858dc6e8b0f4280a0b
>
> Nicola Mometto had opened a ticket CLJ-1593 for this issue: 
> http://dev.clojure.org/jira/browse/CLJ-1593
> The commit did not reference the ticket, but Nicola noticed the commit and 
> closed the ticket due to that commit.
>
> Alex, would it be appropriate to include a reference to CLJ-1593 in the 
> Clojure 1.7 release notes?
>
> Andy
>
> On Sat, Apr 4, 2015 at 7:57 AM, Ian Rumford  > wrote:
>
>> Hi Alex, All,
>>
>> An observation really.
>>
>> I've just noticed that a literal map e.g. (def m {:a 1 :b 2 :c 3}) in 
>> alpha6 is an array map not hash map.  
>>
>> In 1.6.0 and 1.7.0-alpha5  its a hash map.
>>
>> Couldn't find any obvious statement in the release notes but interested 
>> in the background to the change.
>>
>

-- 
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] avi 0.1.6 (searching)

2015-04-04 Thread Jason Felice
In this version:

* Fix for `O` on a blank line (Thanks to Anthony Garreffa!)
* Command history for the `:` prompt (using ^N, ^P)
* Implement `/`, `?`, `n`, `N`
* Refactored to compose most of the editor in a middleware pattern

avi

A lively vi.
Vision

We love vim. We want more! Test coverage. Flexibilty. Live REPLs!
Guiding Principles

   - Test driven. All functionality covered by tests.
   - Don't defeat vim muscle memory.
   - Code is for people. Be expressive as hell.
   - Be friendly. Especially to noobs.

Contributing

We track upcoming work on a Trello board .
This board has many small things that are easy to pick up, and we'd love to
see you.

I (Jason Felice) would love to walk through the code with you pretty much
any time during the US Eastern work day. Ping me any time on Twitter - I'm
@eraserhd  - or gchat.
Status

Our intention is for the unit tests to provide friendly documention of
what's been implemented so far. To run the unit tests with verbose output,
use

$ lein midje :print-facts

Installing

   - Works with Leiningen 2.3.4
   - On Linux, ncurses-dev or curses-dev or equivalent must be installed.

$ git clone https://github.com/maitria/avi.git
$ cd avi
$ lein install

On Linux, you'll likely not have access to /usr/local. In that case you'll
need to use sudo lein install instead.
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 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 question about filtrering defrecord

2015-04-04 Thread Paul L. Snyder
On Sun, 05 Apr 2015, Michael Blume wrote:

> your list doesn't contain the records, your list contains the symbols 'a1
> and 'a2. You can't make a list the way you're trying to.

To be specific, you're quoting the list in your def, so the a1 and a2 symbols 
are
not evaluated.

  user=> (defrecord Ape [fname lname])
  user.Ape
  user=> (def a1 (->Ape "test1" "test2"))
  #'user/a1
  user=> (def a2 (->Ape "test3" "test4"))
  #'user/a2

  user=> '(a1 a2)
  (a1 a2)
  user=> (quote (a1 a2))
  (a1 a2)
  user=> (list a1 a2)
  (#user.Ape{:fname "test1", :lname "test2"} #user.Ape{:fname "test3", :lname 
"test4"})

  user=> (def alist (list a1 a2))
  #'user/alist
  user=> (filter #(= "test1" (:fname %)) alist)
  (#user.Ape{:fname "test1", :lname "test2"})

  ;; Clojure idioms tend toward vectors and vector literals rather than
  ;; lists. If you have a background in Common Lisp or Scheme, this can
  ;; take some getting used to. One nice consequence is you don't have
  ;; to worry about quoting most of the time.
  user=> (filter #(= "test1" (:fname %)) [a1 a2])
  (#user.Ape{:fname "test1", :lname "test2"})

Cheers,
Paul

-- 
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 question about filtrering defrecord

2015-04-04 Thread Michael Blume
your list doesn't contain the records, your list contains the symbols 'a1
and 'a2. You can't make a list the way you're trying to.

On Sat, Apr 4, 2015 at 5:14 PM Luc Préfontaine 
wrote:

> You mean the a1 record no ?
>
>
> > Hi!
> >
> > I'm new to clojure, and have problem understanding how to filter a list
> of
> > defrecords.
> > I have tried different variations on the following:
> >
> > (defrecord Ape [fname lname])
> > (def a1 (->Ape "test1" "test2"))
> > (def a2 (->Ape "test3" "test4"))
> > (def alist '(a1 a2))
> >
> > (filter #(= "test1" (:fname %)) alist)
> >
> > I expect the filter to match the a2 record, but I obviously do something
> > wrong and would appreciate any suggestion.
> >
> > Kind regards
> > Magnus Jäverberg
> >
> > --
> > 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.
> >
> --
> Luc Préfontaine sent by ibisMail!
>
> --
> 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: Newbie question about filtrering defrecord

2015-04-04 Thread Luc Préfontaine
You mean the a1 record no ?


> Hi!
> 
> I'm new to clojure, and have problem understanding how to filter a list of 
> defrecords. 
> I have tried different variations on the following:
> 
> (defrecord Ape [fname lname])
> (def a1 (->Ape "test1" "test2"))
> (def a2 (->Ape "test3" "test4"))
> (def alist '(a1 a2))
> 
> (filter #(= "test1" (:fname %)) alist)
> 
> I expect the filter to match the a2 record, but I obviously do something 
> wrong and would appreciate any suggestion.
> 
> Kind regards
> Magnus Jäverberg
> 
> -- 
> 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.
> 
--
Luc Préfontaine sent by ibisMail!

-- 
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.7.0-alpha6 released

2015-04-04 Thread Andy Fingerhut
I believe that change is due to this commit from early March 2015:
https://github.com/clojure/clojure/commit/692645c73c86d12c93a97c858dc6e8b0f4280a0b

Nicola Mometto had opened a ticket CLJ-1593 for this issue:
http://dev.clojure.org/jira/browse/CLJ-1593
The commit did not reference the ticket, but Nicola noticed the commit and
closed the ticket due to that commit.

Alex, would it be appropriate to include a reference to CLJ-1593 in the
Clojure 1.7 release notes?

Andy

On Sat, Apr 4, 2015 at 7:57 AM, Ian Rumford  wrote:

> Hi Alex, All,
>
> An observation really.
>
> I've just noticed that a literal map e.g. (def m {:a 1 :b 2 :c 3}) in
> alpha6 is an array map not hash map.
>
> In 1.6.0 and 1.7.0-alpha5  its a hash map.
>
> Couldn't find any obvious statement in the release notes but interested in
> the background to the change.
>
> --
> 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 question about filtrering defrecord

2015-04-04 Thread Magnus Javerberg
Hi!

I'm new to clojure, and have problem understanding how to filter a list of 
defrecords. 
I have tried different variations on the following:

(defrecord Ape [fname lname])
(def a1 (->Ape "test1" "test2"))
(def a2 (->Ape "test3" "test4"))
(def alist '(a1 a2))

(filter #(= "test1" (:fname %)) alist)

I expect the filter to match the a2 record, but I obviously do something 
wrong and would appreciate any suggestion.

Kind regards
Magnus Jäverberg

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


[JOB] Clojure/Clojurescript Software Engineer - Startup - SF or remote

2015-04-04 Thread Stephen Brady
Hi all,

We're looking for Clojure/Clojurescript engineers (details below).

Please email me directly at step...@getlongitude.com if you're interested 
in learning more.


Stephen

---

Longitude is a San Francisco-based startup that is building a quick and 
easy way for users to create and discover structured and semi-structured 
data on the Web.

*About the environment:*
We are building the core software engineering team and so are looking for 
candidates who are capable of self direction and making sound technology 
and design decisions quickly. This is a great opportunity to really stretch 
your Clojure/Clojurescript skills while building a new product in a startup 
environment.

Our core stack is Clojure, Clojurescript, Om, and Datomic running on AWS.

*About the role:*
This is a generalist role across front end and back end, however an 
interest and/or strengths in the following are particularly relevant:
- Web application / system design
- data visualization
- API design
- data modeling

*Required:*
- 1+ year of Clojure experience
- 4+ years of production software development experience
- strong understanding of core computer science concepts

This is a full-time position. Remote candidates working in a US timezone 
are welcome.

Please email step...@getlongitude.com for details.

-- 
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 coerce to bigint ?

2015-04-04 Thread Paul Roush


On Saturday, April 4, 2015 at 1:00:46 PM UTC-4, Michael Gardner wrote:
>
> On Sat, Apr 4, 2015 at 11:36 AM, Paul Roush  > wrote:
>
>> (range  5N) => (0 1 2 3 4)  ;  i.e. the "bigint-ness" is lost
>>
>> So in this particular case I needed to "inject" bigint into the process 
>> later in some way.
>>
>
> You could try (range (* 0 n) n). A little silly, but does avoid the 
> conditional.
>
> You could consider also creating a JIRA issue asking for range to match 
> the type of its argument in the 1-arity case. No idea whether it would be 
> accepted, though. 
>

Interesting.  My code was actually calling range with 2 args, as I want a 
1-based range.  The 1 was a literal, and to support the non-bigint case I 
don't want to hardwire it to 1N.  Now I see that:

(range 1N 5N) => (1N  2N 3N 4N)
(range 1 5N) => (1 2 3 4)

So I could pass (/ n n ) as my first arg to range and I'll get the desired 
type in all cases.

But this behavior of 'range' now feels quirky to me.

-- 
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 coerce to bigint ?

2015-04-04 Thread Michael Gardner
On Sat, Apr 4, 2015 at 11:36 AM, Paul Roush  wrote:

> (range  5N) => (0 1 2 3 4)  ;  i.e. the "bigint-ness" is lost
>
> So in this particular case I needed to "inject" bigint into the process
> later in some way.
>

You could try (range (* 0 n) n). A little silly, but does avoid the
conditional.

You could consider also creating a JIRA issue asking for range to match the
type of its argument in the 1-arity case. No idea whether it would be
accepted, though.

-- 
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] Phoenix 0.1.0 - help with structuring & configuring Component-based systems

2015-04-04 Thread James Henderson
Just released 0.1.1 - bug when using Schema in Phoenix apps due to 
Phoenix's overly-enthusiastic AOT'ing.

Thanks to @whodidthis for flagging the issue!

James

On Sunday, 29 March 2015 20:44:04 UTC+1, James Henderson wrote:
>
> A link would have been really helpful, I'm guessing! Here it is:
>
> https://github.com/james-henderson/phoenix
>
> James
>
> On Sunday, 29 March 2015 20:42:06 UTC+1, James Henderson wrote:
>>
>> Hi all,
>>
>> I've just released v0.1.0 of Phoenix - a 'batteries included, but 
>> removable' library to wire up and configure Component-based systems. If 
>> you've ever wondered whether you really have to copy and paste 
>> 'system.clj', 'dev.clj' and 'user.clj' from one Component project to the 
>> next, it's well worth having a look at!
>>
>> Having used Phoenix in anger on a few projects for a couple of weeks, 
>> it's now had a fair bit of battle-testing, kinks ironed, and the like - so 
>> thought I'd make another post to the list :)
>>
>> Features added since I last posted:
>>
>>- Many re-usable Components - CLJS compiler, Aleph, http-kit, JDBC 
>>pool, CSS compiler (using Garden) - see 
>>https://github.com/james-henderson/phoenix/tree/master/modules/ for 
>>more details. These components can be used whether or not you choose to 
>> use 
>>Phoenix, and, likewise, non-Phoenix components can be used in 
>>Phoenix-configured systems - hooray for composability :)
>>- Support for managing passwords/credentials - you can store these, 
>>encrypted, in your configuration, and Phoenix will decrypt them for you.
>>- Pulling configuration variables from environment variables and JVM 
>>properties, in addition to the Phoenix config files
>>- 'Batteries removable' API - if you need a little more flexibility, 
>>or want to compose Phoenix with something else.
>>- A fair few bugfixes/API changes through usage
>>
>> There's also a couple of Lein templates to get up and running quickly:
>>
>>-  `lein new phoenix-webapp  -- :reagent` will get you a 
>>working webapp (other options are `:om`, `:om-sablono` or `:flow`). 
>>- If you don't want the CLJS side, `lein new phoenix-api ` 
>>just has an example server-side API.
>>
>> Would be great to get your thoughts and feedback on this - is this a good 
>> way to wire up such systems?
>>
>> Cheers,
>>
>> James
>>
>

-- 
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 coerce to bigint ?

2015-04-04 Thread Paul Roush


On Saturday, April 4, 2015 at 12:09:36 PM UTC-4, Andy Fingerhut wrote:
>
>
>
> On Sat, Apr 4, 2015 at 8:52 AM, Paul Roush 
> > wrote:
>
>> I have 2 questions related to bigints.
>>
>> 1) I've read things suggesting Clojure auto-converts between int, long, 
>> and bigint to prevent overflow.  That isn't the behavior I've experienced.  
>> Did something change from an older release of Clojure to more recent ones?
>>
>
> Clojure 1.2 and earlier auto-promoted, if I recall correctly, but that has 
> not been the case since Clojure 1.3, released in Sep 2011.  You may have 
> found something published before then.
>
> Clojure 1.3 and later do give a bigint result for integer arithmetic if 
> any of the arguments are bigints, e.g. (+ 1N 1) => 2N
>


Thanks for the historical info. 

 
>
>>
>> 2) I found myself wanting to write a function that would use bigint math 
>> vs not depending on whether I passed a bigint in as arg.  Internally I 
>> wanted to "seed" a reduce call with either 1 or 1N as appropriate.  So I 
>> wanted to write something like this (except I'd like it to work):
>>
>> (defn foo [n]
>>   (cast (type n) 1))
>>
>> ; (foo 3) => 1
>> ; (foo 42N) => 1N
>>
>> The following works, but I'd like to understand if I can avoid the 
>> conditional:
>>
>> (defn foo [n]
>>   (if (= clojure.lang.BigInt (type n)) 1N 1))
>>
>
> More commonly I have seen (instance? clojure.lang.BigInt n) rather than (= 
> clojure.lang.BigInt (type n)), but I do not know any way to avoid the 
> conditional here.
>
> I would ask that you consider whether you really do need this check, 
> though, since if your argument is BigInt and is combined with any 
> arithmetic operation with a local long value in the function, the result 
> will be BigInt.
>
> Andy
>

I like your conditional better, so seeing that is welcome.

Regarding the last point, I understand that what you say is generally true, 
but in this specific case my function arg was defining the end of a 'range' 
call that was fed into other logic.

(range  5N) => (0 1 2 3 4)  ;  i.e. the "bigint-ness" is lost

So in this particular case I needed to "inject" bigint into the process 
later in some way.

-- 
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 coerce to bigint ?

2015-04-04 Thread Andy Fingerhut
On Sat, Apr 4, 2015 at 8:52 AM, Paul Roush  wrote:

> I have 2 questions related to bigints.
>
> 1) I've read things suggesting Clojure auto-converts between int, long,
> and bigint to prevent overflow.  That isn't the behavior I've experienced.
> Did something change from an older release of Clojure to more recent ones?
>

Clojure 1.2 and earlier auto-promoted, if I recall correctly, but that has
not been the case since Clojure 1.3, released in Sep 2011.  You may have
found something published before then.

Clojure 1.3 and later do give a bigint result for integer arithmetic if any
of the arguments are bigints, e.g. (+ 1N 1) => 2N


>
> 2) I found myself wanting to write a function that would use bigint math
> vs not depending on whether I passed a bigint in as arg.  Internally I
> wanted to "seed" a reduce call with either 1 or 1N as appropriate.  So I
> wanted to write something like this (except I'd like it to work):
>
> (defn foo [n]
>   (cast (type n) 1))
>
> ; (foo 3) => 1
> ; (foo 42N) => 1N
>
> The following works, but I'd like to understand if I can avoid the
> conditional:
>
> (defn foo [n]
>   (if (= clojure.lang.BigInt (type n)) 1N 1))
>

More commonly I have seen (instance? clojure.lang.BigInt n) rather than (=
clojure.lang.BigInt (type n)), but I do not know any way to avoid the
conditional here.

I would ask that you consider whether you really do need this check,
though, since if your argument is BigInt and is combined with any
arithmetic operation with a local long value in the function, the result
will be BigInt.

Andy

-- 
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 coerce to bigint ?

2015-04-04 Thread Paul Roush
I have 2 questions related to bigints.

1) I've read things suggesting Clojure auto-converts between int, long, and 
bigint to prevent overflow.  That isn't the behavior I've experienced.  Did 
something change from an older release of Clojure to more recent ones?

2) I found myself wanting to write a function that would use bigint math vs 
not depending on whether I passed a bigint in as arg.  Internally I wanted 
to "seed" a reduce call with either 1 or 1N as appropriate.  So I wanted to 
write something like this (except I'd like it to work):

(defn foo [n]
  (cast (type n) 1))

; (foo 3) => 1
; (foo 42N) => 1N

The following works, but I'd like to understand if I can avoid the 
conditional:

(defn foo [n]
  (if (= clojure.lang.BigInt (type n)) 1N 1))

-- 
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.7.0-alpha6 released

2015-04-04 Thread Ian Rumford
Hi Alex, All,

An observation really.

I've just noticed that a literal map e.g. (def m {:a 1 :b 2 :c 3}) in 
alpha6 is an array map not hash map.  

In 1.6.0 and 1.7.0-alpha5  its a hash map.

Couldn't find any obvious statement in the release notes but interested in 
the background to the change.

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


lein checkout dependencies with cljx project

2015-04-04 Thread Colin Yates
Hi,

I have a common library which I want to use in both Clojure and 
ClojureScript. The project uses cljx and works a treat and the generated 
clj and cljs are available to use alongside the hard coded clj and cljs. 

However, when I add that project (after doing the initial lein install) to 
the checkouts directory of another project, that other project cannot see 
the generated cljs.

I am not doing anything special in terms of packaging the generated cljs in 
the common project as I assumed the magic of lein checkouts and cljx would 
handle that for me.

Any suggestions?

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.


Re: I put a site with usable JavaDoc for Clojure.

2015-04-04 Thread Ivan Pierre
Finished... from version 1.0 to 1.7.0-alpha6.

-- 
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: anybody here who use emacs to edit closure? is emacs lisp a good starting point to learn closure?

2015-04-04 Thread Tj Gabbour
Oh, and I'd try to figure out if this theory has any merit: do things like 
paredit and yasnippet help you intuitively think in terms of manipulating 
structure rather than text? Because in Clojure, you're constantly 
transforming and pushing around units of data.

On Saturday, April 4, 2015 at 11:45:10 AM UTC+2, Tj Gabbour wrote:
>
> Hi!
>
> This highly depends on what’s most effective for you. If I were your tutor 
> [1], I’d hear “but i wanna to start from emacs and emacs lisp,” and take 
> that as a strong indicator that this path (first exploring Emacs) might be 
> effective for you. 
>
> Useful to probe more deeply into two threads: your interest in Emacs and 
> interest in Clojure. Why you find these interesting. (For example, do you 
> find Emacs a pleasant, customizable environment to live in?) 
>
> A couple lessons which seem transferable are: a) getting used to 
> parens/brackets as delimiting code/data units, and b) getting used to an 
> environment you can interactively change while it runs. 
>
> But I really don’t know. I've only written small Emacs Lisp programs. 
> (Unlike say Bozhidar, who also responded.)
>
> All the best, 
>Tj 
>
>  [1] I tutor someone in computing, so that’s a common frame of reference. 
> (But it’s limited since I haven’t tutored many. Like a tailor who knows 
> only a few body types.) 
>  
>
> On Saturday, April 4, 2015 at 4:00:03 AM UTC+2, mnz...@gmail.com wrote:
>>
>> i am about to use emas and start to learn emacs lisp, would the study of 
>> emacs lisp help to learn clojure, both of them are lisp dialect, so would 
>> it take a long time to swich from emacs lisp to clojure?
>> i just want to learn clojure, but i wanna to start from emacs and emacs 
>> lisp, is that an effective way to master lisp and the great editor emacs? 
>> or it's better to start from clojure and some other ide directly?
>> need some suggestions and advices:)
>>
>

-- 
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] Baum - Extensible EDSL in EDN for configuration files

2015-04-04 Thread Ryo Fukumuro
Hi all,

I'd like to announce the release of Baum.

https://github.com/rkworks/baum

Baum, my first public library for Clojure, is designed to create
"self-contained" configuration files.

It allows you to include the following things in your configuration files:

 - References to external files
 - References to environment variables with a fallback value
 - Conditional loading of a part of config tree
 - `let`
 - etc

And it is very easy to extend the DSL to add new features.
For more details, please see README.

Any suggestions are welcome.

Best,
Ryo

-- 
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: anybody here who use emacs to edit closure? is emacs lisp a good starting point to learn closure?

2015-04-04 Thread Tj Gabbour
Hi!

This highly depends on what’s most effective for you. If I were your tutor 
[1], I’d hear “but i wanna to start from emacs and emacs lisp,” and take 
that as a strong indicator that this path (first exploring Emacs) might be 
effective for you. 

Useful to probe more deeply into two threads: your interest in Emacs and 
interest in Clojure. Why you find these interesting. (For example, do you 
find Emacs a pleasant, customizable environment to live in?) 

A couple lessons which seem transferable are: a) getting used to 
parens/brackets as delimiting code/data units, and b) getting used to an 
environment you can interactively change while it runs. 

But I really don’t know. I've only written small Emacs Lisp programs. 
(Unlike say Bozhidar, who also responded.)

All the best, 
   Tj 

 [1] I tutor someone in computing, so that’s a common frame of reference. 
(But it’s limited since I haven’t tutored many. Like a tailor who knows 
only a few body types.) 
 

On Saturday, April 4, 2015 at 4:00:03 AM UTC+2, mnz...@gmail.com wrote:
>
> i am about to use emas and start to learn emacs lisp, would the study of 
> emacs lisp help to learn clojure, both of them are lisp dialect, so would 
> it take a long time to swich from emacs lisp to clojure?
> i just want to learn clojure, but i wanna to start from emacs and emacs 
> lisp, is that an effective way to master lisp and the great editor emacs? 
> or it's better to start from clojure and some other ide directly?
> need some suggestions and advices:)
>

-- 
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: anybody here who use emacs to edit closure? is emacs lisp a good starting point to learn closure?

2015-04-04 Thread Bozhidar Batsov
Ops, I meant to say CCW, not CCC. :-)

On 4 April 2015 at 10:43, Laurent PETIT  wrote:

> Please also note that Counterclockwise, the Eclipse plugin for Clojure,
> also comes with all all-inclusive zip archive which makes you as easy to
> start creating a new project as "Download / Unzip / Start":
>
> http://doc.ccw-ide.org/documentation.html#install-as-standalone-product
>
> 2015-04-04 3:54 GMT+02:00 :
>
>> i am about to use emas and start to learn emacs lisp, would the study of
>> emacs lisp help to learn clojure, both of them are lisp dialect, so would
>> it take a long time to swich from emacs lisp to clojure?
>> i just want to learn clojure, but i wanna to start from emacs and emacs
>> lisp, is that an effective way to master lisp and the great editor emacs?
>> or it's better to start from clojure and some other ide directly?
>> need some suggestions and advices:)
>>
>> --
>> 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.
>>
>
>
>
> --
> Laurent Petit
>
> --
> 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: anybody here who use emacs to edit closure? is emacs lisp a good starting point to learn closure?

2015-04-04 Thread Laurent PETIT
Please also note that Counterclockwise, the Eclipse plugin for Clojure,
also comes with all all-inclusive zip archive which makes you as easy to
start creating a new project as "Download / Unzip / Start":

http://doc.ccw-ide.org/documentation.html#install-as-standalone-product

2015-04-04 3:54 GMT+02:00 :

> i am about to use emas and start to learn emacs lisp, would the study of
> emacs lisp help to learn clojure, both of them are lisp dialect, so would
> it take a long time to swich from emacs lisp to clojure?
> i just want to learn clojure, but i wanna to start from emacs and emacs
> lisp, is that an effective way to master lisp and the great editor emacs?
> or it's better to start from clojure and some other ide directly?
> need some suggestions and advices:)
>
> --
> 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.
>



-- 
Laurent Petit

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