Consider the two definitions:
(defn if-let-good [str]
(if-let [rest (seq (drop-while (partial = \a) str))]
(first rest)
empty))
(defn if-let-bad [seq]
(if-let [rest (seq (drop-while (partial = \a) seq))]
(first rest)
empty))
The only difference between them is the name of
Hello David,
what's the question ?
2011/1/5 David dsieg...@yahoo.com
Consider the two definitions:
(defn if-let-good [str]
(if-let [rest (seq (drop-while (partial = \a) str))]
(first rest)
empty))
(defn if-let-bad [seq]
(if-let [rest (seq (drop-while (partial = \a) seq))]
On Wednesday, January 5, 2011 11:06:34 AM UTC+1, David wrote:
Consider the two definitions:
(defn if-let-good [str]
(if-let [rest (seq (drop-while (partial = \a) str))]
(first rest)
empty))
(defn if-let-bad [seq]
(if-let [rest (seq (drop-while (partial = \a) seq))]
Nothing :(
$ lein repl
REPL started; server listening on localhost:32399.
user= (use '[gloss core io])
nil
user= (defcodec t (repeated (string :utf-8 :delimiters
[\n]) :delimiters [\0]))
#'user/t
user= (decode t (.getBytes blabla\nhihi\njg\0 g\n\0))
java.lang.Exception: Cannot evenly divide
The literate programming is actually a contrib to org-mode.
http://orgmode.org/worg/org-contrib/babel/
Ive actually used it to create my emacs.el, by having code in
emacs.org and have init.el tangle out the emacs code. Of course i
never documented
anything and did it for the novelty of being able
I need to know the way we can write a clojure code for a program like
this.
---
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import clojure.lang.RT;
import com.vaadin.Application;
import
Hey everybody,
Just a quick heads up that ClojureQL 1.0.0 is now released. All
interfaces should be final and there are no known bugs. Works out of
the box with PostgreSQL and MySQL but the compiler is a multimethod so
you can implement your own backend if you need to work with other
database
2011/1/5 Thilina Piyasundara thilina...@gmail.com
I need to know the way we can write a clojure code for a program like
this.
---
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import clojure.lang.RT;
import
Just discovered org-mode myself --- does anyone know of guide to using
it with clojure for a total newbie?
I havent actually used it for clojure per se. I was just imagining how
it could be used. You have the ability to embed arbitrary code (from
many different languages). You can edit the code
Congratulation, you've finally made it!
P.S.: Nice job on the website!
On Jan 5, 9:14 am, LauJensen lau.jen...@bestinclass.dk wrote:
Hey everybody,
Just a quick heads up that ClojureQL 1.0.0 is now released. All
interfaces should be final and there are no known bugs. Works out of
the box
G'day,
Ring ships with some development middleware that reloads the supplied
namespaces every request. This is fantastic for quick iterative
development, particularly because the JVM takes so long to start.
However as soon as you have more than a few namespaces every request
becomes rather slow -
Hi,
I just recently became aware of the built-in `align' [1] function for
Emacs while looking for a nice way to auto-align some hash-maps in my
Clojure code. This was easily done using align with the following piece
of customization.
#+begin_src emacs-lisp
(add-to-list 'align-lisp-modes
Nevermind - it was late, and I found the error message cryptic.
Sorry for throwing up a red herring.
On Jan 5, 5:30 am, Alessio Stalla alessiosta...@gmail.com wrote:
On Wednesday, January 5, 2011 11:06:34 AM UTC+1, David wrote:
java.lang.String cannot be cast to clojure.lang.IFn
[Thrown
Ring enhancement and patches are best posted to the ring-clojure
group. There's a chance they might be missed if only posted to the
Clojure group.
Regarding wrap-reload, your enhancements would put it halfway between
the current wrap-reload, and the wrap-reload-modified middleware
available as a
Hi James,
On 5 January 2011 18:50, James Reeves jree...@weavejester.com wrote:
Ring enhancement and patches are best posted to the ring-clojure
group. There's a chance they might be missed if only posted to the
Clojure group.
Ok, will do that in future.
Regarding wrap-reload, your
On Tue, Jan 4, 2011 at 9:10 PM, Eric Schulte schulte.e...@gmail.com wrote:
I wonder if anyone else has written any similar Emacs alignment rules
for Clojure which they would be interested in sharing?
Alignment rules for let and defroutes are at the top of my most wanted list.
(let [n
On 1/5/2011 9:27 AM, Seth wrote:
Just discovered org-mode myself --- does anyone know of guide to using
it with clojure for a total newbie?
I havent actually used it for clojure per se. I was just imagining how
it could be used. You have the ability to embed arbitrary code (from
many
Hi Ken,
Sorry for the very late response; I've been away for a friend's
wedding. Though I'm not sure if I will end up using this macro
frequently, it was highly educational to step through its inner
workings. Thank you very much for putting it together.
On Dec 23 2010, 11:07 pm, Ken Wesson
On Mon, Jan 3, 2011 at 11:14 AM, Alan Dipert a...@dipert.org wrote:
I'm happy to announce that Tom Faulhaber's Conj talk, Lisp,
Functional Programming, and the State of Flow is now available on
Clojure's blip.tv page: http://clojure.blip.tv/file/4521022/
Thanks for your work on making the
Clojure's vars maintain bindings in ThreadLocals[1]. I'm pretty sure
accessing ThreadLocals of other threads can't be done. Looking at
ThreadLocal and Thread sources, you might be able to dig around
private and package-private fields to get at them. Generally a bad
idea.
FWIW, the Enclojure
Hi,
It turns out that c.c.json/json-str will spit out Ratio's in a manner which
is not json compliant.
(json-str [3/4])
= [3/4]
This parses correctly in the reverse situation:
(read-json (json-str [3/4]))
= [3/4]
When being read [1] we switch over to using the clojure form reader so this
On Tue, Jan 4, 2011 at 19:06, Miki miki.teb...@gmail.com wrote:
If someone is interested in some other statistics, please let me know and
I'll try to make it happen.
The most talkative person per session would be interesting :) though perhaps
session time is a PITA to establish particularly
Hello everybody,
I'm trying to use clojure to parse web sites. Unfortunately there is
some problem with following code (used library is Apache Commons HTTP
Client):
(defn request [url]
(let [client (new org.apache.http.impl.client.DefaultHttpClient)]
(with-open [rdr (reader
On Wed, Jan 5, 2011 at 4:40 PM, rainerh rainer.hahnek...@gmail.com wrote:
Hello everybody,
I'm trying to use clojure to parse web sites. Unfortunately there is
some problem with following code (used library is Apache Commons HTTP
Client):
(defn request [url]
(let [client (new
Thanks for sharing this library, I found reading your code to be very
useful.
I need to be able to read and write elf files from within Clojure code,
and Gloss initially looked like a good option. However much of the
streaming support and frame-based conception got in the way of my
particular
Hello everyone,
A while back there was some discussion on the fact that
clojure.java.shell can hang under various circumstances, and some
patches were submitted:
http://dev.clojure.org/jira/browse/CLJ-392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel
But doesn't seem to
Thanks for the suggestion.
My cursory googling has given me the impression that is a function of
the classloader, or otherwise requiring some serious hackery. See
http://stackoverflow.com/questions/2737285/java-is-there-a-way-to-obtain-the-bytecode-for-a-class-at-runtime
The particular use case
also, here's a patch to Gloss which I've used locally but which may be
generally useful.
Cheers -- Eric
Eric Schulte schulte.e...@gmail.com writes:
Thanks for sharing this library, I found reading your code to be very
useful.
I need to be able to read and write elf files from within
On 4 January 2011 19:20, Jon Seltzer seltzer1...@gmail.com wrote:
Why not update the funding from simple donation to a purchase of
clojure/core software like a refined version of the eclipse plugin or
some other incentive based approach? I think I understand why rich
might find 'donation'
I'm unclear on what the correct course of action in this case should be.
However this can be solved by transforming the ratios before and after to
the jsonification: https://gist.github.com/767204
(clojure.walk/postwalk transform-ratio {:a [3/4] :b {:foo {:bar 3/4} :bar
{:a 1}}})
= {:a [{:n
(1) The ticket you reference is marked completed and the patches went in last
July. Is it possible you are seeing a different problem?
(2) Clojure does not depend on anything in the clojure.contrib namespace.
(3) Running inside a pmap should be ok, but make sure you understand the
I completely understand the Rich desire to keep flexibility and fun in
Clojure development. And I think it is important for the success of Clojure.
As for me a donation is much more about what is already done and enforces
little if any obligations.
I hope Rich will accept them from people who
Hi, thanks for the quick response.
Looking at the source code I'm not sure if the patches were applied.
Maybe there was a regression. The symptoms seem consistent with what
was supposed to have been fixed.
Following the clojure.org api docs, I clicked through on the source code link on
Stumbled on another branch of documentation, the code described at
https://github.com/clojure/clojure-contrib/blob/6e721ff777dd52801cafe693868d8118a62076de/src/main/clojure/clojure/contrib/shell.clj#L86
is also without the patches.
On Wed, Jan 5, 2011 at 4:41 PM, kovas boguta
Seth wbu...@gmail.com writes:
The literate programming is actually a contrib to org-mode.
http://orgmode.org/worg/org-contrib/babel/
This has been moved out of contrib and into the Org-mode core, so with
recent versions of Org-mode the code block Literate Programming and
Reproducible Research
Hi,
Seth wbu...@gmail.com writes:
Just discovered org-mode myself --- does anyone know of guide to using
it with clojure for a total newbie?
I havent actually used it for clojure per se. I was just imagining how
it could be used. You have the ability to embed arbitrary code (from
many
Hi Tim,
I'm confused as to what parts of LP practice are not supported by
Org-mode. Are you aware that Org-mode files can be exported to formats
more suitable for publication and human consumption (e.g. woven). See
http://orgmode.org/manual/Exporting.html
Tim Daly d...@axiom-developer.org
For the most up-to-date and comprehensive documentation of using
Org-mode to work with code blocks (e.g. Literate Programming or
Reproducible Research) the online manual is also very useful.
http://orgmode.org/manual/Working-With-Source-Code.html
also, for a good review of Org-mode's support for
All the code you are referring to is in clojure.contrib. Note the comment at
the top of the files:
;; DEPRECATED in 1.2: Promoted to clojure.java.shell
clojure.java.shell is clojure itself, you should not need contrib at all.
Cheers,
Stu
Stumbled on another branch of documentation, the code
On Wed, Jan 5, 2011 at 8:00 PM, Stuart Halloway
stuart.hallo...@gmail.com wrote:
All the code you are referring to is in clojure.contrib. Note the comment at
the top of the files:
;; DEPRECATED in 1.2: Promoted to clojure.java.shell
At the top of which files? If you mean the library's source
Hello everybody,
While I am familiar with Message Passing .. I am not familiar with the
actors model.. but I know about jobim the actor library for clojure.. While
I am exploring more about it myself.. I would like to hear from others as to
how actors compare to Message passing? can they be used
On 1/5/2011 7:37 PM, Eric Schulte wrote:
Hi Tim,
I'm confused as to what parts of LP practice are not supported by
Org-mode. Are you aware that Org-mode files can be exported to formats
more suitable for publication and human consumption (e.g. woven). See
On Wed, Jan 5, 2011 at 4:44 PM, Eric Schulte schulte.e...@gmail.com wrote:
For the most up-to-date and comprehensive documentation of using
Org-mode to work with code blocks (e.g. Literate Programming or
Reproducible Research) the online manual is also very useful.
In literate programming
Actually I did look at the source, but was just looking for the
relevant bits of code rather than perusing the frontmatter.
The main problem was just that there are a lot of references to the
old lib lying around in various forms of documentation that seemed
current.
On Wed, Jan 5, 2011 at
On 1/5/2011 8:27 PM, Mark Engelberg wrote:
On Wed, Jan 5, 2011 at 4:44 PM, Eric Schulteschulte.e...@gmail.com wrote:
For the most up-to-date and comprehensive documentation of using
Org-mode to work with code blocks (e.g. Literate Programming or
Reproducible Research) the online manual is
Anyone know what this bug was called in the bug tracker? I can't find
it in the tracking database to determine the status.
On Sat, Oct 2, 2010 at 5:42 PM, ataggart alex.tagg...@gmail.com wrote:
I just submitted a patch for this issue.
On Oct 1, 2:42 pm, ataggart alex.tagg...@gmail.com wrote:
Neat, looks pretty nice.
I love invitations to nit pick!
database.clj
(defn complete-todo [id]
(dosync (ref-set *todo* (vec (remove #(= (get % :id) id) @*todo*)
1) ref-set is unnecessary you could re-factor this to use alter. The
result is the same, but semantically set only applies when
If you send me a pointer to the link that still pointed to richhic...@github I
will fix it.
Thanks,
Stu
Actually I did look at the source, but was just looking for the
relevant bits of code rather than perusing the frontmatter.
The main problem was just that there are a lot of references
On Wed, Jan 5, 2011 at 8:00 PM, Stuart Halloway
stuart.hallo...@gmail.com wrote:
All the code you are referring to is in clojure.contrib. Note the comment at
the top of the files:
;; DEPRECATED in 1.2: Promoted to clojure.java.shell
At the top of which files? If you mean the library's
On Sun, Jan 2, 2011 at 11:30 AM, Alex Baranosky
alexander.barano...@gmail.com wrote:
Any comments on style, technique or just anythings I missed would be greatly
appreciated. I'm really trying to expand my horizons and perfect the app as
a kind of kata.
Sophisticated! I like it.
I will take
The tickets that came forward from Assembla should have the same numbers they
did in Assembla, since both ticketing systems start with ticket 1.
Works in this case at least: http://dev.clojure.org/jira/browse/CLJ-446.
Stu
Anyone know what this bug was called in the bug tracker? I can't find
One effective way to do it is to change the background color of either
the whole page, or of the title (eg API for shell - clojure-contrib
v1.2 (stable))
An analogous case that is handled well I think:
http://reference.wolfram.com/mathematica/NonlinearRegression/ref/NonlinearRegress.html
On
Thanks for the feedback Timothy, it is appreciated.
map-by key is a good name, I'll change it to that.
As far as I understand zip is different than flatten.
(zip [[1 2] [3 4]]) = ((1 3) (2 4))
(zip [[1 2 3] [4 5 6]]) = ((1 4) (2 5) (3 6))
--
You received this message because you are
On Wed, Jan 5, 2011 at 10:09 PM, Alex Baranosky
alexander.barano...@gmail.com wrote:
Thanks for the feedback Timothy, it is appreciated.
map-by key is a good name, I'll change it to that.
As far as I understand zip is different than flatten.
(zip [[1 2] [3 4]]) = ((1 3) (2 4))
(zip [[1 2 3]
On Wed, Jan 5, 2011 at 8:39 PM, Tim Daly d...@axiom-developer.org wrote:
On 1/5/2011 8:27 PM, Mark Engelberg wrote:
On Wed, Jan 5, 2011 at 4:44 PM, Eric Schulteschulte.e...@gmail.com
wrote:
For the most up-to-date and comprehensive documentation of using
Org-mode to work with code blocks
On Wed, Jan 5, 2011 at 9:40 PM, Stuart Halloway
stuart.hallo...@gmail.com wrote:
On Wed, Jan 5, 2011 at 8:00 PM, Stuart Halloway
stuart.hallo...@gmail.com wrote:
All the code you are referring to is in clojure.contrib. Note the comment
at the top of the files:
;; DEPRECATED in 1.2: Promoted
On Wed, Jan 5, 2011 at 6:14 AM, LauJensen lau.jen...@bestinclass.dk wrote:
Just a quick heads up that ClojureQL 1.0.0 is now released. All
interfaces should be final and there are no known bugs.
Looks really interesting. We're about to start moving some of our web
app back end over to Clojure
I defined it as:
(defn zip [seq-of-seqs]
(apply map list seq-of-seqs))
--
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
On 1/5/2011 10:20 PM, Ken Wesson wrote:
On Wed, Jan 5, 2011 at 8:39 PM, Tim Dalyd...@axiom-developer.org wrote:
On 1/5/2011 8:27 PM, Mark Engelberg wrote:
On Wed, Jan 5, 2011 at 4:44 PM, Eric Schulteschulte.e...@gmail.com
wrote:
For the most up-to-date and comprehensive documentation of
On Wed, Jan 5, 2011 at 4:41 PM, kovas boguta kovas.bog...@gmail.com wrote:
Following the clojure.org api docs, I clicked through on the source code link
on
http://richhickey.github.com/clojure-contrib/shell-api.html
I'm curious as to how you got here? I went to clojure.org, clicked
API,
Now that i think of it, it is mostly a fear of having decreased
productivity in writing code that affected my statement that i liked
the little files. Im used to, i suppose, developing code for a
specific function in a file, being able to compile, goto line numbers
where there are errors,
send
I'm new to the Clojure community (admittedly, I'm only on chapter 6 of
Clojure in Action, so my Clojure skills are sub-sub-par at the
moment), but I was wondering if there were any weekly challenges for
writing Clojure code like there is (was?) for Ruby, i.e:
http://rubyquiz.com/
When I was
In retrospect it probably wasn't clojure.org, but an adjacent tab I
opened from a google search. richhickey.github.com has really high
pagerank :) which can confuse things; also all these branches have
nearly the same visual identity which makes it easy to forget what is
going on.
On Wed, Jan 5,
Mark Engelberg mark.engelb...@gmail.com writes:
On Wed, Jan 5, 2011 at 4:44 PM, Eric Schulte schulte.e...@gmail.com wrote:
For the most up-to-date and comprehensive documentation of using
Org-mode to work with code blocks (e.g. Literate Programming or
Reproducible Research) the online manual
Emacs org-mode, on the other hand, is a useful development
technology but it really isn't literate programming.
I would be interested to hear your thoughts as to why Org-mode is not a
literate programming tool.
I never said org-mode wasn't a 'literate programming tool'. It is clearly an
On Wed, Jan 5, 2011 at 6:42 PM, Stuart Halloway
stuart.hallo...@gmail.com wrote:
The tickets that came forward from Assembla should have the same numbers they
did in Assembla, since both ticketing systems start with ticket 1.
Works in this case at least:
On 1/5/2011 10:58 PM, Seth wrote:
Now that i think of it, it is mostly a fear of having decreased
productivity in writing code that affected my statement that i liked
the little files. Im used to, i suppose, developing code for a
specific function in a file, being able to compile, goto line
On 1/5/2011 11:18 PM, Eric Schulte wrote:
Mark Engelbergmark.engelb...@gmail.com writes:
On Wed, Jan 5, 2011 at 4:44 PM, Eric Schulteschulte.e...@gmail.com wrote:
For the most up-to-date and comprehensive documentation of using
Org-mode to work with code blocks (e.g. Literate Programming
On 1/5/2011 11:19 PM, Eric Schulte wrote:
Emacs org-mode, on the other hand, is a useful development
technology but it really isn't literate programming.
I would be interested to hear your thoughts as to why Org-mode is not a
literate programming tool.
I never said org-mode wasn't a
Can you post examples of these? I'd love to see some other examples.
Sure thing, check out this old version of a file which tangles out into
the directory layout expected by lein.
http://gitweb.adaptive.cs.unm.edu/?p=asm.git;a=blob;f=asm.org;h=f043a8c8b0a917f58b62bdeac4c0dca441b8e2cb;hb=HEAD
On Wed, Jan 5, 2011 at 8:04 PM, John Svazic jsva...@gmail.com wrote:
I'm new to the Clojure community (admittedly, I'm only on chapter 6 of
Welcome!!
Clojure in Action, so my Clojure skills are sub-sub-par at the
moment), but I was wondering if there were any weekly challenges for
writing
On 1/6/2011 12:03 AM, Eric Schulte wrote:
Can you post examples of these? I'd love to see some other examples.
Sure thing, check out this old version of a file which tangles out into
the directory layout expected by lein.
I'm confused by what you expect the decoded value for that string to
look like. Is it:
[[blabla hi hi jg] [ g]]
or
[[blabla hi hi jg\0 g]]
Zach
On Jan 5, 3:36 am, pepijn (aka fliebel) pepijnde...@gmail.com
wrote:
Nothing :(
$ lein repl
REPL started; server listening on
Thanks for the patch! It's too bad that Gloss wasn't directly suited
to your needs, but I appreciate you taking the time to familiarize
yourself with the code and add new functionality.
Zach
On Jan 5, 2:45 pm, Eric Schulte schulte.e...@gmail.com wrote:
also, here's a patch to Gloss which I've
74 matches
Mail list logo