Mark,
Is there a reason that you put the documentation in a comment rather
than as the ns doc string so that autodoc would pick it up? Currently,
priority queues are undiscoverable by autodoc users.
Tom
On Nov 23, 9:41 pm, Mark Engelberg wrote:
> In 1.3, you can use clojure.contrib.priority-map
Hi Luke,
Thanks!
Initially CQL0.1 was motivated by "everything in Clojure" which was
the driving design principle behind the first version of CQL. When
I scrapped that project (for reasons you can read on my blog) I
instead turned my attention towards Relational Algebra as this
gives you unique w
Hi
On 24 November 2010 04:43, Zach Tellman wrote:
> There are a couple of different things being discussed here. I don't
> think there's any harm in allowing maps as frames, as long as people
> understand that they're arbitrarily ordered (alphabetically by key,
> but that's an implementation det
2010/11/24 HiHeelHottie :
>
> Does anybody know of an implementation for a priority queue that can
> be used for scheduling events in the future? I would like to put a
> map associated with a timestamp into the queue and be able to pull out
> all maps at or before a given time in order.
I would a
Hello everybody,
I just wrote a simple macro for debugging the ->> .. just thought of
sharing it with you all
(defmacro print-and-return
([x]
`(let [x# ~x]
(println x#) x#))
([flag x]
`(let [flag# '~flag
x# ~x]
(println flag#)
(println x#)
I was looking for it, but to no avail!
Anyway, something I was wondering about. Why don't we take the best
from all possible worlds? In this case, Clojure and Scheme (R6RS). It
would be nice to have syntax-quote, unquote, and unquote-splicing as
true macros (or special forms), and keep `, ~, and ~
Can someone please explain why an insert into a vector:
(insert my_vec [:a :b :c] (range 10))
would be of linear time complexity based on the size of the second
argument? I would have thought that this would boil down to something
like adding a reference to the first element of the sequence returne
Hi,
On 24 Nov., 11:35, Andreas Kostler
wrote:
> Where's the flaw in my thinking there?
This is what (concat ...) does. However, a vector promises O(log32 N)
random access, which you can't if you don't add elements of the second
argument into the vector structure. Then you can only promis O(n) f
No reason other than my lack of knowledge that ns doc strings are picked up
by autodoc and comments are not. :)
On Wed, Nov 24, 2010 at 12:36 AM, Tom Faulhaber wrote:
> Mark,
>
> Is there a reason that you put the documentation in a comment rather
> than as the ns doc string so that autodoc would
Thanks for the answers!
Some guy told me on irc that you can implement interfaces right in the
record definition like
(defrecord R [a b] SomeInterface (methods...))
Regards.
Islon
On Nov 24, 4:25 am, Shantanu Kumar wrote:
> Shantanu Kumar wrote:
> > Islon Scherer wrote:
> > > Yes, java serializa
On 24 November 2010 02:11, JMatt wrote:
> The easiest way to prevent divergence is to write and use native
> clojure libraries.
I totally agree. However because of clojure's excellent interop
capabilities it is extremely common (in fact encouraged) for
developers to directly use Java code. For ex
JVM stores numbers in in big endian format - is there a way to process
binary stream containing little endian numbers?
Zoka
On Nov 24, 7:24 am, Zach Tellman wrote:
> Good question. The solution didn't make the cut for my initial
> release, but will be added soon. My plan is to have an (ordered
On Nov 23, 6:55 pm, Constantine Vetoshev wrote:
> appengine-magic abstracts away nearly all the boilerplate necessary to
> deploy an App Engine application. It also enables interactive
> development through the REPL. The new version has full support for
> many App Engine services: the datastore, m
All:
Join us at FOSDEM 2011 to be part of our sessions where
we'll discuss the state of Free Java!
This is the PERFECT place to talk about cool things
going on with Clojure such as taking advantage of JDK 7
or JDK 8 features *today* through OpenJDK trunk.
Typically this conference has brought tog
I thought about that a little too. The thing is that clojure is doing
something almost imposible. There is almost know way around writing
you json library backand in clr interop.
If we want to make clojure programm that run on the clr, the jvm and
possibly in the browser we have to write pure cloj
On Nov 24, 12:42 am, Michael Wood wrote:
> Hi
>
> On 24 November 2010 04:43, Zach Tellman wrote:
>
> > There are a couple of different things being discussed here. I don't
> > think there's any harm in allowing maps as frames, as long as people
> > understand that they're arbitrarily ordered (al
ByteBuffers have an order() method which allows you to toggle the
endianness. I haven't tested this, but since everything is built on
top of Java's ByteBuffer functionality it should be fine as long as
the ByteBuffers are correctly set and correctly ordered with respect
to each other.
Zach
On No
Here is the Enclojure ticket -
https://www.assembla.com/spaces/enclojure/tickets/83-rebinding-of-vars-does-not-work-in-ide-repl--e-g--*print-meta*--*warn-on-reflection*
> On 4 November 2010 15:11, Ken Wesson wrote:
>
>> The website has this example:
>>
>> (set! *warn-on-reflection* true)
>> -> t
OK, I'm doing stuff there now.
I'll move the comment to the ns doc string, then.
There are still issues with autodoc and protocols/types, but priority
queues look like they'll be a good sandbox for resolving them.
Tom
On Nov 24, 2:51 am, Mark Engelberg wrote:
> No reason other than my lack of
Thanks!
On Wed, Nov 24, 2010 at 8:30 AM, Tom Faulhaber wrote:
> OK, I'm doing stuff there now.
>
> I'll move the comment to the ns doc string, then.
>
> There are still issues with autodoc and protocols/types, but priority
> queues look like they'll be a good sandbox for resolving them.
>
> Tom
>
I am a physicist. I have been using Clojure full time for the last
year and a half. The reasons that Rich (and most other Clojure
evangelists) give for using Clojure, are all nice and good, but they
point to what computer scientists think about. If you want scientists
and engineers to think abou
2010/11/24 cej38 :
> 5. ease of changing function calls to allow for extra stuff/
> functionality without breaking other stuff. An example would be best
> here. Suppose I had defined some function that worked for a specific
> purpose:
>
> (defn setzero [value]
> "If value is less than 1.0E-8 set
On Nov 24, 6:41 am, Vesa Marttila wrote:
> I have a question about this release: I understood from this release
> announcement that entities can be saved from the REPL, but I was not
> able to do so and the official documentation still states that it
> can't be
> done, which is the case?
You can'
yes
On Nov 24, 12:28 pm, Joop Kiefte wrote:
> 2010/11/24 cej38 :
>
>
>
>
>
> > 5. ease of changing function calls to allow for extra stuff/
> > functionality without breaking other stuff. An example would be best
> > here. Suppose I had defined some function that worked for a specific
> > purpo
> I am a physicist. I have been using Clojure full time for the last
> year and a half. The reasons that Rich (and most other Clojure
> evangelists) give for using Clojure, are all nice and good, but they
> point to what computer scientists think about. If you want scientists
> and engineers to
I use Enclojure.
It works quite well though has some bugs. For example *warn-on-reflection*
can not be set from its REPL. I use a standalone REPL for this case.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to cloj
Having a fast code is important, but as I have often said to
colleagues, computer time is cheap, my time is not. If I can write
code that does the same thing in two languages, and the code written
in one language runs in half the time of the other, while the code in
the other language took half th
+1
--
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 with your
first post.
To unsubscribe from this group, send email to
cl
Another thought:
9. Unit testing is much easier! The effort it takes to write unit
tests is Fortran is so high, it might as well be impossible, and thus
almost no one does it.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, se
I gave some thought to the Integer vs. Int32 issue.
I think what would help here is a way to alias classes when :importing them.
It would require tweaking the ns macro and possibly parts of the
runtime. The outcome would be to allow something like
(ns foo
(:import (java.util.concurrent
On Wed, Nov 24, 2010 at 1:33 PM, Sergey Didenko
wrote:
> I use Enclojure.
>
> It works quite well though has some bugs. For example *warn-on-reflection*
> can not be set from its REPL. I use a standalone REPL for this case.
Actually it can be set. There seems to be a bug in 1.4.0 with
buffering.
On Wed, Nov 24, 2010 at 11:18 AM, Sergey Didenko
wrote:
> Here is the Enclojure ticket -
> https://www.assembla.com/spaces/enclojure/tickets/83-rebinding-of-vars-does-not-work-in-ide-repl--e-g--*print-meta*--*warn-on-reflection*
It seems to me that *warn-on-reflection* is working, but the
reflect
That was me and I blogged it for good measure (
http://tech.puredanger.com/2010/11/23/implementing-java-interfaces-with-clojure-records/
) and added the example to clojure docs (
http://clojuredocs.org/clojure_core/clojure.core/defrecord#example_550
).
On Nov 24, 6:10 am, Islon Scherer wrote:
> T
I highly recommend jedis for redis java lib. It supports connection
pooling, pub/sub.
and works with the 2.0 protocol.
https://github.com/xetorthio/jedis
Any reason why you want to use both memcached and redis at the same time?
redis is basically memcached++, with collection/queue support as valu
On Wed, 24 Nov 2010 09:20:49 -0800 (PST)
cej38 wrote:
> I am a physicist. I have been using Clojure full time for the last
> year and a half. The reasons that Rich (and most other Clojure
> evangelists) give for using Clojure, are all nice and good, but they
> point to what computer scientists
Thanks... I think I do see the benefit. I'll certainly give it a try
and see if I can get the feel of it.
One question... You say it generates optimized SQL. Does it take the
DBMS into account? I know the performance profiles of various SQL
idioms vary widely between MySQL and Oracle, for example
On Wed, 24 Nov 2010 00:37:07 -0800 (PST)
LauJensen wrote:
You just touched on an idiom I see fairly often here that bugs me. I'm
not intentionally singling you - or CQL! - out for this, but you made
a comment that sets up my question perfectly.
> (let [photo-counts (-> (table :photos)
>
2010/11/24 Mike Meyer
> On Wed, 24 Nov 2010 00:37:07 -0800 (PST)
> LauJensen wrote:
>
> You just touched on an idiom I see fairly often here that bugs me. I'm
> not intentionally singling you - or CQL! - out for this, but you made
> a comment that sets up my question perfectly.
>
> > (let [photo
Extension of
http://groups.google.com/group/clojure/browse_thread/thread/7c917e983f345723/a7ee771a7bcaaefc
Hi everyone!
I've extended the Clojure core to extend durability to functions and
closures.
1. Functions with lexical and dynamic bindings are now supported. This
includes functions that g
No problem Luke.
ClojureQL does not take the backend in to account. This is the one
feature from the old CQL that I didn't want to carry over because it
would be impossible for me to cater to all backends. If you hit
specific problems, let me know and I'll see what we can do.
We adhere to SQL92 a
On 24 November 2010 21:40, Mike Meyer
wrote:
> Could someone explain where this urge to write (-> expr (func arg))
> instead of (func expr arg) comes from?
I like to use -> and ->> because they allow me to add more steps to
the "pipeline" as needed, without requiring ever more deeply nested
paren
On Wed, 24 Nov 2010 22:51:09 +0100
Daniel Werner wrote:
> On 24 November 2010 21:40, Mike Meyer
> wrote:
> > Could someone explain where this urge to write (-> expr (func arg))
> > instead of (func expr arg) comes from?
>
> I like to use -> and ->> because they allow me to add more steps to
> t
2010/11/24 Mike Meyer
> On Wed, 24 Nov 2010 22:51:09 +0100
> Daniel Werner wrote:
>
> > On 24 November 2010 21:40, Mike Meyer
> > wrote:
> > > Could someone explain where this urge to write (-> expr (func arg))
> > > instead of (func expr arg) comes from?
> >
> > I like to use -> and ->> becaus
> ClojureQL does not take the backend in to account. This is the one
> feature from the old CQL that I didn't want to carry over because it
> would be impossible for me to cater to all backends. If you hit
> specific problems, let me know and I'll see what we can do.
>
> We adhere to SQL92 and test
On Nov 24, 7:58 pm, Constantine Vetoshev wrote:
> You can't directly use datastore functions from the REPL. When I said
> "interactive development through the REPL", I meant the ability to
> recompile individual files and functions inside a running application
> — this definitely works across the
Very nice
On Tue, Nov 23, 2010 at 4:03 PM, Tyler Perkins wrote:
> Nice! And with just a bit more, we have a clean, sorting DSL:
>
> (def asc compare)
> (def desc #(compare %2 %1))
> ;; compare-by generates a Comparator:
> (defn compare-by [& key-cmp-pairs]
> (fn [x y]
> (loop [[k cmp & mor
I must admit that even though I love Clojure and use it daily for many
things, I don't like using it very much for my research (machine
learning) which involves a lot of number crunching.
The main reasons being:
Numerical software involves a lot of array indexing, and loops, and
not much else. Cl
Hello everybody,
I just needed a function for every-nth element in a sequence.. I know it
can be trivially implemented as ..
(defn every-nth [n coll]
(letfn [(evn [cn s]
(when s
(if (= cn 1)
(lazy-seq (cons (first s) (evn n (next s
(
> I just needed a function for every-nth element in a sequence.. I know it
> can be trivially implemented as ..
> (defn every-nth [n coll]
> (letfn [(evn [cn s]
> (when s
> (if (= cn 1)
> (lazy-seq (cons (first s) (evn n (next s
> (ev
On Wed, Nov 24, 2010 at 11:11 PM, Baishampayan Ghose wrote:
>> I just needed a function for every-nth element in a sequence.. I know it
>> can be trivially implemented as ..
>> (defn every-nth [n coll]
>> (letfn [(evn [cn s]
>> (when s
>> (if (= cn 1)
>>
On Nov 24, 2010, at 11:45 PM, Ken Wesson wrote:
> On Wed, Nov 24, 2010 at 11:11 PM, Baishampayan Ghose
> wrote:
>>> I just needed a function for every-nth element in a sequence.. I know it
>>> can be trivially implemented as ..
>>> (defn every-nth [n coll]
>>> (letfn [(evn [cn s]
>>>
On Wed, Nov 24, 2010 at 11:53 PM, David Sletten wrote:
>
> On Nov 24, 2010, at 11:45 PM, Ken Wesson wrote:
>
>> On Wed, Nov 24, 2010 at 11:11 PM, Baishampayan Ghose
>> wrote:
I just needed a function for every-nth element in a sequence.. I know it
can be trivially implemented as ..
>>
I stand corrected. I thought it required another arg. Yours was right already.
On Nov 24, 2010, at 11:53 PM, David Sletten wrote:
>
> On Nov 24, 2010, at 11:45 PM, Ken Wesson wrote:
>
>> On Wed, Nov 24, 2010 at 11:11 PM, Baishampayan Ghose
>> wrote:
I just needed a function for every-nth
Eh. This is weird. It seems that (partition n coll) drops the last
part of coll if it's not a multiple of n in size; e.g. (partition 3 [1
2 3 4 5]) yields ((1 2 3)) and not ((1 2 3) (4 5)). (partition n n []
coll) does do that though.
OTOH,
(mapcat identity (partition 1 n coll))
(apply concat (pa
Hello everybody,
Is there a function which can tell me if a particular symbol was generated
by gensym or was present in the code?
Sunil.
--
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
Not
Thanks everybody,
Clojure community is awesome .. and also I just wanted to learn to use
lazy-seq that is why it was written in the way I showed you all.
Thanks again.
Sunil.
On Thu, Nov 25, 2010 at 11:26 AM, Ken Wesson wrote:
> Eh. This is weird. It seems that (partition n coll) drops the las
On Thu, Nov 25, 2010 at 1:06 AM, Sunil S Nandihalli
wrote:
> Hello everybody,
> Is there a function which can tell me if a particular symbol was generated
> by gensym or was present in the code?
> Sunil.
I don't think so.
On the other hand:
(def my-gensyms (atom #{}))
(defn my-gensym
([]
On 25 November 2010 16:56, Ken Wesson wrote:
> Eh. This is weird. It seems that (partition n coll) drops the last
> part of coll if it's not a multiple of n in size; e.g. (partition 3 [1
> 2 3 4 5]) yields ((1 2 3)) and not ((1 2 3) (4 5)). (partition n n []
> coll) does do that though.
>
See al
Hi Brenton,
Yes the OFFSET/LIMIT syntax differs from backend to backend. However
in some instances (like MySQL/PostgreSQL) they have ensured
compatability so that the same statement will run on several DBs
although the syntax might not be considered 'native'. For something
like Oracle there actual
Hi,
On 25 Nov., 05:06, Sunil S Nandihalli
wrote:
> (defn every-nth [n coll]
> (letfn [(evn [cn s]
> (when s
> (if (= cn 1)
> (lazy-seq (cons (first s) (evn n (next s
> (evn (dec cn) (next s)]
> (evn n coll)))
Since you want
Hello everybody,
I was trying to learn to write clojure macros and the code is posted here
in the following link
https://gist.github.com/715047
There are basically three macros
1. with-seperator - a zero argument macro and is supposed to just draw a
line to indicate beginning and ending of the ex
61 matches
Mail list logo