Re: unconditional append to end

2014-02-08 Thread mynomoto
Maybe you could use mapv and filterv? This way you will always get a vector and conj apends in the end. On Friday, February 7, 2014 10:20:09 PM UTC-2, t x wrote: Consider the following: (cons 1 '(2 3 4)) == (1 2 3 4) (cons 1 [2 3 4]) == (1 2 3 4) (conj '(a b c) 1) == (1 a b c) (conj

Clojure tutorial for Light Table

2014-02-08 Thread mynomoto
Hello, I ported the Light Table ClojureScript Tutorial [1] by David Nolen to Clojure. Also added sections about refs and agents. You can see it on https://github.com/mynomoto/lt-clojure-tutorial If you find some mistake, typo or want to contribute let me know or open an issue or pull

Re: Alternative - macro for threading sequences?

2014-02-08 Thread t x
I think the problem is as follows: map = 3 characters filter = 6 characters Given that we're doing clojure not apl, to specify the function we're mapping/filtering on, we have to do either: #( ... % ) = 5 characters off the bat or provide the name of the function (atleast 1 english word)

Re: GSoC 2014: org applications now open

2014-02-08 Thread Alex Ott
Hi Avram There is discussion in Incanter's issue about this: https://github.com/liebke/incanter/issues/193 - maybe it would be possible to implement support for different chart backends - like, D3.js, JavaFX, etc. On Sat, Feb 8, 2014 at 12:02 AM, A aael...@gmail.com wrote: A couple ideas

Re: map semantics

2014-02-08 Thread Andy C
On Sat, Feb 8, 2014 at 12:06 AM, Sean Corfield s...@corfield.org wrote: But you're misunderstanding what map does: it converts its collection arguments to _sequences_ and then it processes those sequences. Map doesn't operate on sets, or vectors, or maps, only on sequences. Your assertion

Re: map semantics

2014-02-08 Thread Jozef Wagner
Every persistent collection in Clojure supports conversion to the sequence of items. This is clearly documented in the official docs and there is no surprise here. The order or items in the resulting sequence is dependent on the collection type. As the conversion to the sequence is a

a problem about Redis client: com.taoensso/carmine

2014-02-08 Thread tao
lein try com.taoensso/carmine ;; try is from https://github.com/rkneufeld/lein-try (def server-connection {:pool {:max-active 8} :spec {:host localhost :port 6379 :timeout 4000}})

Re: map semantics

2014-02-08 Thread Andy C
Every persistent collection in Clojure supports conversion to the sequence of items. This is clearly documented in the official docs and there is no surprise here. Would you mind to point me to that piece where doc describes what order seq chooses when converting a set to it. (I honestly tried to

Re: a problem about Redis client: com.taoensso/carmine

2014-02-08 Thread tao
Repost: fix some quotation mark problem in the code. lein try com.taoensso/carmine ;; try is from https://github.com/rkneufeld/lein-try (def server-connection {:pool {:max-active 8} :spec {:host localhost :port 6379

Re: partial function revisited (exercise in macros)

2014-02-08 Thread juan.facorro
When you use *`~p* what you are actually doing is using the symbol of the predicate as a function. For example if you call *(partial-pbm f symbol? 1 x 3)*, the quote-unquote (`~) will return the symbol *symbol?* which is not what you want. What you can do is use the *resolve

Re: map semantics

2014-02-08 Thread Ambrose Bonnaire-Sergeant
On Sun, Feb 9, 2014 at 12:40 AM, Andy C andy.coolw...@gmail.com wrote: Every persistent collection in Clojure supports conversion to the sequence of items. This is clearly documented in the official docs and there is no surprise here. Would you mind to point me to that piece where doc

Re: a problem about Redis client: com.taoensso/carmine

2014-02-08 Thread mynomoto
You can use: (into {} (map (fn [[k v]] [(keyword k) v]) {pass yy, yyy yyy})) On Saturday, February 8, 2014 2:34:44 PM UTC-2, Tao Zhou wrote: lein try com.taoensso/carmine ;; try is from https://github.com/rkneufeld/lein-try (def server-connection {:pool {:max-active 8}

Re: map semantics

2014-02-08 Thread Gary Verhaegen
The definition of map in Clojure is that it is a function on seqs. It is defined as operating on a seq, and returning a seq. Whereas in Scala, you hold an object and have thus access to its class (so you can call Set.map on a set and List.map on a map), in Clojure there is only one function

Re: partial function revisited (exercise in macros)

2014-02-08 Thread Gary Verhaegen
When writing a somewhat complex macro, it is always a good idea to start by writing the code you would like to write (using the macro), rather than begin with the implementation. Could you perhaps provide an example use of the macro you would like to have? Not one that works, obviously, but what

Re: unconditional append to end

2014-02-08 Thread Gary Verhaegen
Or use vec to turn a sequence into a vector. As a general comment, using a dynamically typed language should not be seen as an opportunity not to think about types. You should still design your functions, think about the types they should receive, etc. Not having the compiler to check it for you

Re: map semantics

2014-02-08 Thread Timothy Baldridge
First of all, you are right. Map with things like sets is a bit of iffy concept. Now, most of the the time, I just don't care. If I was to increment every value in a set I'll just do (set (map inc #{1 2 3})) and not really care less about data structure theory. It works and I can get work done.

Re: Is there a prettify command in emacs for clojure?

2014-02-08 Thread Rodrigo B. de Oliveira
emacs-live has a live-paredit-reindent-defun bound to M-q that gets very close. On Friday, February 7, 2014 8:20:58 PM UTC-2, Taylor Sando wrote: Let us say you had this: (defn create-new-canvas-text [inputs] (let [{text-selected-id :new} (dataflow/old-and-new inputs [:design :params

Re: map semantics

2014-02-08 Thread Andy Fingerhut
This might be too detailed a point, but I wanted to mention that while you will always get the same order for the same collection (same as determined by identical?, or Java ==, i.e. it is the same object in memory), you are *not* guaranteed to get the same order for collections of the same type

Re: partial function revisited (exercise in macros)

2014-02-08 Thread r
Agreed. What I'd like to have is something that works like this: (partial-pbm f ?sym? 1 ?x0 3) that would produce (given (defn ?sym?

Re: partial function revisited (exercise in macros)

2014-02-08 Thread r
Thanks, Let me study this a bit. Maybe I have additional questions. ranko On Saturday, February 8, 2014 12:01:37 PM UTC-5, juan.facorro wrote: When you use *`~p* what you are actually doing is using the symbol of the predicate as a function. For example if you call *(partial-pbm f symbol?

Re: map semantics

2014-02-08 Thread Softaddicts
The sequence abstraction is documented here: http://clojure.org/sequences Clearly map is documented as working on sequences. A sequence is not a concrete type as explained by others on this thread. If you really need some specific behavior from a concrete type then do not rely on sequences.

Re: map semantics

2014-02-08 Thread Moritz Ulrich
On Sat, Feb 8, 2014 at 6:39 PM, Timothy Baldridge tbaldri...@gmail.com wrote: First of all, you are right. Map with things like sets is a bit of iffy concept. Now, most of the the time, I just don't care. If I was to increment every value in a set I'll just do (set (map inc #{1 2 3})) and not

Re: Alternative - macro for threading sequences?

2014-02-08 Thread Korny Sietsma
Yeah - I'm coming to the conclusion that this idle thought didn't really have any value. The discussion was interested though. On 8 Feb 2014 17:30, Gary Verhaegen gary.verhae...@gmail.com wrote: For multiple calls to map, you can always do: (- things (map #(- % wrangle pacify))

Re: map semantics

2014-02-08 Thread Andy C
First, thanks everybody for explanations of design decision behind map and collections. I should in fact change subject to seq semantics ;-). For me the bottom line is that while I do not care about order so much I still can count on that seq function will produce consistent sequences. Or wait a

[ANN] Parkour 0.5.4, Hadoop REPL edition

2014-02-08 Thread Marshall Bockrath-Vandegrift
Parkour is a Clojure library for writing distributed programs in the MapReduce pattern which run on the Hadoop MapReduce platform: https://github.com/damballa/parkour Release 0.5.4 adds significant new features for REPL integration. Parkour now supports connecting to a live cluster, then

article about namespace still current?

2014-02-08 Thread Der Engel
Hi, I'm finding namespaces in Clojure a bit confusion, does know someone if the information in this articlehttp://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html (from 2010) is still current with today Clojure best practices and all the

Re: map semantics

2014-02-08 Thread Jozef Wagner
By 'same' I've meant an identical :). Two collections equivalent by their values may easily have a different order of their items. This is because in unordered collections, their internal order (as any other implementation detail) must not be taken into account when comparing for value

Re: article about namespace still current?

2014-02-08 Thread John D. Hume
It includes this update, which I'd say brings it up to date. *update (4/18/2012):** As of the 1.4.0 release, there's no longer a good reason to use use. Use require :refer instead. From the Clojure 1.4.0 * *changelog**: require can now take a :refer option. :refer takes a list of symbols to

Re: map semantics

2014-02-08 Thread Andy C
On Sat, Feb 8, 2014 at 1:46 PM, Jozef Wagner jozef.wag...@gmail.com wrote: Two collections equivalent by their values may easily have a different order of their items. It all boils down this: is it possible to have two clojure.lang.PersistentHashSet with identical values (in mathematical

pdf.js

2014-02-08 Thread t x
Hi, I've looked at the first few pages of Google results for pdf.js cljs and found nothing. Before I start hacking on my own pdf.js bindings, I wanted to ask -- does anyone have cljs bindings to pdf.js ? Thanks! -- You received this message because you are subscribed to the Google Groups

Re: ANN: core.logic 0.8.6

2014-02-08 Thread Plínio Balduino
David, first of all, congratulations for core.logic. I would like to start with logic programming, but the texts I found aren't for starters like me, even though I have a good experience as software developer and functional programming is not a mistery anymore. What would you recommend for

Re: ANN: core.logic 0.8.6

2014-02-08 Thread David Nolen
My honest suggestion is to get a copies of The Reasoned Schemer, The Art of Prolog, and Concepts Techniques Models of Computer Programming. They cover the terrain far better than any documentation or tutorial can. David On Sat, Feb 8, 2014 at 4:26 PM, Plínio Balduino pbaldu...@gmail.com wrote:

Re: map semantics

2014-02-08 Thread Michael Gardner
On Feb 8, 2014, at 15:14 , Andy C andy.coolw...@gmail.com wrote: It all boils down this: is it possible to have two clojure.lang.PersistentHashSet with identical values (in mathematical sense) but producing different seqs? Are you serious? The entire point of the email you responded to was

Re: Refactoring as an nREPL middleware

2014-02-08 Thread Curtis Gagliardi
Thanks, I'll definitely take a look at those libraries, I actually didn't do too much searching for prior art, I'll have to start now. You're dead on with whitespace and reader macros being a problem. I know I heard of someone working on trying to build a clojure formatter, so maybe something

Re: map semantics

2014-02-08 Thread Jozef Wagner
Yes. Behold a Murmur3 hash collision: user (def n1 -2023261231) #'user/n1 user (def n2 9223372036854771971) #'user/n2 user (== (hash n1) (hash n2)) true user (def s1 (conj #{} n1 n2)) #'user/s1 user (def s2 (conj #{} n2 n1)) #'user/s2 user (= s1 s2) But practically, I cannot think of any

Re: map semantics

2014-02-08 Thread Jozef Wagner
I've forgot the most interesting part :) user (= s1 s2) true user (= (seq s1) (seq s2)) false JW On Sat, Feb 8, 2014 at 11:32 PM, Jozef Wagner jozef.wag...@gmail.comwrote: Yes. Behold a Murmur3 hash collision: user (def n1 -2023261231) #'user/n1 user (def n2 9223372036854771971)

Re: map semantics

2014-02-08 Thread Jozef Wagner
Well it does not break referential transparency if both equalities (for input values and for results) are of a same kind. You would have to compare inputs by value and outputs by identity, if you want to percieve an inconsistency. JW On Saturday, February 8, 2014 6:49:39 PM UTC+1, Andy

Re: map semantics

2014-02-08 Thread Sean Corfield
On Feb 8, 2014, at 7:59 AM, Andy C andy.coolw...@gmail.com wrote: Your assertion that I am misunderstanding something is wrong. Now that you've seen everyone else's responses, perhaps you understand my assertion was correct? :) Sean Corfield -- (904) 302-SEAN An Architect's View --

Re: map semantics

2014-02-08 Thread Andy C
user (= s1 s2) true user (= (seq s1) (seq s2)) false Thx. If a=b then f(a) must = f(b). Something is broken here. -- 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

Re: map semantics

2014-02-08 Thread Andy Fingerhut
It is working as designed. If you do not want this, consider using sorted sets / sorted maps, where (= s1 s2) implies (= (seq s1) (seq s2)). Or, perhaps another programming language would be more to your liking. Andy On Sat, Feb 8, 2014 at 4:10 PM, Andy C andy.coolw...@gmail.com wrote:

Re: map semantics

2014-02-08 Thread John Mastro
Hi Andy, Andy C andy.coolw...@gmail.com wrote: user (= s1 s2) true user (= (seq s1) (seq s2)) false Thx. If a=b then f(a) must = f(b). Something is broken here. If a seq is a sequential view of a thing, and a set is an unordered thing, then it does not seem shocking to me that multiple

Re: map semantics

2014-02-08 Thread John Mastro
To add just one more thing to this: Referential transparency is clearly valuable, but it's not the *only* valuable property a function or system might have. There are always tradeoffs to be made. Clojure has made different tradeoffs than you expected, or would yourself have made, but that doesn't

Re: a problem about Redis client: com.taoensso/carmine

2014-02-08 Thread tao
Thank you very much! -- tao Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Sunday, February 9, 2014 at 1:06 AM, mynomoto wrote: You can use: (into {} (map (fn [[k v]] [(keyword k) v]) {pass yy, yyy yyy})) On Saturday, February 8, 2014 2:34:44 PM UTC-2, Tao Zhou wrote:

Re: a problem about Redis client: com.taoensso/carmine

2014-02-08 Thread tao
after use your solution, I looked up the source code of carmine and found that: (wcar* (car/hgetall* yyy true)) can get what I want. Thank you! -- tao Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Sunday, February 9, 2014 at 9:34 AM, tao wrote: Thank you very much! --

Re: ANN: core.logic 0.8.6

2014-02-08 Thread Plínio Balduino
Thank you Plinio Balduino 11 982 611 487 On 08/02/2014, at 19:29, David Nolen dnolen.li...@gmail.com wrote: My honest suggestion is to get a copies of The Reasoned Schemer, The Art of Prolog, and Concepts Techniques Models of Computer Programming. They cover the terrain far better than

Re: What's the status of clojure for Android?

2014-02-08 Thread curiousGuy
Another interesting consideration regarding Clojure on Android (or any other local OS)... As of Qt 5, Javascript is a first-class language for developing apps, and Qt 5 officially supports Android, iOS, in addition to its prior support for OSX, Windows, Linux, etc. You can get nearly all app

Re: map semantics

2014-02-08 Thread Andy C
I can ensure all of you that it is very uncomfortable for a newcomer with a goofy nick to just come in and say things are broke LOL . So at that point I have two choices: 1) as suggested, find another programming language but that would mean that I would have to erase my Clojure tattoo (very

Re: What's the status of clojure for Android?

2014-02-08 Thread Zach Oakes
That might work for some people, but as you mentioned, you wouldn't get to build your app in a REPL. Also, you'd lose access to the concurrency features of Clojure, and would probably also not get to use native Android APIs. On Saturday, February 8, 2014 9:57:38 PM UTC-5, curiousGuy wrote:

Re: map semantics

2014-02-08 Thread Mars0i
Maybe another way to put it is that what is, uh, broken isn't 'map' or 'seq', but '=', which is willing to tell you that two things (sets) are the same when they're not! We also have the non-broken predicate 'identical?', however, that gets it right. It's nice to also have a set-equal

Re: What's the status of clojure for Android?

2014-02-08 Thread Gary Trakhman
if Qt supports js's eval, then it's also possible to support a repl. On Sat, Feb 8, 2014 at 10:29 PM, Zach Oakes zsoa...@gmail.com wrote: That might work for some people, but as you mentioned, you wouldn't get to build your app in a REPL. Also, you'd lose access to the concurrency features

Re: map semantics

2014-02-08 Thread Mars0i
Maybe physical identity is too strong of a requirement for equality. So another way to think about it is that it's 'hash-set', 'set', and '#{}' that are--you know--broken, but that there's a fix, which is to always use 'sorted-set'. (I'm assuming that calling 'seq' on any two sorted sets

Ethereum

2014-02-08 Thread jTA
Has anyone a clojure-based project underway (or contemplating one) within the Ethereum context? Ethereum background accessible here: http://www.ethereum.org/ http://blog.ethereum.org/ -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this