Excellent - thanks for clarifying this!
- Korny
On Sun, Feb 8, 2009 at 12:27 AM, Rich Hickey richhic...@gmail.com wrote:
On Feb 7, 2009, at 3:43 AM, Korny Sietsma wrote:
Ah - I didn't realise that. I was trying to avoid the overhead, as I
understood it, of both converting the parameters
Hi,
Am 08.02.2009 um 00:40 schrieb samppi:
(defn conc* [tokens subrules]
(loop [subrule-queue (seq subrules), remaining-tokens (seq tokens),
products []]
(if (nil? subrule-queue)
[products remaining-tokens]
(let [[subrule-products subrule-remainder :as subrule-result]
So far this is fantastic! And I haven't even got around to playing with the
restart mechanism :) I'm using it in Spinoza to provide contextual errors
(malformed slot list, missing base class etc.). I notice the contrib
libraries in general are very good at throwing exceptions so that consumers
On Sun, Feb 8, 2009 at 5:18 AM, David Nolen dnolen.li...@gmail.com wrote:
Sweet!
I'm glad it's working for you, and that you have figured out how to
use it despite the almost complete lack of docs. :-P
That said I do have one minor annoyance and that is the need to leave an
empty bracket
Can someone show me an example of a good use of if-let?
I find its doc string a little confusing. It says If test is true,
evaluates then with binding-form bound to the value of test, if not,
yields else. However, it doesn't have a parameter named test. I
assume it means If the binding evaluates
Hi,
Am 08.02.2009 um 15:47 schrieb Adrian Cuthbertson:
Here's one, I'm setting basedir to either :basedir in a map in *locs
(a thread-local var) or to . if :basedir was not found in the map...
(let [basedir (if-let [bdir (:basedir *locs)] bdir .)]
...)
i.e bdir assumes the value of the
Thanks Meikel. There's always something new to learn. I'm also fast
learning that if something doesn't look quite elegant in one's code,
then there's bound to be an elegant clojure way of doing it!
On Sun, Feb 8, 2009 at 4:51 PM, Meikel Brandmeyer m...@kotka.de wrote:
Hi,
Am 08.02.2009 um
Hi all,
Say I have a collection of delays, some of which need to get others'
values in order to compute (there are no cyclic dependencies). If I
just pmap force over the entire collection, do I run the risk of
filling up a thread pool with operations that aren't ready to go yet?
Would it be
Hello again,
In my application, I'll frequently want to quickly discard all the
changes made during a transaction involving many refs. I don't want to
force the refs to roll back to their values at the beginning of the
transaction, I just want to end the transaction immediately and skip
the
reposted to correct a mistake in my use of X, Y and Z:
---
I agree with Jeffrey that there is no reason to have just one option.
Sometimes you want your reasoner to find a single model; sometimes you want
it to find all models (assuming you are reasoning over a finite set).
I've
I am using IDEA 9164. Make sure idea.jar is on your classpath (it is
not part of the Development SDK).
BTW to original plugin is still available pre-built. It works fine on
Linux and Windows. See
http://code.google.com/p/clojure-intellij-plugin/
Howard Lewis Ship wrote:
I'm trying to
Oh, yeah. Silly me, I *can* do that.
Thanks a lot. It works like a charm now.
On Feb 8, 2:17 am, Meikel Brandmeyer m...@kotka.de wrote:
Hi,
Am 08.02.2009 um 00:40 schrieb samppi:
(defn conc* [tokens subrules]
(loop [subrule-queue (seq subrules), remaining-tokens (seq tokens),
I don't think you can. There is no rollback function available.
On Sun, Feb 8, 2009 at 12:23 PM, Anand Patil
anand.prabhakar.pa...@gmail.com wrote:
Hello again,
In my application, I'll frequently want to quickly discard all the
changes made during a transaction involving many refs. I
On Feb 8, 7:29 pm, Shawn Hoover shawn.hoo...@gmail.com wrote:
On Sun, Feb 8, 2009 at 12:23 PM, Anand Patil
anand.prabhakar.pa...@gmail.com wrote:
Hello again,
In my application, I'll frequently want to quickly discard all the
changes made during a transaction involving many refs. I
I'm trying to use the sql contrib library to connect to a Postgres
database. It's not clear to me how to specify a username and password.
Here's what I'm trying.
(use 'clojure.contrib.sql)
(let [db-host localhost
db-name ct
db-port 5432
subname (str // db-host : db-port /
I am intermittently getting the following error when I attempt to
perform an incremental compilation of a set of Clojure source files.
To be clear, I mean incremental where I've previously compiled the
sources down to classfiles, then changed one or more source files, and
then run
On Feb 8, 2009, at 4:04 PM, Mark Volkmann wrote:
The error I get is org.postgresql.util.PSQLException: FATAL: no
PostgreSQL user name specified in startup packet. I think the problem
is that the username and password values in db aren't used by
with-connection unless a DataSource object is
Please let us know if this works.
On Sun, Feb 8, 2009 at 4:23 PM, Stephen C. Gilardi squee...@mac.com wrote:
On Feb 8, 2009, at 4:04 PM, Mark Volkmann wrote:
The error I get is org.postgresql.util.PSQLException: FATAL: no
PostgreSQL user name specified in startup packet. I think the problem
On Sun, Feb 8, 2009 at 3:23 PM, Stephen C. Gilardi squee...@mac.com wrote:
On Feb 8, 2009, at 4:04 PM, Mark Volkmann wrote:
The error I get is org.postgresql.util.PSQLException: FATAL: no
PostgreSQL user name specified in startup packet. I think the problem
is that the username and password
Great!
On Sun, Feb 8, 2009 at 5:05 PM, Mark Volkmann r.mark.volkm...@gmail.comwrote:
On Sun, Feb 8, 2009 at 3:23 PM, Stephen C. Gilardi squee...@mac.com
wrote:
On Feb 8, 2009, at 4:04 PM, Mark Volkmann wrote:
The error I get is org.postgresql.util.PSQLException: FATAL: no
PostgreSQL
I have this piece of code:
(defn- run-work-elements-in-parallel
Runs a group of work elements in parallel. Returns an extended database.
[elements database]
(assert (set elements))
(let [[rec simp] (separate :recursive elements)
results-simp (pmap #(run-simple-work-element %
I am not sure exactly how preduce differs from normal reduce, but
reduce is not a lazy operation, so it will result in the realization
of a lazy seq passed to it.
On Sun, Feb 8, 2009 at 2:13 PM, Jeffrey Straszheim
straszheimjeff...@gmail.com wrote:
I have this piece of code:
(defn-
The second argument to the with-query-results macro needs to be a
vector containing a query string and optional values to be inserted
into the query if it is parameterized. Would it be difficult to change
this so in the case that the query is not parameterized, a string can
be passed for the
You're probably correct, but I'm still interested in the question in the
more general sense.
On Sun, Feb 8, 2009 at 5:17 PM, Kevin Downey redc...@gmail.com wrote:
I am not sure exactly how preduce differs from normal reduce, but
reduce is not a lazy operation, so it will result in the
Hi all,
I was using clojure.inspector in my code, and to my surprise it failed
when I applied it to a structure containing sets. The error message
was that nth is not supported on the type PersistentHashSet. I've
included a trivial patch below that seems to fix the problem.
I'm not sure I
When I learn a new language, one of the programs I like to write as an
excercise is the n-queens problem (http://en.wikipedia.org/wiki/
8_queens). I wrote the program below which runs correctly. Using depth-
first search, I have used it to find the solutions for board sizes up
to 11 (after which
Hi all,
I was wanting to create a dialog box in a (predominantly command-line)
application where the action of the user on the dialog box is returned
to the code that requested the dialog so we can branch based on the
selection. It seems the most natural way of doing this in a functional
Hi,
I want to suggest a pipe macro for dealing with collection streams,
as a one-line variation on the built in - macro.
Instead of writing a nested stream like this:
; Take the first 3 elements of the odd numbers in the range 1 to
20
(take 3 (filter odd? (range 1 20)))
you can write this:
(def a (ref 1))
(def b (ref 1))
; Do these concurrently, either from separate agents or using pmap
(dosync (commute b error-throwing-fn a))
(dosync (commute a + @b))
I want to have the option to abort the first transaction without
rolling back the second. Based on what you said, if the
On Sun, Feb 8, 2009 at 12:23 PM, Anand Patil
anand.prabhakar.pa...@gmail.com wrote:
Hello again,
In my application, I'll frequently want to quickly discard all the
changes made during a transaction involving many refs. I don't want to
force the refs to roll back to their values at the
Stratified negation is working and in trunk.
I have some cool ideas of a simple, but powerful, way to implement
evaluable predicates. They'll likely make it in by midweek.
The the hard part (magic sets) begins.
On Feb 8, 11:43 am, Jeffrey Straszheim straszheimjeff...@gmail.com
wrote:
I now
Perhaps you are forcing a very long lazy list?
Try (.printStackTrace *e)
On Sun, Feb 8, 2009 at 9:41 AM, jodocus rjek...@gmail.com wrote:
When I learn a new language, one of the programs I like to write as an
excercise is the n-queens problem (http://en.wikipedia.org/wiki/
8_queens
In fact, try this:
(defn add-children [searchtype statelist]
(let [c (children (first statelist))
s (rest statelist)]
(cond
(= searchtype :breadth-first) (doall (concat s c))
(= searchtype :depth-first) (doall (concat c s)
The doall forces the lists
A JDialog is going to run on the GUI thread and you can't change that.
There are various concurrency tools in Java that will give you what you
want. The easiest is to wait create a SynchronousQueue. Check the Java API
docs.
On Sat, Feb 7, 2009 at 6:15 PM, Tim Martin t...@asymptotic.co.uk
On Sun, Feb 8, 2009 at 10:16 AM, Mark Volkmann
r.mark.volkm...@gmail.com wrote:
I know print and println are intended for human readable output,
whereas pr and prn produce output that can be read by the Clojure
reader. I'm trying to find some cases where these differ. So far I've
only found
Hi folks,
I'm getting to the stage on a Clojure project that I want to start
breaking the code into multiple files. My primary environment is
Emacs Slime and interactive development. Is there a standard way
for me to load all of my project's files into the running VM?
Right now I manually go
On Feb 9, 1:05 am, Bradbev brad.beveri...@gmail.com wrote:
Hi folks,
I'm getting to the stage on a Clojure project that I want to start
breaking the code into multiple files. My primary environment is
Emacs Slime and interactive development. Is there a standard way
for me to load all of
37 matches
Mail list logo