Re: Please help making this tiny macro work with Clojurescript

2015-03-23 Thread myguidingstar
Oh silly me. It's just .val should be replaced with more portable version .-val Problem resolved! -- 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 mode

Re: Please help making this tiny macro work with Clojurescript

2015-03-23 Thread myguidingstar
It turns out that this code works in Clojure: (let [x (clojure.lang.Box. 1)] (set! (.val x) 2) (.val x)) while this one failed to compile in Clojurescript (just .cljs, no macro involved): (let [x (cljs.core/Box. 1)] (set! (.val x) 2) (.val x)) Box is already defined as mutable in Clojuresc

Please help making this tiny macro work with Clojurescript

2015-03-23 Thread myguidingstar
I'm porting this library to Clojurescript. Everything is ok except this `for` macro: https://github.com/LonoCloud/synthread/blob/master/src/lonocloud/synthread.clj#L112 When required and compiled with Clojurescript, the above `for` yelled at me: clojure.lang.ExceptionInfo: set! target must be a

Re: Are there any good libraries to work with the maildir format?

2015-03-23 Thread Colin Fleming
Hi Chris, I've not used it, and it won't have a Clojure interface, but try Apache James for a maildir implementation - they usually have good implementations of the standard mail protocols. Cheers, Colin On 24 March 2015 at 11:11, Chris Carpenter wrote: > I've been googling around and am havin

Current state of automatic generation of externs file for CLJS Advanced Compilation?

2015-03-23 Thread james borden
Is there a way to automatically generate externs files for js libraries for use with the cljs advanced compilation mode? I am having problems using a cljsjs package because its extern file does not contain all of the methods of an object I need to complete the introductory tutorial for the js

Re: Kwargs vs explicit parameter map for APIs?

2015-03-23 Thread Joseph Smith
I believe the current behavior with apply is the correct behavior as a map can be treated as a sequence of "MapEntry"s. -- > On Mar 23, 2015, at 19:15, Mark Engelberg wrote: > > Yes, I thought that technique worked, but I just conducted the same > experiment as you did and confirmed that it

Re: Kwargs vs explicit parameter map for APIs?

2015-03-23 Thread Mark Engelberg
Yes, I thought that technique worked, but I just conducted the same experiment as you did and confirmed that it doesn't. I must have been misremembering. You are correct that passing a map to a keyword-arg function is more of a nuisance than it should be. On Mon, Mar 23, 2015 at 4:36 PM, Matchin

Re: Kwargs vs explicit parameter map for APIs?

2015-03-23 Thread James Reeves
On 23 March 2015 at 10:13, Mark Engelberg wrote: > It's been a while since I've tested this, but I believe that if a map is > passed as the last argument to apply, Clojure "does the right thing" and > passes the map in as keyword args. > I'm afraid not. Not even in the latest Clojure 1.7.0 alpha

Re: csv output

2015-03-23 Thread Christopher Small
I'll make a couple of recommendations here: 1. Try out @davidsantiago's clojure-csv: https://github.com/davidsantiago/clojure-csv. I think it has more formatting/parsing flexibility, and you may find that it "just works (TM)". 2. For getting from maps to a sequence of vectors suita

Re: Kwargs vs explicit parameter map for APIs?

2015-03-23 Thread Matching Socks
Could you give an example demonstrating this? user> (defn a [& {x :x y :y}] (vector x y)) #'user/a user> (a :y 7 :x 3) [3 7] user> (apply a {:x 3 :y 7}) [nil nil] On Monday, March 23, 2015 at 6:13:55 AM UTC-4, puzzler wrote: > > It's been a while since I've tested this, but I believe that if

Are there any good libraries to work with the maildir format?

2015-03-23 Thread Chris Carpenter
I've been googling around and am having trouble finding well supported libraries for working with the maildir format. The closest clojure code I could find was: https://github.com/guns/mbwatch/blob/master/src/mbwatch/maildir.clj which is obviously very very barebones in that it only looks for n

Re: csv output

2015-03-23 Thread blake
I just did this but for a more complex data structure so it doesn't quite map to your example. I did it this way: 1. Stringify-keys 2. Merge the data, then pull the keys to get the unique fields 3. Join all the keys got in part 2 with "," to create a header record 4. Now, for each record, pull th

csv output

2015-03-23 Thread Kyle Sexton
Given output from the repl of a data structure like this: #+BEGIN_SRC clojure foo.core> (list-users) [{:path "/", :create-date #, :user-id "FOOFOOFOO", :user-name "foo"} {:path "/", :create-date #, :user-id "BARBARBAR", :user-name "bar"}] nil foo.core> #+END_SRC What is a good way to

DiscoMelee.com is hiring clojure devs

2015-03-23 Thread Chris FitzGerald
Hi Everyone, Disco Melee was founded by a group of gamers because we were frustrated with twitch's lack of social features so we decided to reinvent the concept of social streaming, basically we are "making gaming social again". We are seeking backend and frontend de

Re: Does function core.async/poll! work?

2015-03-23 Thread ru
But there is no stable core.async API Reference. I decided to include definition of pull! from github source code into my code for now, till this contradiction will be resolved. Is this OK? понедельник, 23 марта 2015 г., 17:41:32 UTC+3 пользователь ru написал: > > Hello all, > > I can not use the

Re: Deterministic macro expansion for Clojure?

2015-03-23 Thread Chris Ford
I think it's useful to think of macros as an odd form of I/O. Just as you would separate out your templating from your domain functions, separate out your defmacro from regular functions that just happen to manipulate symbols. These functions will be easier to test. On 23 March 2015 at 16:23, Sean

Re: Deterministic macro expansion for Clojure?

2015-03-23 Thread Sean Corfield
On Mar 22, 2015, at 7:52 PM, myguidingstar wrote: > I wonder if there is any way to make macro expansion in Clojure > deterministic. That would be useful in unit tests. I’d be very interested to understand your use case… Testing what the macro expands to seems like it is test the macro system

Re: Does function core.async/poll! work?

2015-03-23 Thread Max Penet
I think the problem is that it's listed on the autodoc page http://clojure.github.io/core.async/ , hence the confusion. On Monday, March 23, 2015 at 4:50:57 PM UTC+1, tbc++ wrote: > > Unfortunately this isn't even in the latest alphas. > > Probably your best bet is to checkout a copy of core.as

New Functional Programming Job Opportunities

2015-03-23 Thread Functional Jobs
Here are some functional programming job opportunities that were posted recently: Software Engineer at Sonian http://functionaljobs.com/jobs/8799-software-engineer-at-sonian Cheers, Sean Murphy FunctionalJobs.com -- You received this message because you are subscribed to the Google Gro

Re: Does function core.async/poll! work?

2015-03-23 Thread Timothy Baldridge
Unfortunately this isn't even in the latest alphas. Probably your best bet is to checkout a copy of core.async via git, then do `lein install` in the checkout directory. Lein should spit out enough install information to get you started, the format should be something like: [org.clojure/core.asyn

Re: Does function core.async/poll! work?

2015-03-23 Thread Chris Ford
If you look on the core.async Github page , it describes this as what you need to pull the latest alpha into your project.clj: [org.clojure/clojure "1.6.0"] [org.clojure/core.async "0.1.346.0-17112a-alpha"] There's also a link to a list of other versions o

Re: Does function core.async/poll! work?

2015-03-23 Thread ru
Thank you, Timothy! Ok. Would you be so kind to point me what I must put in my project.clj file (:dependencies tag) to get SNAPSHOT version? понедельник, 23 марта 2015 г., 17:41:32 UTC+3 пользователь ru написал: > > Hello all, > > I can not use the poll! function in core.async namespace! > Getti

Re: Does function core.async/poll! work?

2015-03-23 Thread Timothy Baldridge
That version is from Sept 2014. Poll! was just added a month ago. Perhaps you can use a SNAPSHOT version? Timothy On Mon, Mar 23, 2015 at 8:58 AM, ru wrote: > [org.clojure/core.async "0.1.346.0-17112a-alpha"] > > понедельник, 23 марта 2015 г., 17:41:32 UTC+3 пользователь ru написал: > >> Hello

Re: Does function core.async/poll! work?

2015-03-23 Thread ru
[org.clojure/core.async "0.1.346.0-17112a-alpha"] понедельник, 23 марта 2015 г., 17:41:32 UTC+3 пользователь ru написал: > > Hello all, > > I can not use the poll! function in core.async namespace! > Getting an error message: > > (ns navobs.core > (:require ... > [clojure.core.async

Re: Does function core.async/poll! work?

2015-03-23 Thread Timothy Baldridge
poll! is a pretty recent addition, what version of core.async are you using? Timothy On Mon, Mar 23, 2015 at 8:41 AM, ru wrote: > Hello all, > > I can not use the poll! function in core.async namespace! > Getting an error message: > > (ns navobs.core > (:require ... > [clojure.co

Does function core.async/poll! work?

2015-03-23 Thread ru
Hello all, I can not use the poll! function in core.async namespace! Getting an error message: (ns navobs.core (:require ... [clojure.core.async :as async :refer [chan poll! put!]])) ... Compiling navobs.core java.lang.IllegalAccessError: poll! does not exist, compiling:(core.clj:1:

Re: Kwargs vs explicit parameter map for APIs?

2015-03-23 Thread Mark Engelberg
Ha! I just noticed that this thread was started a year ago, and I posted a similar comment back then. Well, at least I'm consistent :) On Mon, Mar 23, 2015 at 3:13 AM, Mark Engelberg wrote: > Your article makes things a little more complicated than they need to be > -- there is a special dest

GSoC Project

2015-03-23 Thread Babar Naveed Memon
Hello Guys, I am a computer science senior at LUMS (Lahore University of Management Sciences) in Pakistan and I was introduced to Clojure through my Advance Programming Course this semester so I have been working with Clojure for a few months. I was interested in a few projects for the summer a

Re: Kwargs vs explicit parameter map for APIs?

2015-03-23 Thread Mark Engelberg
Your article makes things a little more complicated than they need to be -- there is a special destructuring syntax in Clojure for pouring keyword args directly into a map (just do the map destructuring after the &). Also, I don't think you need to flatten the map of keyword args before calling "a

Re: Kwargs vs explicit parameter map for APIs?

2015-03-23 Thread Colin Yates
If there are enough optional args that they need to be named then I choose a map, every time. That said, I do must multi-arity fns quite a bunch as well (with the options map going on the end if applicable). I also depend quite heavily on prismatic's schema, and to a lesser extent core.typed and I

Re: Kwargs vs explicit parameter map for APIs?

2015-03-23 Thread tcrayford
Hi there, I feel pretty strongly about this - I *much* prefer using APIs with explicit options maps. The community is pretty divided though. I wrote up the tradeoffs (which are well discussed here as well), as well as a list of libraries using each style: http://yellerapp.com/posts/2015-03-22-