Re: re-find

2009-01-07 Thread Randall R Schulz
On Wednesday 07 January 2009 15:21, Jeff Foster wrote: I'm not understanding re-find. (re-find #bar bar) = bar whereas (re-find #(foo)|(bar) foo bar) = [foo foo nil] Why does one return a vector and one just the result directly? The use of capturing parentheses in the latter. ... is

Re: process inferior-lisp core dumped!

2009-01-05 Thread Randall R Schulz
On Monday 05 January 2009 15:30, wubbie wrote: Hi, I got core dump while running ... user= # # An unexpected error has been detected by Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x064f7e68, pid=6500, tid=2893822864 # # ... Process inferior-lisp aborted (core dumped) Does

Re: meaning and pronunciation of Clojure

2009-01-03 Thread Randall R Schulz
On Saturday 03 January 2009 13:06, Mark Volkmann wrote: ... Also, is it pronounced it is spelled or is it pronounced the same as closure? I did find a post that said it's pronounced like closure, but I've always pronounced it the way it is spelled. What's the difference? RRS

Re: meaning and pronunciation of Clojure

2009-01-03 Thread Randall R Schulz
On Saturday 03 January 2009 16:48, Mark Volkmann wrote: On Sat, Jan 3, 2009 at 4:13 PM, Randall R Schulz rsch...@sonic.net wrote: On Saturday 03 January 2009 13:06, Mark Volkmann wrote: ... Also, is it pronounced it is spelled or is it pronounced the same as closure? I did find a post

Re: literate snake

2009-01-02 Thread Randall R Schulz
On Friday 02 January 2009 14:23, Christian Vest Hansen wrote: What is it that makes this code literate? I don't know whether or not you're familiar with the concept of Literate Programming. If you are, then you can judge for yourself whether that code qualifies as literate. If not, check out

Re: Local mutually recursive functions?

2009-01-01 Thread Randall R Schulz
On Thursday 01 January 2009 11:47, Rock wrote: Given that there's nothing like letrec in Clojure, and that let acts like let* in CL, I gather that local recursive functions are possible whereas local mutually recursive ones are not. Is that correct? If so, will they ever be in the future?

Re: (Classname/staticField) is not the same as Classname/staticField

2009-01-01 Thread Randall R Schulz
On Thursday 01 January 2009 14:02, pmf wrote: On Jan 1, 10:19 pm, CuppoJava patrickli_2...@hotmail.com wrote: Hi, For some reason the Classname/staticField macro is not working properly for me. graphics= (AudioSystem/getSystem) #OpenALSystem com.jmex.audio.openal.openalsys...@ec6b00

Re: Constant expression optimization

2008-12-31 Thread Randall R Schulz
On Wednesday 31 December 2008 09:03, Dave Griffith wrote: Note, however, that your JVM may very well know that java.lang.Math.log (0.5) is a constant, and optimize the calculation out of the JIT compiled code. This wouldn't show up in the bytecode, and is extremely difficult to actually

Re: Constant expression optimization

2008-12-31 Thread Randall R Schulz
On Wednesday 31 December 2008 09:10, Dave Griffith wrote: No, but the semantics of java.lang classes are fully specified in the Java spec, and JVM implementers are allowed to rely on them. It's entirely possible that there are special case optimizations for java.lang.Math calls. Beyond the

Re: Constant expression optimization

2008-12-31 Thread Randall R Schulz
On Wednesday 31 December 2008 09:10, Dave Griffith wrote: No, but the semantics of java.lang classes are fully specified in the Java spec, Can you quote chapter and verse to this effect? I'm not finding it, at least not in The Java™ Language Specification, Third Edition. There's an index

Re: Constant expression optimization

2008-12-31 Thread Randall R Schulz
On Wednesday 31 December 2008 09:56, Dave Griffith wrote: Can't find the chapter and verse, but a bit of googling shows that GCJ does this optimization http://gcc.gnu.org/ml/gcc-patches/2003-05/msg02312.html Yes, but you claim that this guarantee is in the language specification and that it

Re: Contrib REPL Invocation Changes

2008-12-30 Thread Randall R Schulz
On Monday 29 December 2008 20:50, Stephen C. Gilardi wrote: ... Here it is working with the current clojure.jar and clojure-contrib.jar: % java -cp clojure.jar:clojure-contrib.jar clojure.contrib.repl_ln Clojure 1:1 user= (prn hi) hi nil 1:2 user= I can't replicate that: % java -cp

Re: making code readable

2008-12-29 Thread Randall R Schulz
On Monday 29 December 2008 09:11, lpetit wrote: You should consider using docstrings for documenting functions There's a big difference between the comments directed at someone reading the code (possibly the author at a later date) and someone wishing to use it. Function-level documentation

Contrib REPL Invocation Changes

2008-12-29 Thread Randall R Schulz
Hi, Following today's SVN updates to the Clojure Core and Contrib (as of this writing, at 17:42 PST, which is GMT -8), I can no longer invoke the Contrib REPL as I was able to before today. When I do, I get no prompt until I type a non-empty line, after which I'm presented with an unending

Re: Contrib REPL Invocation Changes

2008-12-29 Thread Randall R Schulz
On Monday 29 December 2008 18:36, Stephen C. Gilardi wrote: On Dec 29, 2008, at 8:49 PM, Randall R Schulz wrote: Following today's SVN updates to the Clojure Core and Contrib (as of this writing, at 17:42 PST, which is GMT -8), I can no longer invoke the Contrib REPL as I was able

Fwd: [jvm-l] Kawa Scheme on Android

2008-12-28 Thread Randall R Schulz
Howdy, Folks, The gauntlet has been thrown down: -- Forwarded Message -- Subject: [jvm-l] Kawa Scheme on Android Date: Sunday 28 December 2008 14:43 From: Per Bothner p...@bothner.com To: jvm-langua...@googlegroups.com I managed to get a hello-world-style program written in

Re: where is set operations (union, intersection, etc) defined?

2008-12-27 Thread Randall R Schulz
On Saturday 27 December 2008 12:32, wubbie wrote: Hi, I'm trying union/intersection/difference operations, but got undefined symbols error: java.lang.Exception: Unable to resolve symbol: intersection in this context (NO_SOURCE_FILE:22) user= (use 'clojure.set) nil user= (doc intersection)

Re: no quote needed?

2008-12-24 Thread Randall R Schulz
On Wednesday 24 December 2008 13:44, Mark Volkmann wrote: Why doesn't the list below that is the second argument to reduce need to be quoted? Is () always treated the same as '() ? (reduce conj () (range 5)) Empty lists self-evaluate: user= () () user= '() () Similarly: user= (eval ())

Re: SPARQL DSL - a humble request for review and guidance

2008-12-23 Thread Randall R Schulz
On Tuesday 23 December 2008 07:27, Adam Harrison (Clojure) wrote: Randall R Schulz wrote: ... Hi Randall, How do you envision read-table control to be useful in the context of this particular problem - perhaps to redefine tokens beginning with '?' as keywords? And is read-table control

Re: Random Number Generation Issues

2008-12-23 Thread Randall R Schulz
On Tuesday 23 December 2008 14:44, Chris Bunch wrote: I've got the newest version of Clojure and wrote a simple program to generate a list of 100 random numbers, but I seem to get a lot of duplicate numbers (especially when I pick a large upper bound for rand-int). My code is pretty similar

Re: Random Number Generation Issues

2008-12-23 Thread Randall R Schulz
On Tuesday 23 December 2008 14:44, Chris Bunch wrote: I've got the newest version of Clojure and wrote a simple program to generate a list of 100 random numbers, but I seem to get a lot of duplicate numbers (especially when I pick a large upper bound for rand-int). My code is pretty similar

Re: Random Number Generation Issues

2008-12-23 Thread Randall R Schulz
On Tuesday 23 December 2008 15:15, Randall R Schulz wrote: ... I tried 20 times with the same result each time. If you increase the range much beyond MAX_VALUE, you start to get the repeats and then the monotonically increasing property ceases to hold, though monotonically non-decreasing

Re: Behavior of equals (==) w/r/t keywords

2008-12-22 Thread Randall R Schulz
On Monday 22 December 2008 05:51, Mark Volkmann wrote: On Sun, Dec 21, 2008 at 2:30 PM, Randall R Schulz rsch...@sonic.net wrote: On Sunday 21 December 2008 11:33, chris wrote: ... That answers my question. Don't use a namespace, and the keyword is global. Pass in a namespace

Re: namespace function

2008-12-22 Thread Randall R Schulz
On Monday 22 December 2008 05:55, Mark Volkmann wrote: On Sun, Dec 21, 2008 at 3:44 PM, Stephen C. Gilardi wrote: ... I thought that every symbol and keyword was in some namespace, defaulting to the current namespace when the symbol or keyword is defined. Since the default namespace in the

Re: Behavior of equals (==) w/r/t keywords

2008-12-22 Thread Randall R Schulz
On Monday 22 December 2008 07:23, Rich Hickey wrote: ... This conversation is way off track. Symbols and keywords are not 'in' namespaces, they are not interned in namespaces, there are not lists of, e.g. keywords in a particular namespace. Then the term namespace is rather poorly chosen,

Re: namespace function

2008-12-22 Thread Randall R Schulz
On Monday 22 December 2008 08:10, Rich Hickey wrote: ... Clojure names have distinct namespace components so they can be used to designate/find things in namespaces. Designate, yes. Find, no, if I understand what you're saying. There's no index / repository / collection / directory /

Re: SPARQL DSL - a humble request for review and guidance

2008-12-22 Thread Randall R Schulz
On Monday 22 December 2008 07:58, Michael Wood wrote: ... This seems to be a lot simpler if you use keywords instead of ?something: The tradition of using a leading question mark to designate a (logical) variable is pretty widespread, and many practitioners from the realms of automated

Re: class diagram

2008-12-21 Thread Randall R Schulz
On Sunday 21 December 2008 07:44, Mark Volkmann wrote: Somebody created a class diagram for the Java classes and interfaces in the Clojure implementation, I believe using GraphViz, and I'm having trouble finding it now. Can someone share the URL? Also, is there a Clojure function that

Re: non-seq collections

2008-12-21 Thread Randall R Schulz
On Sunday 21 December 2008 07:51, Mark Volkmann wrote: Until this morning I was under the impression that ALL Clojure collections are sequences. Sequences are views of collections (sequential ones, if you can believe it!). All collections can be sequenced, but they are not to be equated.

Re: Behavior of equals (==) w/r/t keywords

2008-12-21 Thread Randall R Schulz
On Sunday 21 December 2008 09:33, chris wrote: This is not what I would expect: user (== :test :test) false user= (doc ==) - clojure.core/== ([x] [x y] [x y more]) Returns non-nil if nums all have the same value, otherwise false To be clear: == is for numeric

Re: Behavior of equals (==) w/r/t keywords

2008-12-21 Thread Randall R Schulz
On Sunday 21 December 2008 10:18, chris wrote: Right, waking up a bit. I would like, at some point, to serialize a bunch of structures to a byte stream. They are the mapped structs (struct :data1 :data2). Lets say I would like to do this generically, I need a function that takes a

Re: Behavior of equals (==) w/r/t keywords

2008-12-21 Thread Randall R Schulz
On Sunday 21 December 2008 11:33, chris wrote: ... That answers my question. Don't use a namespace, and the keyword is global. Pass in a namespace, and the keyword is in that namespace. Yes, the default namespace for keywords is different than for symbols, which is why the ::keyword form

Re: namespace function

2008-12-21 Thread Randall R Schulz
On Sunday 21 December 2008 13:35, Mark Volkmann wrote: Why do I get an IncompatibleClassChangeError below? I'm using revision 1180. (def my-map {:a 1 :b 2}) (namespace my-map) java.lang.IncompatibleClassChangeError (NO_SOURCE_FILE:0) I'm not sure about that specific error, though I've

Re: bit-and, bit-or arity question

2008-12-21 Thread Randall R Schulz
On Sunday 21 December 2008 15:14, ntu...@googlemail.com wrote: Why do bit-or and bit-and only accept 2 arguments? or and and accept an arbitrary number and I think it is useful to modifiy bit- or and bit-and to accept 2 or more, for example: (defn my-bit-or [x y rest] (reduce

Re: recur rationale?

2008-12-20 Thread Randall R Schulz
On Saturday 20 December 2008 06:29, verec wrote: At about 72:54 of the clojure sequence talk, Rich explains that he doesn't want to provide false guaranties to people used to true tail calls even though he could detect such tail position calls and basically transforms them into what recur

Re: IntelliJ Plugin now on Google Code

2008-12-19 Thread Randall R Schulz
Peter, Great news! On Friday 19 December 2008 05:36, Peter Wolf wrote: For those who are following or helping my efforts (thank you), the IntelliJ Clojure plugin code is now on GoogleCode. Enjoy! http://code.google.com/p/clojure-intellij-plugin/source/browse/#svn/t

Re: Circular Require Change?

2008-12-19 Thread Randall R Schulz
On Friday 19 December 2008 09:10, Cosmin Stejerean wrote: On Fri, Dec 19, 2008 at 10:30 AM, Kevin Martin martink...@gmail.com wrote: Thanks Rich! I'll keep an eye on the defect(shame there isn't a watch feature on google code). Other than this little minor annoyance, the new AOT changes

Re: running Gorilla

2008-12-18 Thread Randall R Schulz
On Thursday 18 December 2008 11:52, Mark Volkmann wrote: I'm probably doing something wrong, but I haven't been able to get Gorilla to work with Vim. The installation instructions say: ... I've done this, but it doesn't seem to recognize Gorilla shortcuts. Should I be able to open a REPL

Re: running Gorilla

2008-12-18 Thread Randall R Schulz
On Thursday 18 December 2008 12:13, Mark Volkmann wrote: On Thu, Dec 18, 2008 at 2:07 PM, Randall R Schulz rsch...@sonic.net wrote: ... First of all, check whether you Vim has the necessary Ruby support: % vim --version |sed -n -e 1p -e '/ruby/p' ... If you see -ruby then you're

Re: (Ab)using agents for inter-process communication

2008-12-18 Thread Randall R Schulz
On Thursday 18 December 2008 12:07, Stephan Mühlstrasser wrote: Hi, I've not yet seen any examples on how to deal with external processes in Clojure (I hope I didn't overlook something in clojure-contrib). The following is my attempt to start a sub-process and to pass through stdout and

Re: (Ab)using agents for inter-process communication

2008-12-18 Thread Randall R Schulz
On Thursday 18 December 2008 12:43, Stephan Mühlstrasser wrote: On Dec 18, 9:24 pm, Randall R Schulz rsch...@sonic.net wrote: On Thursday 18 December 2008 12:07, Stephan Mühlstrasser wrote: ... Is this use of agents incorrect? I would say it's an appropriate use, but you need

Re: (Ab)using agents for inter-process communication

2008-12-18 Thread Randall R Schulz
On Thursday 18 December 2008 13:33, Stephan Mühlstrasser wrote: On Dec 18, 10:01 pm, Randall R Schulz rsch...@sonic.net wrote: My question was not precise enough. I meant why can the parent process - the Clojure program - terminate before all all the output has been passed through

Re: (Ab)using agents for inter-process communication

2008-12-18 Thread Randall R Schulz
On Thursday 18 December 2008 14:44, Randall R Schulz wrote: On Thursday 18 December 2008 14:40, Stephan Mühlstrasser wrote: ... As Chouser pointed out, the flush is the important ingredient. After thinking a while about this, I'm wondering why it is necessary. The output stream

Re: Best Way to Ensure a Call to (shutdown-agents)?

2008-12-17 Thread Randall R Schulz
On Monday 15 December 2008 17:58, Randall R Schulz wrote: Hi, I've just started using agents and as I've done that, I've noticed that once you use an agent, exiting the REPL leads to a hang (with zero CPU usage). As Rich pointed out to me, this is avoided by calling (shutdown-agents). So

Re: Best Way to Ensure a Call to (shutdown-agents)?

2008-12-17 Thread Randall R Schulz
On Wednesday 17 December 2008 10:57, Randall R Schulz wrote: On Monday 15 December 2008 17:58, Randall R Schulz wrote: ... This sequence of evaluations ends in the REPL hanging: 1:1 user= (.. Runtime (getRuntime) (addShutdownHook (new Thread shutdown-agents))) nil 1:2 user= (def agent-99

Re: ClassName. Constructor Notation in Macros?

2008-12-17 Thread Randall R Schulz
On Wednesday 17 December 2008 06:21, Meikel Brandmeyer wrote: Hi Randall, On 17 Dez., 15:12, Randall R Schulz rsch...@sonic.net wrote: user= (dcmfail) java.lang.IllegalArgumentException: Unable to resolve classname: BufferedWriter (repl-1:2) This doesn't help, I know, but it works

Re: ClassName. Constructor Notation in Macros?

2008-12-17 Thread Randall R Schulz
On Wednesday 17 December 2008 05:48, Rich Hickey wrote: On Dec 16, 3:52 pm, Randall R Schulz rsch...@sonic.net wrote: ... Which takes us back to why the dot-suffix notation was not working in a macro but (new ...) was. ... Could you please post a short code example (reducing

Re: Bug? sorted-map as fn behaves differently than hash-map as fn

2008-12-17 Thread Randall R Schulz
On Wednesday 17 December 2008 06:14, Meikel Brandmeyer wrote: Hi, On 17 Dez., 14:55, MikeM michael.messini...@invista.com wrote: ((sorted-map 'a 1 'b 2) a) = ClassCastException I would think that sorted-maps and hash-maps should both give nil for this, but perhaps the sorted-map

Re: Bug? sorted-map as fn behaves differently than hash-map as fn

2008-12-17 Thread Randall R Schulz
On Wednesday 17 December 2008 06:26, Mark Volkmann wrote: ... It appears that you can create a sorted-map where all the keys are symbols and you can create a sorted-map where all the keys are strings, but you can't create a sorted-map where some of the keys are symbols and some are strings.

Re: ClassName. Constructor Notation in Macros?

2008-12-17 Thread Randall R Schulz
On Wednesday 17 December 2008 06:55, Rich Hickey wrote: ... Added issue: http://code.google.com/p/clojure/issues/detail?id=7 Rich I tried to vote / star this issue, but it seems to have no effect. There was one star when I entered and that remains the case even after two attempts to

Re: Best Way to Ensure a Call to (shutdown-agents)?

2008-12-16 Thread Randall R Schulz
On Tuesday 16 December 2008 06:02, MikeM wrote: You can try this: (let [t (new Thread (fn[] (shutdown-agents)))] (.. java.lang.Runtime (getRuntime) (addShutdownHook t))) It works for me, but seems to take a long time to complete the shutdown. I tried adding this to the module that

Re: Best Way to Ensure a Call to (shutdown-agents)?

2008-12-16 Thread Randall R Schulz
On Tuesday 16 December 2008 07:36, Randall R Schulz wrote: ... So I am still confused about the right way to deal with agents in order to get reliable and prompt exit from the REPL and why an EOF from the terminal hangs (only if agents were started and regardless of whether a shutdown hook

Re: Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-16 Thread Randall R Schulz
On Tuesday 16 December 2008 08:03, J. McConnell wrote: ... '(nil) is a list containing the single element nil. nil is no kind of list whatsoever. So, (seq? '(nil)) is true, since '(nil) is a list and lists are seqs and (seq? nil) is false since nil is not a sequence. The quoted list

ClassName. Constructor Notation in Macros?

2008-12-16 Thread Randall R Schulz
Hi, A couple of days ago I was having a lot of trouble getting the (ClassName. ctor-args...) form of constructors to work while (new ClassName ctor-args...) was fine. It eventually occurred to me that the problem had to do with those constructor calls being in macro bodies. Now it turns out

Blogging About Clojure?

2008-12-16 Thread Randall R Schulz
Hi, Wordy though I am, I've never done any blogging before, but now that I'm finally beginning to get up-to-speed on Clojure, I think I might have some things to say. So I was wondering if anyone could recommend a good blog site for this purpose? Naturally, I'll want to include source code,

Re: ClassName. Constructor Notation in Macros?

2008-12-16 Thread Randall R Schulz
On Tuesday 16 December 2008 11:32, Stuart Halloway wrote: Hi, ... However, I am left wondering what exactly is the interaction that was causing the dot-suffix form of the constructor call to fail in a macro expansion. I sense it has to do with the fact that symbols (other than

Re: ClassName. Constructor Notation in Macros?

2008-12-16 Thread Randall R Schulz
On Tuesday 16 December 2008 12:37, Rich Hickey wrote: On Dec 16, 2:32 pm, Stuart Halloway stuart.hallo...@gmail.com wrote: Hi Randall, The syntactic sugar forms are reader behavior, and occur too soon: at read time, not macro expansion time. ... Macros need to expand to real forms,

Re: confused by Vars, Refs, Agents and Atoms

2008-12-16 Thread Randall R Schulz
On Tuesday 16 December 2008 13:54, Andrew Baine wrote: Check out http://blip.tv/file/812787/ ... Rich's video presentations are also available via the iTunes store. Search for Clojure, of course—you won't get any false hits. Best, Andrew Randall Schulz

Re: Clojure classes graph (was chart.png)

2008-12-16 Thread Randall R Schulz
On Sunday 14 December 2008 13:47, Chouser 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. ... I won't be maintaining the

Re: question about (commute messages conj msg)

2008-12-16 Thread Randall R Schulz
On Tuesday 16 December 2008 18:10, wubbie wrote: Hello, My question is that conj takes two argument and how conj finds the first argument? Is it somehow provided by commute? Consider the documentation for (commute ...) (at http://clojure.org/api):

Re: Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-15 Thread Randall R Schulz
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

Re: Best Choice of Java Class For *out*

2008-12-15 Thread Randall R 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

Re: Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-15 Thread Randall R Schulz
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

Re: Nested Java Types

2008-12-15 Thread Randall R Schulz
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

Macro Style Question: Expanding to Multiple (def ...) Forms

2008-12-15 Thread Randall R Schulz
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

Re: Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-15 Thread Randall R Schulz
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=

Re: “Don’t know how to create ISeq from: Symbol” error

2008-12-15 Thread Randall R Schulz
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

Re: Nested Java Types

2008-12-15 Thread Randall R Schulz
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

Re: Best Choice of Java Class For *out*

2008-12-15 Thread Randall R Schulz
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

Re: Best Choice of Java Class For *out*

2008-12-15 Thread Randall R Schulz
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

Re: Getting Started with Gen-Class

2008-12-15 Thread Randall R Schulz
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

Re: macroexpand-1 vs. macroexpand

2008-12-15 Thread Randall R Schulz
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?

Re: DISCUSS: replace (rand)

2008-12-14 Thread Randall R Schulz
On Saturday 13 December 2008 23:19, Mark H. wrote: So I'm going to stop pretending like I'm an expert and actually post some Clojure code. Be constructively critical 'cause I'm a n00b in that regard ;-) This is a pseudorandom number generator for the Gaussian (0,1) distribution. ... [

Re: Functional programming newbie question

2008-12-14 Thread Randall R Schulz
On Sunday 14 December 2008 09:00, harrison clarke wrote: yep. a function f(n) is O(n) if there are constants c and n0 such that f(n) = c * n for all n = n0. sometimes you do care about the c and the n0, though. To be sure. And there can be times that, for the problem size you know you need

Re: Proxy mappings now use strings for keys - deliberate?

2008-12-14 Thread Randall R Schulz
On Sunday 14 December 2008 10:40, James Reeves wrote: I've notice that the latest builds of Clojure now use strings for keys in proxy mappings, whilst in the past they used to use symbols. Was this change deliberate? Yes. Rich pointed this out in the SVN commit commentary for 1159: proxy

Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-14 Thread Randall R Schulz
Hi, I ran into a special case that I'd like to avoid. When (filter ...) is either applied to an empty collection or the filter predicate returns false for all the elements in the supplied collection, filter returns nil. Would it be acceptable and desirable for it to return and empty list in

Re: Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-14 Thread Randall R Schulz
On Sunday 14 December 2008 11:08, Randall R Schulz wrote: Hi, I ran into a special case that I'd like to avoid. When (filter ...) is either applied to an empty collection or the filter predicate returns false for all the elements in the supplied collection, filter returns nil. Would

Re: Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-14 Thread Randall R Schulz
On Sunday 14 December 2008 11:08, Randall R Schulz wrote: ... It turns out that flatten (from clojure.contrib.seq-utils) is really where I go wrong with my simple version of gather-slot-values. Does this makes sense (specifically the last one)? user= (flatten []) nil user= (flatten ()) nil

Best Choice of Java Class For *out*

2008-12-14 Thread Randall R Schulz
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: java.lang.IllegalArgumentException: No matching method found: printMessage

Acceptable Arguments to Two-Argument (symbol ...)

2008-12-14 Thread Randall R Schulz
Hi, The doc text for symbol is: user= (doc symbol) - clojure.core/symbol ([name] [ns name]) Returns a Symbol with the given namespace and name. However, the ns argument must be a String, not a namespace. Would it be reasonable to allow an actual namespace as the ns

Re: Gorilla: Release of Version 1.1.0

2008-12-13 Thread Randall R Schulz
On Saturday 13 December 2008 00:10, Meikel Brandmeyer wrote: Hi Randall, ... For your problem with the ruby-enabled vim: at least debian has a vim-ruby package, IIRC. So maybe Suse has this also. I installed a couple of new packages on my 10.3 box and now vim --version reports +ruby, so

Re: Gorilla: Release of Version 1.1.0

2008-12-13 Thread Randall R Schulz
On Saturday 13 December 2008 08:17, Brian Doyle wrote: I'm sure I'm doing something stupid but I can't start up gorilla. ... Here is my script: java -cp ~/share/clojure.jar:~/share/clojure-contrib.jar:~/share/gorilla.jar de.kotka.gorilla Tildes don't expand anywhere but at the beginning

Re: Functional programming newbie question

2008-12-13 Thread Randall R Schulz
On Saturday 13 December 2008 14:29, levand wrote: ... Calling reverse when done is still O(N) Really? Maybe my grasp of big-O notation is faulty, but isn't the recursive function itself O(n), and then a reversal another O(n) operation on top of that, leading to two complete traversals of

Re: Functional programming newbie question

2008-12-13 Thread Randall R Schulz
On Saturday 13 December 2008 15:35, Randall R Schulz wrote: ... Any algorithm that requires to O(n) steps is itself O(n). And by that I meant ...two O(n) steps..., of course. The big-O concept is roughly equality up to a constant factor. Randall Schulz

Re: Gorilla: Release of Version 1.1.0

2008-12-13 Thread Randall R Schulz
On Saturday 13 December 2008 17:19, Drew Olson wrote: ... You can also compile vim from source with the +ruby flag Yes, of course, but that's a bridge too far. - Drew RRS --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: throw-if with no exception class

2008-12-12 Thread Randall R Schulz
On Friday 12 December 2008 01:18, Ralf Bensmann wrote: Hi Rich, I am very interested in your view of the world - why are 'checked' exceptions evil? It's a huge and unending debate (last I checked). It's probably not worth recapping it here. I'm sure there are reams of blogs and email list

Re: Gorilla: Release of Version 1.1.0

2008-12-12 Thread Randall R Schulz
On Friday 12 December 2008 13:43, Meikel Brandmeyer wrote: Dear vimming Clojurians, (or was the name changed?) I'd like to announce the next release of Gorilla. ... Meikel Great news, thanks! I think I may have asked this before, but what Vim version requirements does Gorilla have?

Re: Gorilla: Release of Version 1.1.0

2008-12-12 Thread Randall R Schulz
On Friday 12 December 2008 13:59, Meikel Brandmeyer wrote: Hi Randall, Am 12.12.2008 um 22:54 schrieb Randall R Schulz: I think I may have asked this before, but what Vim version requirements does Gorilla have? .. I guess what you should say at least is that it requires Ruby

Re: Running out of memory when using filter?

2008-12-12 Thread Randall R Schulz
On Friday 12 December 2008 15:15, Mark Engelberg wrote: ... --Mark Not being nearly sophisticated enough in Clojure, FP or the relevant concepts to say anything other than that all makes complete sense to me, I wonder only what would be the impact on existing programs were the default to

Re: frequency of each unique item in collection

2008-12-11 Thread Randall R Schulz
On Thursday 11 December 2008 06:33, Dave Griffith wrote: On Dec 11, 9:21 am, bOR_ [EMAIL PROTECTED] wrote: Hi all, I thought I remembered there was a method in the api somewhere that would count the frequency of each unique item in a collection, but I can't find it anymore. What would

Re: Learning Clojure

2008-12-11 Thread Randall R Schulz
On Thursday 11 December 2008 07:41, samppi wrote: Great article, but I'm not sure this part in the keyword section is correct: Keywords exist simply because, as you'll see, it's useful to have names in code which are symbol-like but not actually symbols. Keywords have no concept of being

Re: jEdit Mode for Clojure

2008-12-11 Thread Randall R Schulz
On Thursday 11 December 2008 10:34, Daniel Spiewak wrote: It's been too long since I've looked at this thread... I took a look at the mode you linked. My mode is quite a bit more powerful, particularly with the changes I added today. ... Where do we find your latest version? Or do you want

Re: jEdit Mode for Clojure

2008-12-11 Thread Randall R Schulz
On Thursday 11 December 2008 12:54, Daniel Spiewak wrote: Where do we find your latest version? Or do you want / need to refine it further? I'm constantly messing around with it and trying to make it a little better. The very latest version is always here:

Re: jEdit Mode for Clojure

2008-12-11 Thread Randall R Schulz
On Thursday 11 December 2008 12:54, Daniel Spiewak wrote: Where do we find your latest version? Or do you want / need to refine it further? I'm constantly messing around with it and trying to make it a little better. The very latest version is always here:

Re: Lisp/Clojure doesn't have syntax?

2008-12-11 Thread Randall R Schulz
On Thursday 11 December 2008 13:37, Paul Barry wrote: I've been reading the latest chapter from Stuart's book, Chapter 7: Macros, and he makes this statement: Clojure has no special syntax for code. Code is simply Clojure data. This is true for normal functions, but also for special forms

Re: My quest to modify a leaf node in an arbitrarily deep map (question posed)

2008-12-10 Thread Randall R Schulz
On Wednesday 10 December 2008 10:40, Daniel Eklund wrote: Hi all, ... One thing I immediately ran up against were certain situations where I have a map and want to modify a value several levels deep into the hierarchy. Imagine the following structure: (def nested-structure { :level 0,

Re: Learning Clojure

2008-12-10 Thread Randall R Schulz
On Wednesday 10 December 2008 10:27, Brian W wrote: I've created a new Clojure intro at http://en.wikibooks.org/wiki/Learning_Clojure. ... ... Another issue I had is we don't have a good blanket term for Vars, Refs, Agents, and Atoms. Speaking of these, your article mentions and describes

Re: why can't I set! stuff in user.clj?

2008-12-09 Thread Randall R Schulz
On Tuesday 09 December 2008 18:10, Randall R Schulz wrote: ... Since I love to share my BASH code (and I anxiously look forward to the day that I'm willing to share my Clojure code), I've attached my clojure-svn script. ... By the way, tab stops are set at 4-column intervals. I forgot

Re: Java vararg functions called from Clojure

2008-12-08 Thread Randall R Schulz
On Monday 08 December 2008 10:53, Stephen C. Gilardi wrote: On Dec 8, 2008, at 1:34 PM, Tom Emerson wrote: I just wanted to make sure I wasn't missing something. Perhaps something along the lines of (defn format-string [fmt args] (String/format fmt (to-array args))) Hi Tom,

Re: Clojure Blogs | Yahoo Pipes | Clojure Pipe

2008-12-07 Thread Randall R Schulz
On Saturday 06 December 2008 20:59, Bill Clementson wrote: On Sat, Dec 6, 2008 at 2:11 PM, Randall R Schulz [EMAIL PROTECTED] wrote: ... Fascinating. Is that diagram generated by Yahoo! Pipes itself, or did you draw it? It's generated by Yahoo Pipes itself, not me. Yeah, I found

  1   2   >