Re: Mexico City Clojureists?

2020-10-22 Thread Mauricio Aldazosa
On Tue, Oct 20, 2020 at 2:19 PM Scott Klarenbach wrote: > Wondering who is living/working in Mexico City? > > o/ Hey there! Cheers, Mauricio -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.

Re: doall

2018-05-16 Thread Mauricio Aldazosa
Hi Renata, The problem with your code is that it is using *map* at the top level, which is a function that returns a lazy sequence. You are asking clojure to do something like: *Take each number n in inviteds and create a sequence of hash maps, where each hash map has n as a key and 1 as it's val

Re: How to Programmatically Create Unqualified Keywords?

2018-03-21 Thread Mauricio Aldazosa
On Wed, Mar 21, 2018 at 7:48 AM, Nick Mudge wrote: > I see what you mean. All keywords are namespaced, so there really is no > such thing as a no-namespaced keyword. Thank you. > You can have keywords without a namespace: user> (clojure-version) 1.9.0 user> (keyword "bar" "foo") :bar/foo user>

Re: Slides for my talk at EuroClojure 2016

2016-10-21 Thread Mauricio Aldazosa
On Fri, Oct 21, 2016 at 3:36 AM, Colin Yates wrote: > +1. > > Remind my old befuddled brain of the JS library used to produce those > 3d-like presentations? > Looks like reveal.js Cheers, Mauricio -- You received this message because you are subscribed to the G

Re: Guidelines/Recommendations for namespaces and qualified keywords

2016-10-17 Thread Mauricio Aldazosa
On Mon, Oct 17, 2016 at 9:46 PM, James Gatannah wrote: > > > On Saturday, October 15, 2016 at 10:17:15 PM UTC-5, Josh Tilles wrote: >> >> I’ve got a couple questions for Alex Miller and/or the other Cognitect >> folks. >> > > That isn't me. I'm just chiming in from the peanut gallery. Must of my

Re: Is there an easy way for s/keys spec to work against both qualified/unqualiffied keys at the same time?

2016-10-17 Thread Mauricio Aldazosa
On Sun, Oct 16, 2016 at 11:40 PM, Ikuru Kanuma wrote: > Mauricio, thanks for the response! > I agree that that gets what I asked for done, but that solution is in > essence writing the same > qualified/unqualified version of the spec twice and sounded redundant, > which lead to my question. > I g

Re: Is there an easy way for s/keys spec to work against both qualified/unqualiffied keys at the same time?

2016-10-14 Thread Mauricio Aldazosa
Hi, You can achieve that using *spec/or*: (s/def ::map-with-numbers (s/or :qualified ::map-with-numbers1 :unqualified ::map-with-numbers2)) (s/valid? ::map-with-numbers {::some-number 3}) => true (s/valid? ::map-with-numbers {:some-number 3}) => true ​ Cheers, Mauricio -- You receive

Re: cider-nrepl not installed (emacs24)

2015-09-19 Thread Mauricio Aldazosa
Hi, cider-nrepl is some middleware that sits outside emacs. You can use it via leiningen or boot. Take a look at the instructions here: https://github.com/clojure-emacs/cider#cider-nrepl-middleware Happy hacking, Mauricio ​ -- You received this message because you are subscribed to the Google

Re: a simple question about Arrays.asList

2015-05-21 Thread Mauricio Aldazosa
There are many things that need to be understood in a call like this. First of all, that method receives an array as its argument: https://docs.oracle.com/javase/7/docs/api/java/util/Arrays.html#asList(T...) >From your first example I think you are trying to translate to clojure the following jav

Re: What is happening in this code?

2014-08-27 Thread Mauricio Aldazosa
You can use a linter to find out this cases: https://github.com/jonase/eastwood#redefd-vars---redefinitions-of-the-same-name-in-the-same-namespace ​ Cheers, Mauricio -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to

Re: When to prefer keywords as functions?

2014-07-03 Thread Mauricio Aldazosa
Keywords can be used as a function with a map, so the keyword will search for itself in the map. Take a look at http://clojure.org/data_structures#Data%20Structures-Keywords In the case of the "ns" form, as James pointed out, what is happening is not a function call. ns is a macro and as such that

Re: How to add elements to a vector that is the value of a map key?

2014-06-17 Thread Mauricio Aldazosa
For updating the value of a map given a key you can use update-in: user> (update-in {1 [11]} [1] conj 22) {1 [11 22]} Now, to handle the case when the key is not present, you can use fnil: user> (update-in {} [1] (fnil conj []) 22) {1 [22]} ​ Cheers, Mauricio -- You received this message becau

Re: lein2 - lein version fails due to org.apache.http.impl.client.DefaultRequestDirector

2014-03-31 Thread Mauricio Aldazosa
Yep, there seems to be something wrong with clojars. If you already have all the dependencies you need, running lein with the -o flag might solve the issue. Mauricio -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to

Re: split maps contained in a file

2014-03-27 Thread Mauricio Aldazosa
Slurp returns one big string, in this case (assuming you have one map for each line) you can use line-seq: user> (with-open [rdr (clojure.java.io/reader "file-with-maps")] (doall (map read-string (line-seq rdr ({:a 1, :b 2} {:c 3, :d 4}) Cheers, Mauricio -- You received th

Re: updating the last member

2014-03-27 Thread Mauricio Aldazosa
Try something like this: (let [xs [1 2 3]] (conj (pop xs) 4)) Cheers, Mauricio -- 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 - ple

Re: Clojure/West 2014 Videos

2014-03-25 Thread Mauricio Aldazosa
Wow, that was fast! Thanks for al the effort, Mauricio -- 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 p

Re: Problems getting function metadata

2014-03-14 Thread Mauricio Aldazosa
With your first example you obtain the metadata of the var (that's the place where defn stores the metadata). In the second one, take a look at the value that is stored in the map: user> (:function fun-map) # Thats the func

Re: range-sum

2014-02-13 Thread Mauricio Aldazosa
My guess is that when using a rest-param a call to next is involved thus realizing two elements of the sequence. A call to rest only realizes the first element: user> (defn f [x] (println x) x) #'user/f user> (defn s [n] (lazy-seq (cons (f n) (s (inc n) #'user/s user> (def t (rest (s 0))) 0 #'

Re: When should I use non-blocking >! / threads and blocking >!! / goroutines with clojure core.async

2014-01-30 Thread Mauricio Aldazosa
On Thu, Jan 30, 2014 at 12:48 PM, Jozef Wagner wrote: > > go blocks, together with >!, threads and are not run in separate thread. There is no thread pool for go > blocks. > I thought that go blocks do run in a thread pool of size 42 + (2 * Num of processors). In the definition of the go macro t

Re: MyType cannot be cast to MyType?

2014-01-22 Thread Mauricio Aldazosa
Take a look at Stuart's tools.namespace ( https://github.com/clojure/tools.namespace), although be wary of the protocol issue as it is something that is pointed out in the warnings section of that project. Mauricio -- -- You received this message because you are subscribed to the Google Groups

Re: A question about lazy seq with io

2014-01-13 Thread Mauricio Aldazosa
On Mon, Jan 13, 2014 at 8:49 AM, Kashyap CK wrote: > > I'd really appreciate it if someone could tell me what's going on when I > do the following - > > user> (defn xx [] (map println [1 2 3 4 5 6])) > #'user/xx > user> (take 2 (xx)) > (1 > 2 > 3 > 4 > 5 > 6 > nil nil) > user> > There are many t

Re: Why isn't a docstring allowed for defrecord?

2013-10-31 Thread Mauricio Aldazosa
On Thu, Oct 31, 2013 at 9:15 AM, Mars0i wrote: > Excellent. Thanks Tassilo. I had attempted to do the same sort of thing > using > Point. > rather than > ->Point > which didn't work: > user => (doc Point.) > nil > user=> Point. > CompilerException java.lang.ClassNotFound

Re: What role does a semicolon play in this case?

2013-03-04 Thread Mauricio Aldazosa
I'm assuming you are talking about the colon ":", it means that you are working with a keyword: http://clojure.org/data_structures#Data%20Structures-Keywords -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloj

Re: Create map from vector of keywords and other items

2013-02-20 Thread Mauricio Aldazosa
Don't know if it's better, but: (apply hash-map (map-indexed #(if (= 0 (mod %1 2)) (first %2) (vec %2)) (partition-by keyword? [:key1 1 2 3 :key2 4 :key3 5 6 7]))) Seems to work. Mauricio -- -- You received this message because you are subscribed to the Google Gr

Re: Clojure turns 5

2012-10-18 Thread Mauricio Aldazosa
Congrats! -- 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 emai

Re: Bug: incorrect stack trace for function names containing ->

2012-10-09 Thread Mauricio Aldazosa
Hi there. According to the reader documentation (http://clojure.org/reader), it seems that '>' is not a valid character for a symbol name: Symbols begin with a non-numeric character and can contain alphanumeric characters and *, +, !, -, _, and ? (other characters will be allowed eventually, but