On Sun, Aug 8, 2010 at 10:32 PM, Meikel Brandmeyer m...@kotka.de wrote:
I'm bit confused about what you mean here, but vector append (read:
conj) is O(1) (don't nail me down on whether it's amortised). There is
no array copying going on underneath.
Assuming vector is implemented in some form
On Sun, Aug 8, 2010 at 10:50 PM, Meikel Brandmeyer m...@kotka.de wrote:
Hi,
On Aug 8, 6:19 pm, gary ng garyng2...@gmail.com wrote:
I wrote a similar version in F# which does have the advantage of
handling infinite input or a very long partition in the sense that I
can still consume the
The follow is the ring's source, and I am a newbie in Clojure.
what the defn of run-jetty looks like this form, what's the meaning of
#^Server in the defn and let?
Thanks in advance.
Limux.
(defn #^Server run-jetty
Serve the given handler according to the options.
Options:
:configurator
On Aug 9, 8:25 am, limux liumengji...@gmail.com wrote:
what's the meaning of
#^Server in the defn and let?
(defn #^Server run-jetty
...
(let [#^Server s (create-server (dissoc options :configurator))]
It's a type hint. In the defn it specifies the type of the return
value, in the let it
Hi,
On Aug 9, 8:06 am, gary ng garyng2...@gmail.com wrote:
Assuming vector is implemented in some form of array(well it seems to
have the characteristic of an array where accessing any element would
be O(1)), appending one element can be O(1) if there are space
reserved for some extra items
I see, heartly thanks, and there is no any words about it in API doc
of clojure.org yet!
Regards
limux.
On 8月9日, 下午3时04分, j-g-faustus johannes.fries...@gmail.com wrote:
On Aug 9, 8:25 am, limux liumengji...@gmail.com wrote:
what's the meaning of
#^Server in the defn and let?
(defn
The type hint can be placed on function parameters, let-bound names,
var names, and expressions.
And it can be placed behind or ahead of them. Isn't it?
On 8月9日, 下午3时31分, limux liumengji...@gmail.com wrote:
I see, heartly thanks, and there is no any words about it in API doc
of clojure.org
I am not 100% sure, but it seems they are always ahead.
(defn ^Bar foo ...)
tells that function foo returns something of class Bar.
(f ^Bar expr) says that expr is of type Bar.
(let [ ^Bar e expr] ... says that e is of type Bar.
(Bar can be a class or an interface.)
The main usage (at least
On Sat 07/08/10 14:02 , Stuart Halloway stuart.hallo...@gmail.com sent:
No. We want to collect more information and do more comparisons before
moving away from the recommended Java buffering.
Stu
This isn't an issue with the buffering, it is an issue with the massive
overhead of doing
Dear all,
I can't find a function in the library and don't see any easy way to write it.
I am looking for something like (zip seqs)
such that (zip [a1 an] [b1 bn]) = [[a1 b1] . [an bn]]
Any function like that or easy way to construct it?
Best regards,
Nicolas.
--
You
Hi,
On Aug 9, 12:21 pm, Nicolas Oury nicolas.o...@gmail.com wrote:
(zip [a1 an] [b1 bn]) = [[a1 b1] . [an bn]]
(map vector [a1 ... an] [b1 ... bn])
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this
This isn't an issue with the buffering, it is an issue with the massive
overhead of doing character at a time i/o - it is something that you really
should never ever do. I'd say something somewhere doing character at a
time i/o is probably the number one cause of crippling performance
Thank you very much, it works great.
On Mon, Aug 9, 2010 at 11:23 AM, Meikel Brandmeyer m...@kotka.de wrote:
Hi,
On Aug 9, 12:21 pm, Nicolas Oury nicolas.o...@gmail.com wrote:
(zip [a1 an] [b1 bn]) = [[a1 b1] . [an bn]]
(map vector [a1 ... an] [b1 ... bn])
Sincerely
Meikel
On Aug 7, 5:43 am, Peter Schuller peter.schul...@infidyne.com wrote:
Interesting. Why do you consider it recommended to read one character
at a time in a case like this? Maybe there is such a recommendation
that I don't know about, but in general I would consider it contrary
to expected
David - Thanks for the tip.
I look forward to your REPL interaction; I think this is important for
TextMate users to have a good time.
On Aug 7, 11:38 pm, David Nolen dnolen.li...@gmail.com wrote:
On Sat, Aug 7, 2010 at 4:47 PM, frou m...@frou.org wrote:
Searching Google, I see there are
Maybe this seems like a low-priority issue but I think slurp is likely
to be very commonly used. For instance, the Riak tutorial just posted
to Hacker News uses it:
http://mmcgrana.github.com/2010/08/riak-clojure.html
In the past I've steered clear of using slurp because it didn't hand
Dear all,
I have made a very small library, which is very preliminary but usable.
It allows to create a distribution and draw from it.
Insertions, deletions, drawing are in O(log n).
example:
(def dist (distribution-from-seqable {:a 1 :b 2}))
(draw dist) = :a with proba 1/3, :b with proba
Hello everybody,
I have been trying to use the native libraries in clojure. I have
found clj-native and clojure-jna which may serve the purposes. I would
like to get a feed back from the community .. Which of these is good
to use .. Or do you have any other suggestions..
Thanks in advances...
On Mon, Aug 9, 2010 at 10:55 AM, Sunil Nandihalli
sunil.nandiha...@gmail.com wrote:
Hello everybody,
I have been trying to use the native libraries in clojure. I have
found clj-native and clojure-jna which may serve the purposes. I would
like to get a feed back from the community .. Which of
Thanks jf, that worked:
(ns msms
(:gen-class)
(:use [clojure.contrib.shell-out :only (sh)]))
(defn get-msms-pts-OSX
[{pdb-file :pdb-file density :density radius :radius :as all :or
{density 1.0 radius 1.5}}]
(if (contains? all :pdb-file)
(sh bash :in (str
Hello everyone,
Just for educational purposes, I'm writing a simple lisp compiler and
am stuck on a small problem.
I'm trying to write a function called (compile-function), which will
take a function as input and compile it.
If that function calls other functions, I would like (compile-
On Aug 9, 7:54 pm, CuppoJava patrickli_2...@hotmail.com wrote:
Hello everyone,
Just for educational purposes, I'm writing a simple lisp compiler and
am stuck on a small problem.
I'm trying to write a function called (compile-function), which will
take a function as input and compile it.
On Mon, 9 Aug 2010 09:37:14 -0700 (PDT)
Dave david.dreisigme...@gmail.com wrote:
Thanks jf, that worked:
(ns msms
(:gen-class)
(:use [clojure.contrib.shell-out :only (sh)]))
(defn get-msms-pts-OSX
[{pdb-file :pdb-file density :density radius :radius :as all :or
{density 1.0
Thanks for the reply Jarkko. That helps quite a lot. I have some hacks
in place that works most of the time, but was stuck trying to figure
out a general solution. Knowing that there isn't one puts my mind at
ease.
-Patrick
On Aug 9, 1:56 pm, Jarkko Oranen chous...@gmail.com wrote:
On Aug 9,
I was going to try out a compojure tutorial in Eclipse. It appears
that only .clj files and not the .class files are included in the
compojure jar file.
I'm seeing the following error:
java.io.FileNotFoundException: Could not locate compojure/
core__init.class or compojure/core.clj on classpath:
Hi,
How could I help you from the Eclipse side ? I don't totally understand the
steps you're following in Eclipse / counterclockwise (but maybe it's not an
eclipse / counterclockwise problem ?)
2010/8/9 scott jscotthic...@gmail.com
I was going to try out a compojure tutorial in Eclipse. It
On Aug 4, 5:33 pm, Alex Tkachman alex.tkach...@gmail.com wrote:
Guys,
Thanks fo reference. I am still be curious if it should be done
directly in Clojure runtime and available if clojure.jar is in
classpath
Hello Alex,
You can easily use clojure.jar but there are a number of
Hi all, I'm new to the group; I have some experience with both CL and
Java, though it's been a while for each. Anyway I really like Clojure
as a way of combining the best parts of the two languages, but I'm
still getting the hang of it and there are often things that confuse
me.
For example, I
On Aug 4, 3:51 pm, Matt Fowles matt.fow...@gmail.com wrote:
Alex~
There is a project on github that does exactly this.
http://github.com/krukow/clj-ds
I don't know much about the current state of it, but I have plans in the
next month or so to try it out at work.
you can do this using partition.
let's assume I first define a
user= (def a [:w :n :e :s])
#'user/a
user= (partition 2 1 (conj a (first a)))
((:w :n) (:n :e) (:e :s) (:s :w))
gives you the pairs you need.
then you just need to turn it into hash-map
by doing
(map #(apply hash-map %)
Does someone know if there is a ticket open for this already?
Best,
Nicolas.
--
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
I have the tutorial described below working, using Emacs and
Leiningen.
http://mmcgrana.github.com/2010/07/develop-deploy-clojure-web-applications.html
I created a new Clojure project in Eclipse. I created a lib
directory, imported the dependent jar files that Leiningen pulled from
a repo into
It works with booleans:
user= (drop-while neg? [-3 -2 -1 0 1 2 3 ])
(0 1 2 3)
user= (class (neg? -5))
java.lang.Boolean
On Aug 9, 12:09 pm, Alan a...@malloys.org wrote:
Hi all, I'm new to the group; I have some experience with both CL and
Java, though it's been a while for each. Anyway I
On Aug 9, 2:09 pm, Alan a...@malloys.org wrote:
Hi all, I'm new to the group
Welcome!
I wanted to define a ring function, which takes as input
N objects, and returns a hash table mapping object N to object N+1
(mod N). I intended to use this to describe a compass object:
(ring :w :n :e :s)
On Aug 9, 5:08 am, rob r.p.l...@gmail.com wrote:
As far as I can tell, based on using it so far, the war plugin for
leiningen requires writing a web.xml file. I was just wondering why
it doesn't generate that xml file for you based on the information
you've specified already in leiningen.
As far as I know, the book Lisp In Small Pieces should be a tremendous
help for anyone who builds a Lisp interpreter or compiler. You might want to
check it out.
On Mon, Aug 9, 2010 at 2:21 PM, CuppoJava patrickli_2...@hotmail.comwrote:
Thanks for the reply Jarkko. That helps quite a lot. I
It is impossible (undecidable) to tell precisely which functions a
function will call. Therefore you will need to consider not exactly
set of functions that a function will call, but some superset of that.
Why not take as your superset all functions? That is, always compile
all functions.
On Aug
Also sorry the indentation is so awful. How do I get Google to let me
compose/edit in a fixed-width font?
On Aug 9, 12:09 pm, Alan a...@malloys.org wrote:
Hi all, I'm new to the group; I have some experience with both CL and
Java, though it's been a while for each. Anyway I really like Clojure
Weird. I wonder if I was using an outdated version of Clojure or (more
likely) assumed from (doc drop-while) that it wouldn't handle false
the way I wanted. When doc says not nil should I assume it means
neither nil nor false, or should the doc for drop-while be updated?
user= (doc drop-while)
Hi to everyone,
I'm trying to create a function that takes a simple list and returns the
number of zeros in the list.
So I'm assuming that they will enter a list containing only numbers.
This is what I have so far, but it only works when the list empty. Can
somebody tell me what I'm missing?
On Aug 9, 2010, at 7:24 PM, Carlos Torres wrote:
I'm trying to create a function that takes a simple list and returns the
number of zeros in the list.
user= (count (filter zero? [0 1 2 3 0 4 5 6 0 7 8 9]))
3
--
You received this message because you are subscribed to the Google
Groups
On Mon, Aug 9, 2010 at 5:24 PM, Carlos Torres carlos.torr...@upr.edu wrote:
Hi to everyone,
I'm trying to create a function that takes a simple list and returns the
number of zeros in the list.
So I'm assuming that they will enter a list containing only numbers.
This is what I have so far,
2010/8/10 Carlos Torres carlos.torr...@upr.edu
Hi to everyone,
I'm trying to create a function that takes a simple list and returns the
number of zeros in the list.
So I'm assuming that they will enter a list containing only numbers.
This is what I have so far, but it only works when the
On Mon, Aug 9, 2010 at 5:24 PM, Carlos Torres carlos.torr...@upr.edu wrote:
(defn count-zeros
Returns the numbers of zero in a simple sequence of numbers
[list1]
(cond
(empty? list1) 0
(not (zero? (first list1))) 0
:else
(recur (+ 1 (count-zeros (rest list1))
On Mon, Aug 9, 2010 at 6:00 PM, Phil Hagelberg p...@hagelb.org wrote:
Just remove the call to recur and it will work, albeit only for lists
small enough to not blow the stack.
I'm assuming from the tone of the original post that the author is
trying to generally understand how to write
On Mon, Aug 9, 2010 at 9:00 PM, Phil Hagelberg p...@hagelb.org wrote:
On Mon, Aug 9, 2010 at 5:24 PM, Carlos Torres carlos.torr...@upr.edu
wrote:
(defn count-zeros
Returns the numbers of zero in a simple sequence of numbers
[list1]
(cond
(empty? list1) 0
(not (zero?
When doc says not nil should I assume it means
neither nil nor false
Nope, false won't be taken as nil; in boolean expressions nil
evaluates to false. drop-while's doc mentions only nil but since it's
the predicate's return value it should be clear enough, I think.
--
You received this
I was able to build ClojureCLR using the DLR 1.0 source and the latest
clojure-clr in VS 2010. I am able to run Clojure.Main.exe and
Clojure.Compile.exe. Is there a way to integrate these into VS, so
that I can add .clj files to a project and set the build action to
Build or Build with
48 matches
Mail list logo