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 approach?
>
>
Countryman wrote:
>
> Your problem with recur is because you can only recur from the tail
> position.
>
> On Sep 23, 2015, at 12:28, nchurch <nchu...@gmail.com >
> wrote:
>
> Yeah, it consumes stack just like the Clojurescript version of Iterate.
> I'm cur
-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 given
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
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 mondraym...@gmail.com wrote:
Quite a few views but no bites ... what have I done wrong in asking this
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
-cant-i-call-seq-funct...
2013/5/11 nchurch nchubr...@gmail.com
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
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
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
around namespaces this week.
-Ryan
On Mon, Oct 22, 2012 at 8:41 PM, nchurch nchubr...@gmail.com wrote:
Am I making a mistake, or is this a bug?
(use 'clojure.data.xml)
(def p (parse (reader ../../small.xml)))
where small.xml is
?xml version=1.0 encoding=utf-8?
Keyboard
Am I making a mistake, or is this a bug?
(use 'clojure.data.xml)
(def p (parse (reader ../../small.xml)))
where small.xml is
?xml version=1.0 encoding=utf-8?
Keyboard xmlns:android=http://schemas.android.com/apk/res/android;
android:keyWidth=10%p
android:horizontalGap=0px
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 djpow...@djpowell.net wrote:
I'm using PhantomJS http://phantomjs.org/
It is a headless WebKit build that can render webpages as png or pdf,
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
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
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
, 2012 at 1:53 AM, nchurch nchubr...@gmail.com 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 get input on. For one thing,
I've used mutual recursion
, David Nolen dnolen.li...@gmail.com wrote:
On Fri, Oct 5, 2012 at 8:42 AM, nchurch nchubr...@gmail.com 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
Thanks David! I'll try to fix that in the next few days.
On Oct 5, 5:57 am, David Nolen dnolen.li...@gmail.com wrote:
On Fri, Oct 5, 2012 at 8:51 AM, nchurch nchubr...@gmail.com wrote:
Hmm! Then I must have hit the limit for how many arguments I can put
in an arglist, there in fresh: (i.e
Thanks guys! (And also to the other announcement.)
On Oct 4, 2:07 pm, Mayank Jain firesof...@gmail.com wrote:
On Fri, Oct 5, 2012 at 12:58 AM, Michael Fogus mefo...@gmail.com wrote:
Here's one approach: Make a github of the code and content that runs the
site. People fork and make pull
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. See
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
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
To cite some concrete examples:
Datomic
0 hits on Clojure.org
Clojurescript
1 hit
On Oct 1, 11:09 pm, nchurch nchubr...@gmail.com 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 fix the
problems you've
about how
to organize it.
On Oct 1, 11:20 pm, nchurch nchubr...@gmail.com wrote:
To cite some concrete examples:
Datomic
0 hits on Clojure.org
Clojurescript
1 hit
On Oct 1, 11:09 pm, nchurch nchubr...@gmail.com wrote:
I put together the Getting Started confluence page. I'm
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
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
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
with the
rest of the list.
Kind Regards,
Daniel Kwiecinski
lambder.com
On 26 April 2012 23:57, nchurch nchubr...@gmail.com wrote:
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
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 luke.vanderh...@gmail.com wrote:
Some of you may already be
@googlegroups.com [mailto:clojure@googlegroups.com] On Behalf Of
nchurch
Sent: Thursday, April 26, 2012 12:49 PM
To: Clojure
Subject: Re: Having trouble running clojurescript repl
BTW, I pushed a minimal lein-cljsbuild project with REPL here:
https://github.com/nchurch/ctest
On Apr 25, 9:30
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 dnolen.li...@gmail.com wrote:
core.logic can remember previous results via tabling.
As far as n-queens - that's a problem best
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):
BTW, I pushed a minimal lein-cljsbuild project with REPL here:
https://github.com/nchurch/ctest
On Apr 25, 9:30 pm, Sean Neilan s...@seanneilan.com wrote:
Holy shnikes! That did it!
Thank you so much!
I'll submit a patch to the documentation.
On Wed, Apr 25, 2012 at 11:27 PM, David Nolen
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 the
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
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
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
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.
Cedric, you should append this to The Unix-Hater's HandbookI'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 cgree...@gmail.com wrote:
On Thu, Jan 26, 2012 at 12:25 AM, Sean
Just wanted to add my thanks on this as well! It looks beautiful
Nick.
On Jan 12, 11:46 am, Daniel Jomphe danieljom...@gmail.com 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
, Jan 2, 2012 at 2:16 PM, Tassilo Horn tass...@member.fsf.org wrote:
nchurch nchubr...@gmail.com writes:
Hi,
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
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 tass...@member.fsf.org wrote:
nchurch nchubr...@gmail.com writes
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
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?
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
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 to
can take a back seat.
On Dec 26, 12:13 pm, nchurch nchubr...@gmail.com 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/2010-1
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
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 d...@axiom-developer.org wrote:
On Thu, 2011-12-22 at 17:53 -0800, nchurch wrote:
Firstly, there really needs
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 incantation is (this is
one
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
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 nchubr...@gmail.com wrote:
I'm wondering if core.logic can be used to solve
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
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 mtbee...@gmail.com wrote:
What do you mean? If it's
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
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
!!!
I'm off to try this out in my REPL!
Many bows,
Joshua
On Oct 30, 11:29 pm, nchurch nchubr...@gmail.com wrote:
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
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.
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
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
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
You clone it from github (git clone URL listed at top) 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 vincent@gmail.com wrote:
How to use this ?
--
You received this message because you
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
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
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
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
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
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 is
+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
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 the Google
Groups
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 on
71 matches
Mail list logo