On 15.12.2008, at 02:24, Mark H. wrote:
(lazy-cons X1 (lazy-cons X2 (transform-to-gaussian uniform-
rest))
Also much better -- the structs were ugly. Thanks for the nice
revision!
In fact, this is a good test-case for the interface design for random-
number generators. If you
Wow, that's a lot of things that have to be in the classpath!
In your example the namespace is fj.tests.process.
You say the classpath must contain:
1) the fj directory
2) the process directory
3) the classes directory where the .class files will be written
I would have guessed I'd only
Randall R Schulz wrote:
What might be the issues or consequences of making the root binding of
*out* a PrintWriter?
I've been using a PrintWriter for *out* for months now, and no problems
so far.
Using always nearly latest svn clojure.
Albert
--
Albert Cardona
On Dec 12, 3:35 pm, Christophe Grand christo...@cgrand.net wrote:
I was sure it was a job for iterate:
(defn reductions
Returns a lazy seq of the intermediate values of the reduction (as
per reduce) of coll by f, starting with init.
([f coll]
(if (seq coll)
(for [s
On Sunday 14 December 2008 21:56, Mon Key wrote:
user= (flatten nil)
(nil)
Not a bug.
flatten returns a sequence - in this case a sequence containing
'nil. How else would you flatten on nil?
I would expect (flatten nil) = nil
...
Randall Schulz
On Monday 15 December 2008 01:16, Albert Cardona wrote:
Randall R Schulz wrote:
What might be the issues or consequences of making the root binding
of *out* a PrintWriter?
I've been using a PrintWriter for *out* for months now, and no
problems so far. Using always nearly latest svn
On Dec 15, 9:08 am, Randall R Schulz rsch...@sonic.net wrote:
flatten returns a sequence - in this case a sequence containing
'nil. How else would you flatten on nil?
I would expect (flatten nil) = nil
I agree, it's a bug, but I'm not sure how to fix it, unless it's just
a special case
On Dec 14, 2008, at 23:16, jim wrote:
Also, I came across set-state and fetch-state being implemented in
terms of update-state.
Indeed, those are the implementations I had in my first monad
implementation. I replaced them by manually inlining update-state
when I wanted to get rid of
Cool, thanks!
-S
On Dec 14, 4:47 pm, Chouser chou...@gmail.com wrote:
I've updated the Clojure classes graph (thanks for the push, R.
Schulz!) The new version includes the newest classes as well as Java
interfaces that are applicable. These latter are shown inside
diamonds.
A couple
On Monday 15 December 2008 07:22, Stuart Sierra wrote:
On Dec 15, 9:08 am, Randall R Schulz rsch...@sonic.net wrote:
flatten returns a sequence - in this case a sequence containing
'nil. How else would you flatten on nil?
I would expect (flatten nil) = nil
I agree, it's a bug, but
On Mon, Dec 15, 2008 at 10:40 AM, Randall R Schulz rsch...@sonic.net wrote:
On Friday 05 December 2008 15:36, Randall R Schulz wrote:
I make pretty extensive use of nested classes
(most significantly Enum types).
I was wondering if it might be a good idea to
allow dot resolution to find
On Dec 15, 10:27 am, Stuart Sierra the.stuart.sie...@gmail.com
wrote:
Cool, thanks!
-S
On Dec 14, 4:47 pm, Chouser chou...@gmail.com wrote:
I've updated the Clojure classes graph (thanks for the push, R.
Schulz!) The new version includes the newest classes as well as Java
interfaces
On Friday 05 December 2008 15:36, Randall R Schulz wrote:
I make pretty extensive use of nested classes
(most significantly Enum types).
I was wondering if it might be a good idea to
allow dot resolution to find such types.
E.g.:
user= tau.run.TSEvent.TSEKind
On Mon, Dec 15, 2008 at 4:52 PM, Randall R Schulz rsch...@sonic.net wrote:
Hi,
I'm wondering whether it's a good idea to create a defsomething -style
macro that establishes multiple root bindings? In other one, a macro
that expands to multiple (def ...) forms?
Well that sounds quite like
On Mon, Dec 15, 2008 at 10:47 AM, Rich Hickey richhic...@gmail.com wrote:
It seems the interface detection is not quite right - many things that
are interfaces are shown as classes.
Yes, the legend is misleading. Diamonds are for non-clojure
interfaces, ovals are clojure.lang.* classes and
Jim,
you were quicker than me in implementing monad transformers! What I
had in mind is exactly what you did: a monad transformer would be
implemented as a function taking a monad as an argument. That's in
fact why I defined the monad macro in addition to defmonad.
I did some more work
Hi,
I'm wondering whether it's a good idea to create a defsomething -style
macro that establishes multiple root bindings? In other one, a macro
that expands to multiple (def ...) forms?
The first thing I noticed when I did this is that (barring further
machinations within the macro) it
Hello
I was just following the directions on Ubuntu setup directions on
http://riddell.us/clojure/
I get the following error when I try ANTS.CLJ. Has something changed?
Peter
(defn setup
places initial food and ants, returns seq of ant agents
[]
(sync nil
(dotimes [i food-places]
+1. For example i did a function that calls some Oracle PL/SQL stored
procedure
(defn db-read-proc [callback]
(sql/with-connection
db
(with-open [stmt (.prepareCall (connection) {call STORED_PROCEDURE
(?)})]
(. stmt registerOutParameter 1 -10)
(. stmt execute)
(callback (.
On Mon, Dec 15, 2008 at 11:02 AM, Chouser chou...@gmail.com wrote:
On Mon, Dec 15, 2008 at 10:47 AM, Rich Hickey richhic...@gmail.com wrote:
It seems the interface detection is not quite right - many things that
are interfaces are shown as classes.
Yes, the legend is misleading. Diamonds
Clojure needs a FAQ - a plain old school vanilla FAQ.
Clojure.org is useful;
The wiki is useful;
The gg Group is useful;
The /# clojure is useful;
(doc some-fn) is useful;
(show some-fn) is useful;
None of these are a FAQ.
None accomplish what a FAQ accomplishes.
Lots of people look for a FAQ
On Monday 15 December 2008 09:30, Mon Key wrote:
I would expect (flatten nil) = nil
Why?
= nil
nil is not a sequence - your expectation is that Clojure flatten and
return `nothing'... which *would* be a bug
Flattening nothing gives something?
Flatten is not consistent with seq:
user=
On Dec 15, 12:30 pm, Mon Key s...@derbycityprints.com wrote:
I would expect (flatten nil) = nil
Why?
Sorry, Mon Key, but I have to agree with Randall here. All the
sequence-related functions (first, rest, filter, map, etc.) return nil
for nil. If flatten is returning a sequence, I expect
I have the following Clojure code and I'm not sure why it's not
working:
(defn match (x y optional binds)
(cond
((eql x y) (values binds t))
((assoc x binds) (match (binding x binds) y binds))
((assoc y binds) (match x (binding y binds) binds))
((var? x) (values (cons (cons x y)
Should I interpret the silence on this topic to mean that there aren't
any places I can go to find out about *agent*, etc.? In another
thread on this group, I see that there is a *out*, as well; I assume
therefore that there is a *in*. Perhaps those are documented
somewhere - any pointers?
On Monday 15 December 2008 09:34, Paul Reiners wrote:
I have the following Clojure code and I'm not sure why it's not
working:
(defn match (x y optional binds)
(cond
((eql x y) (values binds t))
((assoc x binds) (match (binding x binds) y binds))
((assoc y binds) (match x
Rich Hickey schreef:
Dot is too overloaded in Java, and overloaded enough in Clojure. This
one doesn't seem too important to me.
I ran into this issue yesterday. Or more precisely: I couldn't find
any way to refer to inner classes in the docs on the clojure.org site.
I personally don't like
I have the following Clojure code and I'm not sure why it's not working:
The short answer is: That's not Clojure code, it is Common Lisp code.
Longer answer: Despite having similar-looking syntax, the two are not
particularly related. Of the functions/macros you tried to use, I
think only and,
On Dec 15, 5:34 pm, Paul Reiners paul.rein...@gmail.com wrote:
I have the following Clojure code and I'm not sure why it's not
working:
(defn match (x y optional binds)
(cond
((eql x y) (values binds t))
((assoc x binds) (match (binding x binds) y binds))
((assoc y binds)
How about adding a rest around tree-seq:
(defn flatten
Takes any nested combination of sequential things (lists, vectors,
etc.) and returns their contents as a single, flat sequence.
[x]
(let [s? #(instance? clojure.lang.Sequential %)]
(filter (complement s?) (rest (tree-seq s? seq
On Dec 15, 2008, at 1:49 PM, Joost wrote:
Rich Hickey schreef:
Dot is too overloaded in Java, and overloaded enough in Clojure. This
one doesn't seem too important to me.
I ran into this issue yesterday. Or more precisely: I couldn't find
any way to refer to inner classes in the docs on
*agent* and a few others have recently been properly documented at
http://clojure.org/api
Unfortunately this isn't true for all of the 'standard' globals. *in*
and *out* don't have entries of their own, though they are mentioned
in the functions that use them, so a search within that page will
On Monday 15 December 2008 07:44, Rich Hickey wrote:
On Mon, Dec 15, 2008 at 10:40 AM, Randall R Schulz rsch...@sonic.net
wrote:
On Friday 05 December 2008 15:36, Randall R Schulz wrote:
I make pretty extensive use of nested classes
(most significantly Enum types).
I was wondering if
I have a seq of strings that are namespaces like,
(clojure.contrib.str-utils, clojure.contrib.duck-streams).
I wanted to call the use function on this seq. I can't seem to do that
though. Any way I can do this or
is this just a bad idea? Thanks.
You can do this:
(apply use (map symbol (list clojure.contrib.str-utils
clojure.contrib.duck-streams)))
-Stuart Sierra
On Dec 15, 3:51 pm, Brian Doyle brianpdo...@gmail.com wrote:
I have a seq of strings that are namespaces like,
(clojure.contrib.str-utils, clojure.contrib.duck-streams).
I
I didn't know about the symbol function. Thanks! I just want to call use
on all
of the namespaces in the clojure.contrib jar when starting the repl and this
will
work nicely!
On Mon, Dec 15, 2008 at 1:59 PM, Stuart Sierra
the.stuart.sie...@gmail.comwrote:
You can do this:
(apply use (map
I been thinking about this during the weekend, and I think I prefer the mode
to be aware of nesting (unless you can cause it to blow the stack on a large
file or something, which I think would be unlikely anyway), so I'm going to
take the keywords from your mode and bolt on the set structures I
Here is a minor update to what I posted previously (but this time as
an attachment). This is just a small library that allows you turn on
tracing for all functions in a namespace all at once, or toggle
tracing for individual functions.
--~--~-~--~~~---~--~~
You
Is there anything in Clojure that is equivalent to Common Lisp's
symbol-name function?
--~--~-~--~~~---~--~~
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
To
Hi,
I just ran into a need for using gen-class, and need some help getting
started.
I upgraded to the latest Clojure version using
svn co https://clojure.svn.sourceforge.net/svnroot/clojure clojure
and I run the REPL using
java -jar clojure.jar
However when I type:
user= (compile)
I get the
Rich Hickey schreef:
On Dec 15, 2008, at 1:49 PM, Joost wrote:
Rich Hickey schreef:
Dot is too overloaded in Java, and overloaded enough in Clojure. This
one doesn't seem too important to me.
I ran into this issue yesterday. Or more precisely: I couldn't find
any way to refer to
Hello all!
I ported beatiful functional geometry:
http://www.frank-buss.de/lisp/functional.html
http://intricatevisions.com/index.cgi?page=nlcodetk
into Clojure:
http://intricatevisions.com/source/clojure/fg.clj
(link from the page http://intricatevisions.com/index.cgi?page=clojure)
When you
I have the following scenario:
- a server that is listening on a socket for incoming connections.
- when the server accepts a connection it uses send-off to run a
handler function to handle the connection
- the handler function loops using recur to handle packets
- the handler function uses
According to the docs the seq function should be able to take an
enumeration,
but here is what I see:
user= (seq (.elements (doto (java.util.Vector.) (.add hello) (.add
world
java.lang.IllegalArgumentException: Don't know how to create ISeq
from: (NO_SOURCE_FILE:0)
SVN 1160, thanks.
On Sunday 14 December 2008 17:21, Randall R Schulz wrote:
Hi,
I have quite a bit of Java code with I/O capabilities that generally
support both PrintStream and PrintWriter. I was a bit perplexed when
I tried to apply one of these methods to *out* and was rebuffed
thusly:
On Dec 15, 2008, at 6:08 PM, Randall R Schulz wrote:
user= (class *err*)
java.io.PrintWriter
PrintWriter is (as far as I can determine) the more modern of the two
classes that are accepted as an argument to
Throwable.printStackTrace which is used frequently in Clojure's
implementation.
On Monday 15 December 2008 15:22, Stephen C. Gilardi wrote:
On Dec 15, 2008, at 6:08 PM, Randall R Schulz wrote:
user= (class *err*)
java.io.PrintWriter
PrintWriter is (as far as I can determine) the more modern of the two
classes that are accepted as an argument to
On Dec 15, 6:01 pm, Brian Doyle brianpdo...@gmail.com wrote:
According to the docs the seq function should be able to take an
enumeration,
but here is what I see:
user= (seq (.elements (doto (java.util.Vector.) (.add hello) (.add
world
java.lang.IllegalArgumentException: Don't know
On Dec 15, 5:57 pm, Bradbev brad.beveri...@gmail.com wrote:
I have the following scenario:
- a server that is listening on a socket for incoming connections.
- when the server accepts a connection it uses send-off to run a
handler function to handle the connection
- the handler
Using enumeration-seq does the trick! Thanks.
user= (enumeration-seq (.entries (java.util.zip.ZipFile. path to some
jar)))
On Mon, Dec 15, 2008 at 5:14 PM, Rich Hickey richhic...@gmail.com wrote:
On Dec 15, 6:01 pm, Brian Doyle brianpdo...@gmail.com wrote:
According to the docs the seq
On Dec 15, 5:35 pm, CuppoJava patrickli_2...@hotmail.com wrote:
Hi,
I just ran into a need for using gen-class, and need some help getting
started.
I upgraded to the latest Clojure version using
svn cohttps://clojure.svn.sourceforge.net/svnroot/clojureclojure
and I run the REPL using
On Dec 15, 4:29 pm, Rich Hickey richhic...@gmail.com wrote:
On Dec 15, 5:57 pm, Bradbev brad.beveri...@gmail.com wrote:
snip
Thanks for the quick reply. Very helpful.
Cheers,
Brad
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
Tried ant clean,
it's still giving me the same error.
Unable to resolve symbol: compile in this context.
Is there a way to check my Clojure version from the REPL?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
I checked with SVN.
It says I checked out revision number 1160?
--~--~-~--~~~---~--~~
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
To unsubscribe from this
On Monday 15 December 2008 17:05, CuppoJava wrote:
I checked with SVN.
It says I checked out revision number 1160?
As of this writing, that's the latest rev.
In your previous message you said you tried ant clean. I assume that
you followed that by ant jar (or just did ant clean jar).
By the
I'm trying to understand the difference between these. Is it that
macros expanded by macroexpand-1 could result in calls to additional
macros that won't be expanded, but macroexpand will continue expanding
until no macro calls remain?
It tried:
(macroexpand-1 '(or ( 2 1) ( 3 2) ( 1 2)))
which
On Monday 15 December 2008 17:58, Mark Volkmann wrote:
I'm trying to understand the difference between these. Is it that
macros expanded by macroexpand-1 could result in calls to additional
macros that won't be expanded, but macroexpand will continue
expanding until no macro calls remain?
I tried ant clean followed by ant
which built a clojure.jar which is exactly 488,904 bytes.
And i get the message Unable to resolve symbol: compile in this
context when i type (compile) at the REPL.
Thanks very much for your help
-Patrick
--~--~-~--~~~---~--~~
--- On Mon, 12/15/08, CuppoJava wrote:
And i get the message Unable to resolve symbol:
compile in this context when i type (compile)
at the REPL.
How are you running the REPL?
It's working for me whether I build with Ant or Maven, rev 1160.
Dave
I'm running the REPL by typing
java -jar clojure.jar
in the directory C:\clojure
which contains the clojure.jar file.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Clojure group.
To post to this group, send email
Here's a summary of what I think I know about quoting in Clojure. I'd
appreciate some feedback if I said anything wrong below or maybe
didn't describe something well.
; One use of quoting is to prevent a list from being evaluated
; where the first item is treated as the name of a function
; and
On Mon, Dec 15, 2008 at 9:41 PM, Mark Volkmann
r.mark.volkm...@gmail.com wrote:
; Quoting a list is *not* the same as quoting everyting inside it.
(println ('+ '1 '2)) ; outputs 2 which is the value of the last item evaluated
Your example works, but your comment is not always true:
user= ('+
Thanks for Gorilla. I am using it with MacVim. One (or :bug :pebkac)
report...
I put plugin/gorilla.vim in /Applications/MacVim.app/Contents/
Resources/vim/runtime/plugin/ and it seems to be loaded when MacVim
starts. But the keybindings are not set up. \sr doesn't do anything
(well, the
What is the meaning of:
('+ '1 '2)
On the surface it appears that '2 is simply the last evaluated, but
lets try some similar calls:
user= ('+)
java.lang.IllegalArgumentException: Wrong number of args passed to:
Symbol
user= ('+ '1)
nil
user= ('+ '1 '2)
2
user= ('+ '1 '2 '3)
On Mon, Dec 15, 2008 at 10:42 PM, Mike Perham mper...@gmail.com wrote:
Why do we have to do this?
(in-ns 'myns)
(clojure/refer 'clojure)
Java automagically imports java.lang. Shouldn't Clojure automagically
map the core namespace?
It does if you use the 'ns' macro (depending on whether
user= ('b '{a 10, b 11, c 12})
11
Ah, yes so the 1 arg version is the map lookup, which also works in
reverse
user= ('{a 10, b 11, c 12} 'b)
11
That makes perfect sense...
What is the 2 arg version?
user= ('{a 10, b 11, c 12} 'b 'c)
11
user= ('b '{a 10, b 11, c 12} 'c)
11
user= ('b 'c '{a 10,
Hello,
doall and dorun returns different results from seond run on...
e.g.
user= (def x (for [i (range 1 3)] (do (println i) i)))
#'user/x
user= (doall x)
1
2
(1 2)
user= (doall x)
(1 2)
user= (doall x)
(1 2)
user=
user= (def x (for [i (range 1 3)] (do (println i) i)))
#'user/x
user= (dorun x)
Looks like an if then else version of the map lookup??
ie: (if (%1 %2) (%1 %2) %3)
Is this a special feature of maps in general, such that you can look
up a key but return something else if it doesn't exist?
I hadn't come across it yet, but it sounds useful :)
This is exactly right (I just
Flattening nothing gives something?
Nothing was minding the gap until you put it inside flatten's
sequence
interface at which point you got a flattened sequence full of nil.
Prior to
that there was *not* an empty list waiting for nil. Returning nothing
when in fact you
expect a list (even one
On Mon, Dec 15, 2008 at 9:43 PM, Daniel Eklund doekl...@gmail.com wrote:
Looks like an if then else version of the map lookup??
ie: (if (%1 %2) (%1 %2) %3)
Is this a special feature of maps in general, such that you can look
up a key but return something else if it doesn't exist?
I
Neat :) Thanks for the in depth examination, that's a very clear
explanation!
--~--~-~--~~~---~--~~
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
To
Hi,
Because clojure set, vector and map all implements
java.util.Comparator (indirectly via AFn), they interact with
java.util.TreeSet/TreeMap in surprising way due to overloaded ctor
(java.util.Comparator).
user= (def s (java.util.TreeSet. [1 2 3 3]))
#'user/s
user= s
#=(java.util.TreeSet.
How did you know that it delegates to 'get'?
sorry, I rushed that part.
the keyword and symbol are instances of clojure.lang.Keyword and
clojure.lang.Symbol
which are _java_ classes found in Keyword.java and Symbol.java (I
found these in the src/jvm directory)
These are what the invoke( )
whoops, chopped of the end of that last message - forgot the nasake-no
ichigeki
user (seq? '(nil))
==|]==true
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Clojure group.
To post to this group, send email to
In recent versions of test-is, it appears that exceptions are only
caught inside of the 'is' macro, as opposed to during the whole test
run. This is a problem when running test-is from slime, because when a
test throws an exception outside of the 'is' macro, it requires user
intervention to
I'll take a crack at this. It may appear that the doall and dorun return
something
different with subsequent calls but they don't actually. The doall always
returns
the sequence (1 2) and dorun always returns nil.
The first time (doall x) is called the for loop executes and prints 1 2 (a
side
the template function is missing parameter binding part of a let
--~--~-~--~~~---~--~~
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
To unsubscribe from this
I been thinking about this during the weekend, and I think I prefer the mode
to be aware of nesting (unless you can cause it to blow the stack on a large
Well, this would be my question: why? :-) Auto-indent needs to be
aware of nesting, but that's already handled in a separate pass from
the
Hi,
On 16 Dez., 04:08, Alex Burka zapper3...@gmail.com wrote:
I put plugin/gorilla.vim in /Applications/MacVim.app/Contents/
Resources/vim/runtime/plugin/.
The correct way to install Gorilla is to copy the contents of the
plugin, after and doc directories to your .vim directory in your
home
On 16.12.2008, at 02:58, Mark Volkmann wrote:
I'm trying to understand the difference between these. Is it that
macros expanded by macroexpand-1 could result in calls to additional
macros that won't be expanded, but macroexpand will continue expanding
until no macro calls remain?
Right.
Also, it's worth noting that my trick to highlight def-initions
probably isn't going to work if we have hierarchical parsing of S-
expressions. I'm not entirely sure how jEdit is going to handle
certain cases if we try to merge the two. It might be possible to
make it work, but I suspect that
For FAQ style plain text I like having the RHS comments moved below
the S-Expression as I can C-n down the file and do C-x C-e evaluation
to REPL as I go.
Once the RHS ;;;Comments are below the S-Expressions I find i like
having a symbol to indicate the eval =
I took the liberty of
82 matches
Mail list logo