On Thu, Oct 1, 2009 at 2:29 PM, DomS wrote:
>
> Hello all,
>
> I'm trying to integrate an REPL in a existing java project, but i dont
> know how it works or where to start.
>
> At first it should only have the functionality from an ordinary clj
> repl. Later we want to extend it with some function
On Thu, Oct 1, 2009 at 1:17 PM, John Harrop wrote:
> On Thu, Oct 1, 2009 at 3:42 PM, Dragan Djuric wrote:
>>
>> I usualy cite Rich's conference paper and Stuart's book.
>>
>> @conference{hickey2008clojure,
>> title={{The Clojure programming language}},
>> author={Hickey, R.},
>> booktitle={Pr
We got started by staring at:
http://github.com/pmf/clojure-jsr223
Although familiarity with the suboptimal jsr223 spec helped.
(Unlike a server socket, this approach means that you can share parts of
your host directly with the Clojure environment by binding var's. I find
this either is, or at s
Hello,
I assume this is about the cheatsheet at http://clojure.org/cheatsheet
The odd/even typos are in the PDF version.
Some suggestions: add update-in, assoc-in, get-in in the 'Maps'
section; Add the ignore-next-form #_ reader macro in the reader
macros section.
Otherwise, great resource.
(into [1 2] [3 4]) -> [1 2 3 4]
(into [1 2] [3 4] [5 6]) -> wrong number of arguments
It's seems more Clojure-like to allow any number of collections to be
passed to into.
In this case the result would be [1 2 3 4 5 6].
--
R. Mark Volkmann
Object Computing, Inc.
--~--~-~--~~--
Hi,
2009/10/2 Miron Brezuleanu :
>
> Hello,
>
> I assume this is about the cheatsheet at http://clojure.org/cheatsheet
>
> The odd/even typos are in the PDF version.
>
> Some suggestions: add update-in, assoc-in, get-in in the 'Maps'
> section; Add the ignore-next-form #_ reader macro in the rea
This seems to work:
(reduce into '([1 2] [3 4] [5 6]))
although it does lack the simplicity.
On Oct 2, 7:10 am, Mark Volkmann wrote:
> (into [1 2] [3 4]) -> [1 2 3 4]
>
> (into [1 2] [3 4] [5 6]) -> wrong number of arguments
>
> It's seems more Clojure-like to allow any number of collections t
Is there a way to make a declaration in Clojure that cannot be rebound
later? Ideally, I'd like something that fails if I try to do this:
(def myname "mark")
; ...more code, elided...
(def myname "Mark")
Perhaps this is obvious, but I see a lot of discussion of immutable
data structures, but I
I can think of 'defvar that comes close to what you're about : it does not
rebind the root value if it is different from nil
(though it doesn't warn you about the problem, it's more to prevent
reinitializing vars when their containing files are reloaded)
2009/10/2 Mark
>
> Is there a way to ma
Hi,
On Oct 2, 4:29 pm, Mark wrote:
> Is there a way to make a declaration in Clojure that cannot be rebound
> later? Ideally, I'd like something that fails if I try to do this:
>
> (def myname "mark")
> ; ...more code, elided...
> (def myname "Mark")
>
> Perhaps this is obvious, but I see a lo
Hi,
Am 01.10.2009 um 19:08 schrieb Rich Hickey:
It simply doesn't compose or flow. Making the nil env special (e.g.
non-replacing) just moves the problem into higher-order functions that
use the construct:
(defn needs-x []
(use-env-x))
(defn needs-y []
(use-env-y))
(defn foo []
(with-env
On Oct 2, 12:23 pm, Meikel Brandmeyer wrote:
> Hi,
>
> Am 01.10.2009 um 19:08 schrieb Rich Hickey:
>
>
>
>
>
> > It simply doesn't compose or flow. Making the nil env special (e.g.
> > non-replacing) just moves the problem into higher-order functions that
> > use the construct:
>
> > (defn needs-
When I write code in Java, I declare everything final that's possible
to be declared final, and I deliberately look for solutions that avoid
reassignment to variables, so all my variables are final).
I'm new to Clojure, so I might be wrong, but it seems that within a
function, mutable bindings mu
Hi everbody,
I am having some problems using macros which I will explain by using
the core macro 'and'.
Imagine having a macro accepting multiple arguments: (and true false
true false)
But all the arguments are in a list e.g. (def arglist '(true false
true false))
Is there a simple way to 'app
On Oct 2, 12:47 pm, b2m wrote:
> Is there a simple way to 'apply' the macro to a list of arguments like
> it works for functions: (apply + '(1 2 3)) ?
Nope, no can do.
For an example of why, check out clojure.contrib.apply-macro -- the
warnings are there for a reason.
"apply" is a function, so
On Oct 2, 11:52 am, Mark Tomko wrote:
> However, outside the scope of a function, it seems that it's possible
> for bindings to be redefined later in a file without causing an
> immediate error. This could easily lead to mistakes that would
> manifest as silent and potentially inexplicable behav
>From what I've seen, people never redef vars in source code. In general,
you shouldn't have to worry about users of your code redefing your vars as
it's against common convention, non-idiomatic.
The exception, as Stuart Sierra said, is when writing interactively from the
REPL, where you'd like t
Also, I'm not sure if your understanding of "binding" is correct.
because within any lexical scope inside a function, I can
> pretty much count on my bindings to never change.
>
binding is actually like a lexical re-def:
user=> (def x 1)
#'user/x
user=> (binding [x 2] (pr x) (binding [x 3] (pr
I use a let at the top of the file to denote things that I want to
have as captured and constant.
... you can do things like
(let [x 1]
(defn foo-that-uses-x [y]
(function-here x y)))
On Oct 2, 10:29 am, Mark wrote:
> Is there a way to make a declaration in Clojure that cannot be rebound
>
Hi Stuart,
> Nope, no can do.
>
> For an example of why, check out clojure.contrib.apply-macro -- the
> warnings are there for a reason.
For some reason I missed this library. Looks the same like the code I
wrote and declared as "to evil to use".
> "apply" is a function, so it's evaluated at ru
This is not a suggestion or anything, just entertaining myself with
some uneducated thinking.
What if all lazy functions (map filter etc) would check some global
value and decide upon it lazyness ? Then we could do something like
this:
(eager
(map ...(filter ...)))
That would allow to not to
Enclojure has repl history as well as a log of all the unique commands
issued that persists across restarts of Netbeans (and your repl
instances). The command history can be opened in the editor and the
expressions can be executed just like any other clojure source file.
Standard command his
Yes, Bibtex is ugly, but guess what - you newer need to write a single
line. You find a reference in google scholar, copy paste a reference
into your reference file and it works.
Please call Google and ask for another, more lispy export format in
their Google Scholar. Additionally, if you have to
That's what I meant when I mentioned the 'binding' form above. The
reason that's okay (to me) is that it explicitly calls out that
bindings may be about to change.
On Oct 2, 11:47 am, John Newman wrote:
> Also, I'm not sure if your understanding of "binding" is correct.
>
> because within any l
Hi,
Am 02.10.2009 um 22:01 schrieb Vagif Verdi:
This is not a suggestion or anything, just entertaining myself with
some uneducated thinking.
What if all lazy functions (map filter etc) would check some global
value and decide upon it lazyness ? Then we could do something like
this:
(eager
1. Missing a '!':
set-validator
2. Typo:
Rearrangment (under sequences)
3. Macros looping doesn't have "loop". So loop is special form and not a
macro?
Albert
--
Albert Cardona
http://albert.rierol.net
--~--~-~--~~~---~--~~
You received this messa
On Oct 2, 1:37 pm, Meikel Brandmeyer wrote:
> You can do so by with doall:
>
> (doall (map ... (filter ...)))
>
Unfortunately this is not true. Yo are paying penalty for lazyness in
this case.
Try it yourself. Write non lazy versions of map and filter and time
them against standard ones
Hi,
Am 03.10.2009 um 06:09 schrieb Vagif Verdi:
You can do so by with doall:
(doall (map ... (filter ...)))
Unfortunately this is not true. Yo are paying penalty for lazyness in
this case.
Try it yourself. Write non lazy versions of map and filter and time
them against standard ones.
Hi,
I'm wondering about the space performance of Clojure's persistent data
structures. For example, consider the following program, which updates
a single key in a map containing other (static) data:
(loop [m {:key 0 :a 0 :b 1 :c 2 :d 3 :e 4 :f 5 :g 6 :h 7 :i 8 :j 9}]
(if (< (:key m) 1000)
29 matches
Mail list logo