Hi Meikel, Rich,
Thank you for your clarification.
Now I understand the difference between #^ and with-meta and I can see
#^metadata on a seq form is intact at compile time (and it can be
passed down to runtime) so that now I know I was wrong to say like the
topic.
Thanks again.
--
Kei
--~--~-
I thought this may interest this group:
I created a little interactive charting environment for Clojure which
you can find here: http://code.google.com/p/charts4j/downloads/list.
Simply load it with the following command: (load-file "charting.clj"),
setting your path appropriately, of course. Yo
On Dec 1, 12:03 am, bc <[EMAIL PROTECTED]> wrote:
> I've written a blog post titled "Clojure could be to Concurrency-
> Oriented Programming what Java was to OOP" in which I discuss
> Clojure's approach to concurrency:http://bc.tech.coop/blog/081201.html
>
> Any comments/criticisms would be apprec
Sorry, that http://tapestry.formos.com as the project hosting site. It
currently runs Bamboo at http://tapestry.formos.com/bamboo
On Tue, Dec 2, 2008 at 10:05 PM, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:
> I've created a patch for the clojure source that does the following:
>
> - Adds a mini
I've created a patch for the clojure source that does the following:
- Adds a minimal site build, with links to the main Clojure web site
(http://clojure.org)
- Generates a source JAR to go with the binary JAR
- Generates JavaDoc for the project site (if profile "javadoc" is enabled)
- Adds a Mav
On Dec 2, 9:22 pm, Rich Hickey <[EMAIL PROTECTED]> wrote:
>
> For those of us that don't do Ruby - what does === do?
It's a supporting method for the case keyword
case object
when pred1: action1
when pred2: action2
..
end
translates to
if pred1 === object
action1
elsif pred2 === object
act
Updated patch attached, the extra let for readability looked ugly to
me after some sleep.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure@googlegroups.c
Yes. doto is more general now. The . is needed to indicate Java
interop calls because doto can do other things which are not Java
interop calls:
(doto "double" println println)
double
double
-> "double"
Stuart
> Can someone tell me whether this change was intentional? In the
> 20080916 r
> REPL would be great. Using exit-clojure or quit-clojure instead will
> continue to require the user the look up how to terminate the REPL
> somewhere, at which point they might as well read about C-d.
Not entirely - once Slime/Jline is up tab completion on qu TAB or ex
TAB would give you what y
Can someone tell me whether this change was intentional? In the
20080916 release, I get this:
user=> (doto (new java.util.HashMap) (.put "a" "b"))
java.lang.IllegalArgumentException: No matching method found: .put
java.lang.IllegalArgumentException: No matching method found: .put
at cloj
Hi Michiel,
eval is for form data, so I am more surprised that it works for
ArrayList than that it fails for StringBuffer.
Stu
> After playing around with macros, I ran into this problem with Clojure
> (the latest version from github). The following code throws an
> IllegalArgumentException:
After playing around with macros, I ran into this problem with Clojure
(the latest version from github). The following code throws an
IllegalArgumentException: "No method for dispatch value: class
java.lang.StringBuffer"
(defmacro wrap [h] (eval h))
(wrap (new StringBuffer))
But this works fine:
On Tue, Dec 2, 2008 at 3:52 PM, Mark Volkmann <[EMAIL PROTECTED]> wrote:
>
> (def my-string (print-dup [1 2 3]))
> (def my-data (read my-string))
>
> Can you give a simple example of serializing and deserializing a
> Clojure collection?
For "serializing" you have a couple options:
(def my-string
Thanks for the in depth response. OK, not a Clojure problem . But as
an aside, it is unfortunate that the Java reflection API cannot handle
this case. The redeclaration solution may work fine, but it defeats
the purpose of having the package private interface (which may have
other public sub-type
On Sat, Nov 29, 2008 at 6:17 PM, JMan <[EMAIL PROTECTED]> wrote:
>
> Consider these 2 interfaces:
>
> - PackagePrivateInterface.java
>
> package test;
>
> interface PackagePrivateInterface {
>public void myPublicMethod();
> }
>
> - PublicTagInterface.java
>
> package test;
>
> public interface
On Tuesday 02 December 2008 11:21, Rich Hickey wrote:
> On Dec 2, 11:03 am, Randall R Schulz <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I was thinking it would be nice if (find-doc ...) accepted a
> > Pattern (in addition to the String it now accepts), thus allowing
> > #"RE pattern" regular expre
On Tue, Dec 2, 2008 at 12:52 PM, Rich Hickey <[EMAIL PROTECTED]> wrote:
>
> On Dec 2, 7:02 am, Parth Malwankar <[EMAIL PROTECTED]> wrote:
>> Tayssir John Gabbour wrote:
>> > Hi!
>>
>> > How should I approach serialization? I made a little test function
>> > which serializes and deserializes Clojur
Just tried the zip file link. I forgot to put the trace :-( Sry, I've
uploaded another zip file hoping it would overwrite the other. Alas,
it didn't.
So here is the new zip:
http://groups.google.com/group/clojure/web/echo-mina%20%282%29.zip
--~--~-~--~~~---~--~~
Y
On Dec 2, 12:51 pm, Andrés M. Quijano <[EMAIL PROTECTED]> wrote:
> Hi
>
> I'm trying to use Clojure with ApacheMINA. I think Clojure it's the
> ideal language to concurrently handle all the events that arrive
> intoMINA'sseparate threads.
Hi Andrés,
I bumped into Mina a couple of weeks ago, a
On Dec 2, 2:37 pm, Perry Trolard <[EMAIL PROTECTED]> wrote:
> Clarification: clojure.lang.Repl's behavior hasn't changed, it's just
> that the clojure.main default REPL behaves differently from it. Those
> who don't call clojure.main in their clj scripts won't notice a
> difference.
>
Fixed (sv
Clarification: clojure.lang.Repl's behavior hasn't changed, it's just
that the clojure.main default REPL behaves differently from it. Those
who don't call clojure.main in their clj scripts won't notice a
difference.
Perry
--~--~-~--~~~---~--~~
You received this mes
On Dec 2, 11:03 am, Randall R Schulz <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I was thinking it would be nice if (find-doc ...) accepted a Pattern (in
> addition to the String it now accepts), thus allowing #"RE pattern"
> regular expression pattern literals.
>
> What do Rich and others think?
>
Do
On Dec 2, 11:52 pm, Rich Hickey <[EMAIL PROTECTED]> wrote:
> As part of AOT I needed to enhance print/read to store constants of
> many kinds, and restore faithfully. This led to a new multimethod -
> print-dup, for high-fidelity printing. You can get print-dup behavior
> by binding *print-dup*:
On Sun, Nov 30, 2008 at 3:05 PM, Mon Key <[EMAIL PROTECTED]> wrote:
>
> Maybe (quit-clojure) instead of (quit)? This would save vanilla `quit'
> just in case it's needed later/elsewhere.
> Might also be nice to have (exit-clojure). Ditto saving vanilla `exit'
> for other purposes
>
> When first co
On Dec 2, 12:16 pm, Stuart Halloway <[EMAIL PROTECTED]> wrote:
> It is called "case equality" which is a terribly confusing way to say
> "the predicate used to match in case statements". "Match" is really
> the best verb. In Ruby, most things match by value equality. But
> classes match their
On Dec 2, 10:03 am, Randall R Schulz <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I was thinking it would be nice if (find-doc ...) accepted a Pattern (in
> addition to the String it now accepts), thus allowing #"RE pattern"
> regular expression pattern literals.
>
> What do Rich and others think?
>
> R
On Dec 2, 12:12 pm, Chouser <[EMAIL PROTECTED]> wrote:
> On Tue, Dec 2, 2008 at 10:24 AM, Rich Hickey <[EMAIL PROTECTED]> wrote:
>
> > Proxy generation was the last runtime code-gen/classloader
> > requirement. So the path is clear for building Clojure apps without
> > runtime codegen, for deli
On Dec 2, 7:02 am, Parth Malwankar <[EMAIL PROTECTED]> wrote:
> Tayssir John Gabbour wrote:
> > Hi!
>
> > How should I approach serialization? I made a little test function
> > which serializes and deserializes Clojure objects. It works for
> > strings, integers, symbols, LazilyPersistentVectors
Rich Hickey <[EMAIL PROTECTED]> writes:
> On Jun 20, 11:58 am, Jaime Barciela <[EMAIL PROTECTED]> wrote:
>> Hello Phil,
>>
>> My understanding is that Common Lisp doesn't have support for
>> continuations either and that's why Weblocks uses cl-cont (http://
>> common-lisp.net/project/cl-cont/, a l
Hi,
Am 02.12.2008 um 18:49 schrieb jim:
A couple of weeks ago, I took a crack at figuring out monads by
implementing them in Clojure. Inspired by Konrad's work, I pulled
that out and completed it.
Seems, that we have some inflation here. :)
I also re-activated my try from spring, which I use
With the adoption of the clojure.main at SVN r1127, the print behavior
of the REPL changed from prn-style to println-style, e.g.
;r1126
user=> (list "hey" 'hey)
("hey" hey)
;r1127 & on
user=> (list "hey" 'hey)
(hey hey)
I missed it when looking over Stephen's clojure.main code when
proposed, bu
A couple of weeks ago, I took a crack at figuring out monads by
implementing them in Clojure. Inspired by Konrad's work, I pulled
that out and completed it.
I had chosen to implement a monad as a hash-map which is then passed
in to the standard monadic operations as an additional parameter.
Lift
> Polite, certainly. But as ever, the bottom line is the license under
> which it was released, and in this case that's the Apache License 2.0.
> You should decide whether that's consistent with your intentions.
It's worth noting that JetBrains has a history of including third-
party plugins as
On Tuesday 02 December 2008 09:24, Chouser wrote:
> On Tue, Dec 2, 2008 at 11:03 AM, Randall R Schulz <[EMAIL PROTECTED]>
wrote:
> > I was thinking it would be nice if (find-doc ...) accepted a
> > Pattern (in addition to the String it now accepts), thus allowing
> > #"RE pattern" regular express
On Tue, Dec 2, 2008 at 11:03 AM, Randall R Schulz <[EMAIL PROTECTED]> wrote:
>
> I was thinking it would be nice if (find-doc ...) accepted a Pattern (in
> addition to the String it now accepts), thus allowing #"RE pattern"
> regular expression pattern literals.
+1
"in addition to the String" is
It is called "case equality" which is a terribly confusing way to say
"the predicate used to match in case statements". "Match" is really
the best verb. In Ruby, most things match by value equality. But
classes match their instances. Ranges match things in the range.
Regexps match string
On Tue, Dec 2, 2008 at 10:24 AM, Rich Hickey <[EMAIL PROTECTED]> wrote:
>
> Proxy generation was the last runtime code-gen/classloader
> requirement. So the path is clear for building Clojure apps without
> runtime codegen, for delivery in those environments that preclude it
> (e.g. Android, unsi
I've been working on the same issue. So far it has mostly been just
researching various options, but I can give you my two cents...
It really depends on your goals and constraints. I have narrowed down
to two major families of serialization for storage and networking. One
is the JSON/YAML/X
On Tuesday 02 December 2008 08:52, Peter Wolf wrote:
> ...
>
> I vote that we take Merlyn's code as a base and put it on
> SourceForge. I'll add my Lexer and Parser and work on formatting,
> parens matching and coloring. Erik can add his REPL and completion
> stuff.
>
> However, I think it would
I just pulled the code down.
While it's true that there is no implementation, Curious Bunny (merlyn)
did an excellent job of making a minimal custom language plugin. This
is something that is lacking in IntelliJ's own documentation.
By making a trivial change to Curious's code I was able to c
Seems like shuffle should be part of the core or in the contrib. Is there a
reason why it's not?
On Mon, Dec 1, 2008 at 9:55 PM, Timothy Pratley <[EMAIL PROTECTED]>wrote:
>
>
> http://groups.google.com/group/clojure/browse_thread/thread/180842eb58c58370/0e19ab338452c64f?lnk=gst&q=shuffle#0e19ab3
--- On Tue, 12/2/08, Paul Barry wrote:
> Since this is just pure java, shouldn't it be the same on all 1.5
> JVMs? Would it be different on other JVM implementations? Just
> to verify, I checked on my Mac OS X 10.5 and in the Sun JDK
> 1.5 on Windows XP, and it does appear to be the same.
A Su
JBossSerialization looks nifty, though I haven't tried it yet:
http://www.jboss.org/serialization/
Thanks to everyone who responded! (I've just been immersing myself in
Externalizable, object versioning, etc; and your thoughts have been
helpful.)
All best,
Tayssir
On Dec 2, 9:57 am, Tayssir J
On Dec 1, 5:07 pm, Stuart Halloway <[EMAIL PROTECTED]> wrote:
> I am thinking about adding a match method to Clojure-contrib. This
> would work like Ruby's threequals ("===", a.k.a. case equality) and
> would be implemented as a multimethod to do sensible things with a
> wide variety of types.
>
Hi,
I was thinking it would be nice if (find-doc ...) accepted a Pattern (in
addition to the String it now accepts), thus allowing #"RE pattern"
regular expression pattern literals.
What do Rich and others think?
Randall Schulz
--~--~-~--~~~---~--~~
You recei
Since this is just pure java, shouldn't it be the same on all 1.5
JVMs? Would it be different on other JVM implementations? Just to
verify, I checked on my Mac OS X 10.5 and in the Sun JDK 1.5 on
Windows XP, and it does appear to be the same.
On Dec 2, 9:17 am, Stuart Halloway <[EMAIL PROTECTED
2008/12/2 Stuart Halloway <[EMAIL PROTECTED]>:
>
> Cool, that's much better. Can we establish that all (or all important)
> Java 5+ VMs use AtomicLong in next?
While compare-and-swap is a lot better than a mutex, it's still not
free. IIRC a CAS is one (or maybe two) order(s) of magnitude more
exp
I've made substantial enhancements to gen-class over the weekend.
Please refresh and read:
http://clojure.org/compilation
In short, I've made it so that you can call gen-class stand-alone.
This will generate a stub class at AOT compile time.
The relationship between a generated class and its im
On Dec 2, 2:39 am, Meikel Brandmeyer <[EMAIL PROTECTED]> wrote:
> Hi,
>
> On 2 Dez., 04:47, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > So why is the above form not legal in Clojure? I would think it might
> > come in handy to define a function that relies on something currently
> > no
We are working on a Netbeans plugin (.enclojure.org) and are
currently working to isolate non-nb specific clojure-ide support code.
We should have the basic libraries up this coming Monday. The code
that is up there now has been following the changes in Clojure since
February and is l
On Dec 2, 4:30 am, Kei Suzuki <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Whenever a seq form is preceded by #^metadata, the metadata is ignored
> or only {:line n} is associated with.
>
> For example, these return the metadata as expected:
>
> (meta (with-meta '(1) {:v 1}))
> (meta (with-meta (quote (
On Tuesday 02 December 2008 06:16, [EMAIL PROTECTED] wrote:
> ...
>
> Just found this http://code.google.com/p/clojure-intellij-plugin/ - I
> guess that's another one? Might be worth looking into working on that
> rather than starting up a competitor.
I retrieved the code. It is at best a skeleto
Thanks, I strongly agree.
I just emailed curious.attempt.bunny to join forces. Curious, are you
out there?
P
[EMAIL PROTECTED] wrote:
> On Dec 2, 12:54 pm, Peter Wolf <[EMAIL PROTECTED]> wrote:
>
>> Since the code doesn't exist yet, I'd have to say no... Like I said,
>> I'm just getting
On Nov 18, 5:35 pm, "Stephen C. Gilardi" <[EMAIL PROTECTED]> wrote:
> I think Clojure should change to allow (bigdec 3) to succeed.
> BigDecimal has a valueOf method that accepts a long. It has a
> constructor that accepts an int. I haven't made a bug report on this
> yet, but here it is.
>
SVN
On Dec 2, 8:43 am, Luke Amdor <[EMAIL PROTECTED]> wrote:
> The "@" symbol is a reader macro. It's a hard coded table so that when
> the reader comes across the @ symbol it knows to instead change it to
> a deref call. For eg,
>
> (def a (ref 0))
>
> (dosync (alter inc a))
>
> @a ;; is the same t
The "@" symbol is a reader macro. It's a hard coded table so that when
the reader comes across the @ symbol it knows to instead change it to
a deref call. For eg,
(def a (ref 0))
(dosync (alter inc a))
@a ;; is the same thing as
(deref a)
http://clojure.org/reader#toc2 or http://clojure.org/ap
On Dec 1, 9:35 pm, Timothy Pratley <[EMAIL PROTECTED]> wrote:
> > The reason is simple - plain mutable variables have no concurrency
> > semantics. What if you closed over a mutable local? Now you have an
> > object with no synchronization, a concurrency mess.
>
> Thanks Rich for the clarificati
Cool, that's much better. Can we establish that all (or all important)
Java 5+ VMs use AtomicLong in next?
> Ah, I didn't see the call to next. The java docs do say that is the
> implementation for that method, but they are lying:
>
>protected int next(int bits) {
>long oldseed, ne
On Dec 2, 12:54 pm, Peter Wolf <[EMAIL PROTECTED]> wrote:
> Since the code doesn't exist yet, I'd have to say no... Like I said,
> I'm just getting started.
>
> How about I get the basic framework going so that IntelliJ knows about
> CLJ files, and say paren matching works. Then we can start a
>
On Monday 01 December 2008 23:32, Meikel Brandmeyer wrote:
> Hi,
>
> On 2 Dez., 00:49, Randall R Schulz <[EMAIL PROTECTED]> wrote:
> > Trying to make me look bad, eh? Well, it's not really a challenge,
> > you know...
>
> o.O Do I?
You do now...
> ...
>
> Concerning the filename issue, one mayb
Ah, I didn't see the call to next. The java docs do say that is the
implementation for that method, but they are lying:
protected int next(int bits) {
long oldseed, nextseed;
AtomicLong seed = this.seed;
do {
oldseed = seed.get();
nextseed = (o
Even if you use a per-thread instance, you pay the synchronization
penalty. Because there is no contention, the penalty is lower, but it
is still not zero.
Is it big enough to matter? My intuition says "yes". That's worth
nothing, so I will write some tests when I have some spare time ...
On Tue, Dec 2, 2008 at 3:05 PM, Stuart Halloway
<[EMAIL PROTECTED]> wrote:
>
> nextDouble calls next, which according to Java 5 docs is:
>
> synchronized protected int next(int bits) {
>seed = (seed * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1);
>return (int)(seed >>> (48 - bits));
>
nextDouble calls next, which according to Java 5 docs is:
synchronized protected int next(int bits) {
seed = (seed * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1);
return (int)(seed >>> (48 - bits));
}
This is exactly the kind of thing I think we shouldn't have to worry
about in Cl
Hi
I'm trying to use Clojure with Apache MINA. I think Clojure it's the
ideal language to concurrently handle all the events that arrive into
MINA's separate threads.
So I tried to port the simplest example, the EchoServer (files here:
http://svn.apache.org/viewvc/mina/branches/1.0/example/src/m
Since the code doesn't exist yet, I'd have to say no... Like I said,
I'm just getting started.
How about I get the basic framework going so that IntelliJ knows about
CLJ files, and say paren matching works. Then we can start a
SourceForge project and others can implement the API for referenc
Don't forget XMLEncoder/XMLDecoder. They come in pretty handy when you
want to serialize objects that (already) follow bean conventions.
-- KD
Dakshinamurthy Karra
(blog: http://blog.marathontesting.com)
(daily dose: http://twitter.com/marathontesting)
On Tue, Dec 2, 2008 at 4:06 PM, Tayssir
Tayssir John Gabbour wrote:
> Hi!
>
> How should I approach serialization? I made a little test function
> which serializes and deserializes Clojure objects. It works for
> strings, integers, symbols, LazilyPersistentVectors and.. oddly..
> PersistentHashMaps that have exactly one element. (My C
On Dec 1, 4:11 pm, Peter Wolf <[EMAIL PROTECTED]> wrote:
>
> Since I plan to introduce Clojure into existing large Java projects, I want
> to use a decent IDE. So I am writing a Clojure plugin for my favorite--
> IntelliJ. When I'm done I hope to offer a nice integrated environment
> complete
Interesting, thanks for the new perspective! Using YAML seems more
flexible than what I was thinking, particularly since Clojure
apparently doesn't make me worry too much about the specific kind of
sequence/map I'm using.
(Yeah, I have an app which sends serialized objects all over the
place, and
On 25.11.2008, at 15:06, Konrad Hinsen wrote:
> I just saw a reference to symbol-macrolet with a description. My
> function replace-syms is indeed very similar, the difference being
> that it takes a map for defining the substitutions to be done,
> instead of a let-like sequence. The difference i
I use YAML to serialize. I needed a simple way to pass Maps, Lists and
Vector between java, Ruby and Clojure components.
I change the classes of Clojure in the YAML output to java.util.Map,
List and so on to remove dependencies
on Clojure classes while retaining the ability to walk through the
str
On Dec 2, 9:57 am, Tayssir John Gabbour <[EMAIL PROTECTED]>
wrote:
> (defn my-identity "Copies obj through serialization and
> deserialization."
> [obj]
> (let [byte-out (new java.io.ByteArrayOutputStream)
> obj-out (new java.io.ObjectOutputStream byte-out)]
> (try (.writeObject o
Hi,
On 2 Dez., 10:30, Kei Suzuki <[EMAIL PROTECTED]> wrote:
> (meta #^{:v 1} (vector 1))
>
> Is this by design?
I think you are right. The metadata is assigned to
the list (vector 1). Then the function vector is executed
and you get the vector [1], but the metadata is "lost".
So one could argue,
I wanted to ask what algorithm Java is using for calculating its
random numbers (having a choice of algorithms would be great - some
applications favor one above the other), but I found a website digging
into exactly this question:
http://www.math.utah.edu/~beebe/java/random/README
"I therefore
Hi,
Whenever a seq form is preceded by #^metadata, the metadata is ignored
or only {:line n} is associated with.
For example, these return the metadata as expected:
(meta (with-meta '(1) {:v 1}))
(meta (with-meta (quote (1)) {:v 1}))
(meta (with-meta (list 1) {:v 1}))
(meta (with-meta (vector 1
Hi,
On the subject of with-local-vars, I noticed that I could use @ to
deference them in addition to var-get. Is that intended behaviour? I
didn't see it documented anywhere.
--
Dave
--~--~-~--~~~---~--~~
You received this message because you are subscribed t
Hi!
How should I approach serialization? I made a little test function
which serializes and deserializes Clojure objects. It works for
strings, integers, symbols, LazilyPersistentVectors and.. oddly..
PersistentHashMaps that have exactly one element. (My Clojure is about
a month old.)
But for ot
On Mon, Dec 1, 2008 at 8:16 PM, Chouser <[EMAIL PROTECTED]> wrote:
>
> On Mon, Dec 1, 2008 at 1:01 PM, puzzler <[EMAIL PROTECTED]> wrote:
>>
>> Clojure is designed for concurrency, but I don't see any functions in
>> the API to spin off new threads.
>
> See 'send' and 'send-off'. send-off in part
79 matches
Mail list logo