Re: A generalization of iterate

2015-09-23 Thread nchurch
, Max Countryman wrote: > > Your problem with recur is because you can only recur from the tail > position. > > On Sep 23, 2015, at 12:28, nchurch > > wrote: > > Yeah, it consumes stack just like the Clojurescript version of Iterate. > I'm curious if anyo

Re: A generalization of iterate

2015-09-23 Thread nchurch
-cat coll (generate f [next-val] (conj (butlast args) > next-val)) > > Where your Fibonacci example becomes: > > (take 100 (generate +’ [1 1])) > > As for your other questions, I can’t be of much help. But isn’t there > nontrivial memory overhead to consider with this a

A generalization of iterate

2015-09-22 Thread nchurch
(lazy-cat coll (recurse [next-val] (conj (butlast args) next-val)] (recurse more (reverse more Code is also on Github <https://github.com/nchurch/generate>. I see this as part of a larger class of generalized sequence functions: for instance, extra arguments in a function g

Re: Zelkova: Elm-style FRP for Clojure and ClojureScript

2014-12-07 Thread nchurch
Did you ever look into Hoplon/Javelin? Haven't heard much about it on this group recently, and curious why On Saturday, December 6, 2014 10:37:20 PM UTC-8, James MacAulay wrote: > > What prompted me to write Zelkova? > > The short answer is curiosity and gut feeling. The long answer: > > I c

Re: lazy sequence termination

2013-05-28 Thread nchurch
Could you include the code in client/get? Not sure where that comes from and it would be helpful to run the code to see what happensno guarantees though =) On May 28, 1:05 pm, Mond Ray wrote: > Quite a few views but no bites ... what have I done wrong in asking this > question? If you can't

writing a multimap implementation: problems with transients, metadata

2013-05-27 Thread nchurch
So, inspired by this post on SO: http://stackoverflow.com/questions/10942607/clojure-multi-maps I've been trying to write some multimap functions, in a transient version: https://gist.github.com/anonymous/5660467 This was my first experience with transients, and it's been problematic. First pr

Re: js->clj not working

2013-05-12 Thread nchurch
-i-call-seq-funct... > > 2013/5/11 nchurch > > > > > > > > > I'm trying to get a map out of a Goog events object (and also out of > > Domina events objects).  Calling js->clj on either of these, even in > > the most recent version of cljs, doesn'

js->clj not working

2013-05-11 Thread nchurch
I'm trying to get a map out of a Goog events object (and also out of Domina events objects). Calling js->clj on either of these, even in the most recent version of cljs, doesn't seem to do anything; it just returns the inscrutable #<[object Object]> at the REPL. (It doesn't seem to produce maps o

Domina API: value vs. text

2013-02-22 Thread nchurch
I've been playing around with Domina; I'm curious why there are different functions for getting the value of forms and of text nodes, (value ) and (text ) respectively. (I realize this comes from JQuery, and I'm a comparative Web noob.) I also noticed that the various set! functions operate on pl

Re: roundtripping using data.xml?

2012-10-24 Thread nchurch
scussions going around namespaces this week. > > -Ryan > > > > > > > > On Mon, Oct 22, 2012 at 8:41 PM, nchurch wrote: > > Am I making a mistake, or is this a bug? > > > (use 'clojure.data.xml) > > > (def p (parse (reader "<.

roundtripping using data.xml?

2012-10-22 Thread nchurch
Am I making a mistake, or is this a bug? (use 'clojure.data.xml) (def p (parse (reader "<../../>small.xml"))) where "small.xml" is http://schemas.android.com/apk/res/android"; android:keyWidth="10%p" android:horizontalGap="0px" android:verticalGap="0px" android:keyHeight="@dime

Re: Hiccup -> HTML -> PNG

2012-10-20 Thread nchurch
Thank you gentlemen, I'm trying out PhantomJS and it looks good so far; will let you know how the full project goes. On Oct 17, 4:18 am, David Powell wrote: > I'm using PhantomJS > It is a headless WebKit build that can render webpages as png or pdf, > amongst other stuff.

Hiccup -> HTML -> PNG

2012-10-16 Thread nchurch
Has anyone generated PNGs (or any image) from Hiccup in Clojure? I see an older Java library for this: http://code.google.com/p/java-html2image/ Curious to hear about any experience with this library, or if there is a better solution out there. Thanks, Nick. -- You received this message beca

Re: ANN clojure-doc.org (aka CDS), a new community-driven Clojure documentation site

2012-10-08 Thread nchurch
Quick question: would it be possible to copy stuff from dev.clojure.org? I wrote some stuff over there, under the CA agreement, but it's kind of a wiki format so it might be unclear who 'owns' it. BTW, I noticed the front page of clojure.org got its headings cleaned upthank you to whoever did

Re: ANN: a Clojure docs site, and github organization

2012-10-07 Thread nchurch
> Just to keep in touch with our marvelous legal systems in North America, read > this: ... > how much I am frustrated by this shattered world Indeed! The law is nothing but an overly complex, haphazardly designed, historically encrufted programming language for morals. Its compiler is frig

Re: ANN: core.logic Go solver

2012-10-05 Thread nchurch
Thanks David! I'll try to fix that in the next few days. On Oct 5, 5:57 am, David Nolen wrote: > On Fri, Oct 5, 2012 at 8:51 AM, nchurch wrote: > > Hmm!  Then I must have hit the limit for how many arguments I can put > > in an arglist, there in fresh: (i.e. (fresh [~@po

Re: ANN: core.logic Go solver

2012-10-05 Thread nchurch
ct 5, 5:46 am, David Nolen wrote: > On Fri, Oct 5, 2012 at 8:42 AM, nchurch wrote: > > CompilerException java.lang.ClassFormatError: Too many arguments in > > method signature in class file go/core > > $eval2878$fn__2881$fn__2882$_inc__2883$fn__2884$_inc__2885$fn__2890, > >

Re: ANN: core.logic Go solver

2012-10-05 Thread nchurch
Oct 5, 2012 at 1:53 AM, nchurch wrote: > > Here's a Go solver > > > code: > >https://github.com/nchurch/go/blob/master/src/go/core.clj > > > README: > >https://github.com/nchurch/go > > Neat! > > > There are some issues that I'd like to

mapv-in or map-in?

2012-10-04 Thread nchurch
I ended up needing the following utility, modified from the Clojure source: (defn mapv-in "maps f over a nested vector structure" ([f coll] (let [f #(if (coll? %)(mapv-in f %)(f %))] (-> (reduce (fn [v o] (conj! v (f o))) (transient []) coll) persistent! I wrote just as

ANN: core.logic Go solver

2012-10-04 Thread nchurch
Here's a Go solver code: https://github.com/nchurch/go/blob/master/src/go/core.clj README: https://github.com/nchurch/go It's a really fun use of core.logic: you can test for pieces being alive or dead; you can also generate all the boards that make a given piece alive or dead

Re: Regarding Starting Clojure

2012-10-04 Thread nchurch
Thanks guys! (And also to the other announcement.) On Oct 4, 2:07 pm, Mayank Jain wrote: > On Fri, Oct 5, 2012 at 12:58 AM, Michael Fogus wrote: > > > Here's one approach: Make a github of the code and content that runs the > > site. People fork and make pull requests. > > > You talked me into

Re: Regarding Starting Clojure

2012-10-02 Thread nchurch
Clojuredocs is already out there and quite good (though not modified much as of late). However, it doesn't show up very high on Google (not even on the first page for "Clojure"). There's also Learn Clojure, which has a clean design but hasn't been updated in a while (and also doesn't seem to have

Re: Regarding Starting Clojure

2012-10-02 Thread nchurch
ices being made about how to organize it. On Oct 1, 11:20 pm, nchurch wrote: > To cite some concrete examples: > > "Datomic" > > 0 hits on Clojure.org > > "Clojurescript" > > 1 hit > > On Oct 1, 11:09 pm, nchurch wrote: > > > >

Re: Regarding Starting Clojure

2012-10-01 Thread nchurch
To cite some concrete examples: "Datomic" 0 hits on Clojure.org "Clojurescript" 1 hit On Oct 1, 11:09 pm, nchurch wrote: > I put together the Getting Started confluence page.  I'm sure it could > still be improved, but adding further to it won't really fi

Re: Regarding Starting Clojure

2012-10-01 Thread nchurch
I put together the Getting Started confluence page. I'm sure it could still be improved, but adding further to it won't really fix the problems you've noticed, and that many other people have noted. It's still on a secondary site, and Confluence doesn't really give you a lot of design options

Re: Fund raiser for our projects

2012-09-05 Thread nchurch
It's worth pointing out that the tools Clojure is built on (chiefly Java) are themselves the products of companies. If Sun hadn't stayed behind Java, we'd probably still be coding Java in a C ecosystem, rather than Clojure in a Java ecosystem. Sun of course was a huge companybut that doesn't

getting started updates

2012-04-27 Thread nchurch
The Getting Started page hasn't been updated in a while; I've just added some material (particularly about Clojurescript and additional libraries like Seesaw and core.logic). Any suggestions? http://dev.clojure.org/display/doc/Getting+Started In particular, does anyone know of good tutorials asi

Re: New release of Domina (now with reworked eventing)

2012-04-27 Thread nchurch
Looking forward to trying it out. Has anyone used both Enfocus and Domina? Any comparisons on the usage and features of the two? Also, has anyone put either of these together with JQuery UI code? On Apr 27, 7:47 am, Luke VanderHart wrote: > Some of you may already be aware of of Domina, a jQue

Re: a goal succeeding when given another goal succeeds for all elements in a list

2012-04-27 Thread nchurch
d and rest in fresh variables. For such obtained head we try to > apply 'goal' goal AND continue recursively in the same fashion with the > rest of the list. > > Kind Regards, > Daniel Kwiecinski > lambder.com > > On 26 April 2012 23:57, nchurch wrote: > > &g

Re: a goal succeeding when given another goal succeeds for all elements in a list

2012-04-26 Thread nchurch
For the benefit of bystanders, could anyone explain why and how Daniel's for-all function works? (I've gotten to chapter 4 of TRS.) On Apr 26, 2:04 pm, David Nolen wrote: > core.logic can remember previous results via tabling. > > As far as n-queens - that's a problem best left for constraint lo

lein-cljsbuild on Windows?

2012-04-26 Thread nchurch
4-Bit Server VM >  Windows 7 > > Thanks > > > > > > > > -Original Message- > From: clojure@googlegroups.com [mailto:clojure@googlegroups.com] On Behalf Of > nchurch > Sent: Thursday, April 26, 2012 12:49 PM > To: Clojure > Subject: Re: Ha

Re: Having trouble running clojurescript repl

2012-04-25 Thread nchurch
BTW, I pushed a minimal lein-cljsbuild project with REPL here: https://github.com/nchurch/ctest On Apr 25, 9:30 pm, Sean Neilan wrote: > Holy shnikes! That did it! > > Thank you so much! > > I'll submit a patch to the documentation. > > On Wed, Apr 25, 2012 at 1

Re: Having trouble running clojurescript repl

2012-04-25 Thread nchurch
Did you try using lein-cljsbuild (together with the instructions on Using Clojurescript in a Web Page on Quick Start)? That works fine for me. The instructions on the lein-cljsbuild REPL are here (repl listen should be enough to get you going): https://github.com/emezeske/lein-cljsbuild/blob/0.1

Re: ClojureScript One in Eclipse

2012-04-04 Thread nchurch
> Note that the browser-connected REPL (at least, when run via > one.sample.repl/go) hoists itself up on top of the REPL you start via Run > > Clojure >Application, and assumes that it's in a console, and therefore > doesn't play well with the ccw REPL, assumes the opposite. I assume this means

Re: revisiting community funding?

2012-03-23 Thread nchurch
I like BernardH's idea of doing it anonymously; if nobody from Core minds, we could set up an anonymous survey to see how much interest there is. cej38, your suggestions are very soundpersonally, I would love to see curated, distilled APIs for common things a Clojure programmer needs to do fro

revisiting community funding?

2012-03-20 Thread nchurch
There was a brief period of community funding for Rich's work back in 2010. When that ended, we now know the result was Datomica huge win. But there are other people who work on Clojure and Clojurescript; great things could happen from the focus that comes from being able to work on them full

Re: using Clojail dynamically

2012-03-09 Thread nchurch
Thank you both! That works. I'm not sure I understand why, though. From the error message, you would think it needs fewer steps of evaluation, not more. Meanwhile, if I do: (defn non-sandbox [func inputs] (map (fn [inp] (eval `(~func ~inp))) inputs)) this has no problem taking a function.

using Clojail dynamically

2012-03-09 Thread nchurch
I've just been trying out Clojail, and ran into a difficulty. Suppose you make a sandbox: (def sb (sandbox secure-tester)) and you want to dynamically assemble function calls to run inside the sandbox. Well, the sandbox takes a quoted expression, so you do something like this: (defn function-s

Re: Setting up Emacs to edit Clojure for Windows folks

2012-01-25 Thread nchurch
Cedric, you should append this to "The Unix-Hater's Handbook"I'm not providing a link because I'm sure you already know it! ---Fellow Unix-hater, and Mac OS user (add flame suppressor here) On Jan 25, 10:21 pm, Cedric Greevey wrote: > On Thu, Jan 26, 2012 at 12:25 AM, Sean Corfield > wrote

Re: ClojureScript One - Getting Started with ClojureScript

2012-01-12 Thread nchurch
Just wanted to add my thanks on this as well! It looks beautiful Nick. On Jan 12, 11:46 am, Daniel Jomphe wrote: > Will we be able to read the account of the experience of translating the > app from CoffeeScript to ClojureScript? > > And/or reading both code bases. > > Not sure if this acco

Re: accessing multiple return values

2012-01-03 Thread nchurch
> I think, I'll stop here.  You won't convince me that this approach is > practicable anytime soon. ;-) I certainly won't try too hard either. I'm not questioning here whether it is immediately practicable to implement (maybe not, and in case a very long discussion) but is it potentially useful?

Re: Understanding the quoting of a symbol in a list

2012-01-03 Thread nchurch
If I could hazard a guess, it has to do with symbol lookup in maps. Try the following: ('foo {'foo 1}) ('foo {'bloo 1} 4) when you do ('foo 1), it can't find foo in 1 (because it isn't there, and 1 isn't even a map), so it returns nil. If you do ('foo 1 2), you've just provided a default value,

Re: accessing multiple return values

2012-01-03 Thread nchurch
amespace. Hopefully that is less confusing. As for storing values: as I said they should be \function-local, so that in (defn bar [...] (foo ...) (+ foo/double-x ...) ) foo/double-x expires after bar returns. On Jan 3, 2:15 pm, Tassilo Horn wrote: > nchurch writes: > > Replyin

Re: accessing multiple return values

2012-01-03 Thread nchurch
lling. On Jan 3, 12:36 am, Cedric Greevey wrote: > On Mon, Jan 2, 2012 at 2:16 PM, Tassilo Horn wrote: > > nchurch writes: > > > Hi, > > >> Someone was asking on the list here about multiple return values, > >> which Clojure does not have. > > >> If

accessing multiple return values

2012-01-02 Thread nchurch
Someone was asking on the list here about multiple return values, which Clojure does not have. If the facility were ever added, perhaps multiple values could be accessed via namespaces. Functions would possess another level of namespace and have the ability to inject values into the environment u

Re: Lithub and Marginalia

2011-12-26 Thread nchurch
can take a back seat. On Dec 26, 12:13 pm, nchurch wrote: > > Like this?  http://brighterplanet.github.com/flight/impact_model.html > > You can see how they handle it (from a Ruby-centric perspective) > > here:https://github.com/brighterplanet/numbers/blob/gh-pages/_posts/

Lithub and Marginalia

2011-12-26 Thread nchurch
> Like this? http://brighterplanet.github.com/flight/impact_model.html > You can see how they handle it (from a Ruby-centric perspective) here: > https://github.com/brighterplanet/numbers/blob/gh-pages/_posts/2010-12-02-github-pages-rocco-and-rake-file-tasks.markdown (The original thread seems

Re: Literate programming

2011-12-22 Thread nchurch
ore. If I face this particular problem, maybe I decide to re-write Join and Split to my own specifications. I then put them out there under my own namespace, and when someone needs to use them they just type (use '[nchurch :only join split]) wherever they are in their file, or whatever the exact in

Re: Literate programming

2011-12-22 Thread nchurch
lready partway there with the existence of Clojure, but although it's the most intelligent language I've every come across (and it is at least Lisp), it still isn't enough. On Dec 22, 11:14 pm, daly wrote: > On Thu, 2011-12-22 at 17:53 -0800, nchurch wrote: > > Firstly, the

Re: Literate programming

2011-12-22 Thread nchurch
Why should I write English in the first place? Because it helps me to think; and it helps me to "program" other people to think like me. But I would never have learned English unless along the way it gave me near-term results. It should follow, then, that telling people to write literate programs

Re: core.logic and arithmetic equations?

2011-12-05 Thread nchurch
programming over tree terms (Clojure persistent data structures). > > Once cKanren is up and running it shouldn't be hard for someone to extend > core.logic to handle reals - CLP(R). > > David > > > > > > > > On Mon, Dec 5, 2011 at 4:08 PM, nchurch wrote: &

core.logic and arithmetic equations?

2011-12-05 Thread nchurch
I'm wondering if core.logic can be used to solve equations over reals or rationals; all the examples I've seen are with with integers and 'Oleg numbers'. I'm talking about something like this: http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-22.html#%_sec_3.3.5 What spurred me was this week'

Re: REPL magic: get the previous expression?

2011-11-09 Thread nchurch
My particular use-case was to be able to write tests for things entered at the REPL. I'm almost done with a basic version of it and will post it to the list when done. It would be much easier if the expressions were there anyway. I guess the issue is that people may not always be using Lein or R

Re: REPL magic: get the previous expression?

2011-11-09 Thread nchurch
I mean I want to write a utility that has access to the previous expression entered at the REPL no matter where this utility is called. Since the up-arrow key has this access, it must be possible On Nov 9, 12:57 pm, Michael Beattie wrote: > What do you mean?  If it's programatically then why

REPL magic: get the previous expression?

2011-11-09 Thread nchurch
Does anyone know how to programmatically get the previous expression entered at the REPL? You can get it interactively by pressing the up- arrow key; and of course you can get the previous \result through the variable *1. Is there any similar variable or function (perhaps in Java-land) that would

Re: Stanford ai-class

2011-11-07 Thread nchurch
I have used Clojure in it for calculating some of the quiz/homework answersit's been helpful. -- 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 modera

Re: Lazy behavior

2011-10-31 Thread nchurch
The problem you're having doesn't have anything to do with file reads. Every time you call (take 5 data), you're calling it on the same item 'data'; your variable 'data' doesn't change between each call. The chief thing you have to understand about Clojure is that variables never change. Never.

Re: easy sum of squares refactor question

2011-10-31 Thread nchurch
cessful in my trials, so thank you times two!!! > > I'm off to try this out in my REPL! > > Many bows, > Joshua > > On Oct 30, 11:29 pm, nchurch wrote: > > > > > > > > > Another solution, this time using Clojure's tail recursion: > &g

Re: easy sum of squares refactor question

2011-10-30 Thread nchurch
Another solution, this time using Clojure's tail recursion: (defn sum2 [func incr a b] (loop [accum 0 x a] (if (> x b) accum (recur (+ (func x) accum) (incr x) This may be getting ahead of where you are now, so come back and look when you've covered map, reduce, and

Re: easy sum of squares refactor question

2011-10-30 Thread nchurch
All you have to do is abstract the function you want (by 'abstract' I mean "put it in the argument list and replace the function with the variable"): (defn sum2 [func incr a b] (if (> a b) 0 (+ (fn a) (sum2 func incr (incr a) b You wouldn't want to use this code in the real world s

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-25 Thread nchurch
This is not coding-related, but do we have any musicians in the group? I'm going to have a violin with me and would love to jam or sight-read. Maybe the Overtone guys would be interested in this? If there's any interest I'll set up a doodle poll to see what instruments people might play or have.

Re: clojinc: a Clojure tutorial in the form of an extended REPL session

2011-09-07 Thread nchurch
You clone it from github (git clone ) and run the code one form at a time in core.clj; or, just copy the code in core.clj from the code browser on github itself. On Sep 7, 10:16 pm, Vincent wrote: > How to use this ? -- You received this message because you are subscribed to the Google Groups "

Re: new Getting Started page

2011-09-03 Thread nchurch
> 2. Fun stuff to do with the basic repl >     - some swing stuff >         - copy and pastable code snippets >     - some parallel stuff with futures or pmap or something >     - something with the stm >     - agents are cool, right? >     - links to 4clojure and project euler Kevin I think

Re: new Getting Started page

2011-09-02 Thread nchurch
Jonathan--- I think some of your criticisms of Clooj are valid, as Lee has said; my question is not whether Clooj is perfect or even good, my question is if there is a better option for an outright newcomer. An outright newcomer may not be so worried about adding jars, or used to existing REPL be

new Getting Started page

2011-09-02 Thread nchurch
There was some discussion about the Getting Started page last night at the Bay Area meetup. I've put together an (I think) improved version at http://dev.clojure.org/display/doc/Getting+Started+for+Beginners Any suggestions/additions/deletions? If this overall looks good, may I replace the curr

Re: better community docs: getting started

2011-07-29 Thread nchurch
> But my question is : is it ready yet ? As a quick and simple way to get a REPL and edit code it seems to work fine. I added a sentence about its newness just so people would be aware of it...if the author prefers no tutorial so far, then of course it should be taken down. -- You received thi

Re: better community docs: getting started

2011-07-29 Thread nchurch
Here's a tutorial on getting started with Clooj: http://dev.clojure.org/display/doc/getting+started+with+Clooj If this looks good to people, I'll try to get permission to reorganize the Getting Started docs a little. -- You received this message because you are subscribed to the Google Groups "

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread nchurch
> nchurch, I arrest you, try you, and find you guilty of the heinous > charge of top-posting, thou knave, thou scum, thou waster of > bandwidth! I confess that I have erred and strayed from thy ways like a lost sheep -- You received this message because you are subscribed to t

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread nchurch
+1 to writing an etiquette document. I have to confess I wrote a long post a few weeks ago without realizing these sorts of posts belonged on blogs (it was, oddly enough, another James Keats thread, on the subject of Steve Yegge. I figured if \Yegge writes long blogs). I didn't intend to ruff

Re: better community docs: getting started

2011-07-25 Thread nchurch
> How about making the main suggestion be clooj instead, with emacs, > eclipse, netbeans in the list of alternative options? :) Sounds like consensus around Clooj. Released on July 18th, top option on July 25th! Things move at lightspeed around here The one thing I want to say about Emacs i

Re: better community docs: getting started

2011-07-24 Thread nchurch
> The community getting started page could be much better. In particular, > people have opined that there should be a clear, no-choices- > to-make path "For Newbies" section.Help welcome! I just got edit privileges on dev.clojure and am eager work on it. How do people want to see Getting Started