Re: Clojure for banking and invenstment system?

2012-03-20 Thread Bill Smith
Perhaps you could contact someone at a company that uses Clojure for finance and ask them. On Tuesday, March 20, 2012 9:03:30 AM UTC-5, Roller wrote: I dont understand why some companies use clojure for finance. How can I work there ? What do I have to learn ? -- You received this

Re: Why does (= [] (range)) not terminate?

2012-02-17 Thread Bill Smith
It might help to know that (= (range) (range)) does not terminate either. It appears that the = operator wants to fully evaluate the second argument before comparing to the first. Since (range) is infinite, it hangs. -- You received this message because you are subscribed to the Google

Re: Java object field access

2011-07-30 Thread .Bill Smith
Oh sorry, I saw the title and thought bean access rather than field access. Obviously the code I posted relies on the presence of setters rather than fields. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Calling clojure from java.

2011-07-28 Thread .Bill Smith
It may also be useful to read up on primitives, since primitive support is often a source of impedance mismatch when software in one language talks to software in another. Would someone mind supplying a link to a description of how Clojure works with Java primitives in the 1.2.1 and 1.3

Re: Java object field access

2011-07-26 Thread .Bill Smith
/set-bean (java.util.GregorianCalendar.) {:firstDayOfWeek 3, :lenient true, :minimalDaysInFirstWeek 7}) It is not very efficient, and I would not recommend using it in a tight loop. However, it is adequate for occasional use. Bill Smith -- You received this message because you are subscribed

Re: how to preserve the natural reading order in clojure program?

2011-07-17 Thread .Bill Smith
There are programming languages that support forward references without any additional work on your part, but Clojure is not one of them. If you are accustomed to working in one of these languages, it is understandable that you have come to associate a top-down organization with being a

Re: Anyone on Google+ yet?

2011-07-14 Thread .Bill Smith
https://plus.google.com/118394169108343238158 -- 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 patient with your first post. To

Most concise way to determine that a sequence is consecutive integers starting with one?

2011-07-01 Thread .Bill Smith
I want a concise function that, given an arbitrary length sequence, determines whether the sequence is of consecutive integers starting with one. So: (f [1 2 3]) returns true (f [1 2 4]) returns false (f [0 1 2]) returns false My first try, which I am not proud of, follows: (defn f

Re: Most concise way to determine that a sequence is consecutive integers starting with one?

2011-07-01 Thread .Bill Smith
Thanks everyone. -- 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 patient with your first post. To unsubscribe from this group,

Re: Please stand firm against Steve Yegge's yes language push

2011-07-01 Thread .Bill Smith
Whereas when Steve Yegge writes: which means that everyone (including me!) who is porting Java code to Clojure (which, by golly, is a good way to get a lot of people using Clojure) is stuck having to rework the code semantically rather than just doing the simplest possible straight port.

Re: Tree vaadin?

2011-06-26 Thread .Bill Smith
Can you describe the problem you are having? -- 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 patient with your first post. To

Re: Conversion of one java example to clojure?

2011-06-24 Thread .Bill Smith
Sure could. And you don't want to do this if brownFox is a function: (Label. brownFox) If you really want it to be a function, you could do the following, but I think it would complicate things unnecessarily: (Label. (brownFox)) -- You received this message because you are subscribed to

Re: Conversion of one java example to clojure?

2011-06-23 Thread .Bill Smith
Why is brownFox a function instead of a string constant? -- 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 patient with your first

Re: Integrating jline

2011-06-21 Thread .Bill Smith
Is the jline jar in the current directory? -- 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 patient with your first post. To

Re: Integrating jline

2011-06-21 Thread .Bill Smith
Just to be sure, have you checked that jline. is defined in /usr/share/java/jline-0_9_5.jar? ConsoleRunner -- 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

Re: Using clojure-csv

2011-06-15 Thread .Bill Smith
The indentation made it confusing, but the (use ...) was outside of the (ns ...). I had the same initial reaction, especially since i prefer (:use) over (use) except when typing code into the REPL. -- You received this message because you are subscribed to the Google Groups Clojure group. To

Re: ANN: Slamhound (for reconstructing ns forms)

2011-04-26 Thread .Bill Smith
That's a great idea, Phil. Thanks for contributing! -- 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 patient with your first post.

Re: Noob Question - Clojure number rounding

2011-03-26 Thread .Bill Smith
I think that is what Brenton posted on Mar 23. -- 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 patient with your first post. To

Re: Noob Question - Clojure number rounding

2011-03-23 Thread .Bill Smith
Another way: (defn myround [x precision] (- x (bigdec) (.movePointRight precision) (+ 0.5) (int) (bigdec) (.movePointLeft precision))) -- 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

Re: Writing a generic function for getting any value for a key

2011-03-03 Thread .Bill Smith
I'm not sure what you want describe-place to do, but you don't need a new function to get the value for a key of a map. user= (def *places* {:room Nice room :basement what ever}) #'user/*places* user= (:room *places*) Nice room user= (*places* :room) Nice room user= (:basement *places*) what

Re: Printing to *out* from macro

2011-03-02 Thread .Bill Smith
It may have to do with whether the environment you are using buffers Clojure's output. When I run your example code in Emacs, I see this: user= (run-with-msg Working (Thread/sleep 2000)) Working... and then 2 seconds later, it looks like this: user= (run-with-msg Working (Thread/sleep 2000))

Re: Printing to *out* from macro

2011-03-02 Thread .Bill Smith
I guess I should say I'm using Emacs clojure-mode without Slime or swank. -- 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 patient

Re: easier exit

2011-02-26 Thread .Bill Smith
Yeah, you're right. I was thinking of what happens when you fall off the end of main. -- 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 -

Re: assert, illegal arguments, pre-conditions

2011-02-25 Thread .Bill Smith
In the Java world, examples of an Error classhttp://download.oracle.com/javase/1.4.2/docs/api/java/lang/Error.htmlare LinkageError (indicates that a class has some dependency on another class; however, the latter class has incompatibly changed after the compilation of the former class),

Re: easier exit

2011-02-25 Thread .Bill Smith
If you are running any non-daemon threads, even System.exit won't cause the JVM to shut down. Whereas as Michael Wood pointed out, there are various control sequences that do the trick reliably. -- You received this message because you are subscribed to the Google Groups Clojure group. To

Re: Anyone using the sdb library?

2011-02-24 Thread .Bill Smith
I don't know, but if you introduce breaking changes, you'd better name it version 2.0. -- 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 -

Re: Ordering of defn's?

2011-02-22 Thread .Bill Smith
Hi Jonathan, welcome to Clojure. Yes, you have to define or declare things before you refer to them. It sounds like you already know how to define things. To declare things, use the declare macro. Cheers, Bill Smith On Feb 22, 12:05 am, Jonathan Mitchem jmitc...@gmail.com wrote: I'm new

Re: How to disallow unlisted optional argument keys?

2011-02-01 Thread .Bill Smith
Yes, that's very succinct. Of course, it isn't cheap. I mean I wouldn't put it in the inner loop of Robert's image processing code. -- 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

Re: locals clearing

2011-01-30 Thread .Bill Smith
Am I correct in assuming that if those allocations had been smaller (i.e. if the JVM had not run out of memory), the GC would have eventually detected the dead references and freed them once the locals went out of scope? Bill Smith On Sunday, January 30, 2011 7:41:44 AM UTC-6, Rich Hickey

Re: api doc for clojure/libraries

2011-01-24 Thread .Bill Smith
You can download Clojure 1.2 by going to http://clojure.org/, clicking the Download link, and then clicking the Clojure 1.2 and Clojure Contrib 1.2 links. Bill -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: api doc for clojure/libraries

2011-01-24 Thread .Bill Smith
If you go to http://clojure.org/ and look at the links on the left-hand side of the page, you will find information about the language and the APIs. In particular, the API link on the left-hand side of the page takes you to information about all the core and contrib functions in the 1.2

Re: api doc for clojure/libraries

2011-01-24 Thread .Bill Smith
I don't think there is a catch-all mechanism for downloading documentation for all libraries accessible by or written in Clojure. Perhaps you could try going to the website for each library you are interested in and looking for links with names like Download and Documentation. That often

Re: Overriding a java protected method and calling the super-class method from within

2011-01-20 Thread .Bill Smith
There may be others, but one way to do it is to the Java reflection API to call the super class method through its Method object. Bill -- 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

Re: Clojure regexs

2011-01-13 Thread .Bill Smith
Here is one way: user= (import 'java.util.regex.Pattern) java.util.regex.Pattern user= (def p (Pattern/compile mon|tue|wed|thu|fri|sat|sun Pattern/CASE_INSENSITIVE)) #'user/p user= (re-find p I have a dentist appoint on Monday morning, so you'll need to take the kids to school.) Mon Bill On

running just one test

2011-01-11 Thread .Bill Smith
I have a namespace that uses clojure.test to define multiple tests. The namespace also has a test fixture. Let's say I just ran all the tests and one of them failed. The entire suite takes a while to run, so while I debug the problem, I want to run just that one test. What's the idiomatic

Re: Loading JNI

2011-01-03 Thread .Bill Smith
Question about your really basic example: it looks as if it will print Native code library failed to load if System/load succeeds, and otherwise will print nothing at all. Is that what you intended? -- You received this message because you are subscribed to the Google Groups Clojure group. To

Re: Loading JNI

2011-01-03 Thread .Bill Smith
that loads a native library and declares native methods. There's also JNA; if you Google for Clojure and JNA, you'll find examples/instructions. Bill Smith -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: Community attitude

2010-12-21 Thread .Bill Smith
the commenter has something useful to say. Sincerely, Bill Smith -- 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 patient with your

Re: about the repl

2010-12-18 Thread .Bill Smith
the REPL you are already using. Bill Smith -- 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 patient with your first post. To unsubscribe

Re: Midje: a different slant on clojure testing

2010-12-16 Thread .Bill Smith
Thank you for sharing Midje with us. I too would like to hear how it relates to clojure.test. -- 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

refactoring

2010-11-09 Thread .Bill Smith
The most recent Clojure refactoring conversation I've run across is this, from 2008: http://groups.google.com/group/clojure/browse_thread/thread/208894ac56d15d2a/8faba94a24f19639?lnk=gstq=refactor#8faba94a24f19639. Is anyone aware of more recent developments? Bill Smith Austin, TX -- You

Re: Newbie : Java Interop question

2010-10-15 Thread .Bill Smith
Try using IEssbase/JAPI_VERSION instead (replace dot with slash). On Oct 15, 11:32 am, oak ismail.oka...@gmail.com wrote: Hi All, This is how i see the package in package explorer. IEssbase.class   (I) IEssbase       (C, s f) Home              (M, s) create(String) IEssbase              

Re: clojure-mode bug in Emacs

2010-10-01 Thread .Bill Smith
I see the problem with clojure-mode versions 1.5 and 1.7.1 (I haven't tried any others). I do not use paredit. Not happening with the version i am using. Do you use paredit? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,

clojure-mode bug in Emacs

2010-09-30 Thread .Bill Smith
Has anyone else noticed this? In Emacs clojure-mode, indentation and syntax coloring can get out of whack after a string that contains an open parenthesis. In the example below, (+ 1 2) is indented incorrectly. (defn f [x] Blah blah blah. (parenthetical expression (+ 1 2)) -- You

Re: An Emacs command to close the various balanced expressions in Clojure

2010-09-28 Thread .Bill Smith
Blais, Thank you for contributing the emacs code. I have been looking for the same thing, for the reasons you and Laurent PETIT described. Bill Smith Austin, Texas -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: Extending Clojure's STM with external transactions

2010-08-31 Thread .Bill Smith
I'd like to see a day when programmers need to worry about persistence about as much as they worry about garbage collection now. Me too, but of course beware of leaky abstractions. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this

Re: cool compiler-project?

2010-08-18 Thread .Bill Smith
, so presumably the Clojure compiler does not include an optimizer. Bill Smith Austin, Texas On Aug 18, 7:35 am, Sreeraj a writeto...@gmail.com wrote: Hi, I am a post-grad student looking for a cool compiler - project to do. I am getting comfortable with clojure and would really like to help

filtering with multiple predicates

2010-07-23 Thread .Bill Smith
%) (h %)) my-list) Is there a more terse way to express the same thing? I suspect there is a mechanism similar to (or perhaps a generalization of) composition for that, but I couldn't find it in the API docs. Bill Smith Austin, TX -- You received this message because you are subscribed

Re: filtering with multiple predicates

2010-07-23 Thread .Bill Smith
of 'and.  This works though: (defmacro andf [ fns]   (let [x# (gensym)]     `(fn [~x#] (and ~@(map #(list % x#) fns) user= (filter (andf integer? odd?) [1 2 3.1]) (1) On Jul 23, 2:27 pm, .Bill Smith william.m.sm...@gmail.com wrote: I want to filter a list based on the logical AND of a set

Re: ClojureDocs.org

2010-07-13 Thread .Bill Smith
I agree. The in-code function documentation serves its purpose but could be improved upon in a medium where space is at less of a premium. Bill Smith Austin, TX On Jul 10, 12:36 pm, James Reeves jree...@weavejester.com wrote: On 10 July 2010 15:06, Stuart Halloway stuart.hallo...@gmail.com

bigint discrepency

2010-07-10 Thread .Bill Smith
-version* {:interim true, :major 1, :minor 2, :incremental 0, :qualifier master} Bill Smith Austin, Texas -- 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

Re: ClojureDocs.org

2010-07-09 Thread .Bill Smith
Having contributed a lot of examples to clojure-examples.appspot.com this week, I agree that it would be a shame to duplicate efforts. On Jul 9, 11:21 am, David Nolen dnolen.li...@gmail.com wrote: On Fri, Jul 9, 2010 at 4:32 AM, zkim zachary@gmail.com wrote: Questions / thoughts? -Zack

Re: How to convert a list to arguments?

2010-07-04 Thread .Bill Smith
I think you want the apply function: user= (apply max (list 1 2 3)) 3 On Jul 4, 10:21 pm, dennis killme2...@gmail.com wrote: For example: (max 1 2 3)  = 3 (max (list 1 2 3)) = (1 2 3) How to convert (list 1 2 3) to arguments for function? Thanks a lot. -- You received this message

Re: How fine-grained is fine-grained locals clearing?

2010-06-22 Thread .Bill Smith
I do not understand the question. On Jun 22, 5:46 am, ann tek...@gmail.com wrote: (defn fn1 [a] (fn2 a) ) When is a cleared, before call to fn2 or after? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Miscellaneous noob questions

2010-06-17 Thread .Bill Smith
is a similar thing; (let [a 1 b 2] (... some stuff that might use a and b...) ) Nothing past that last closing parenthesis (the one that matches the open parenthesis before the let) knows about the definitions of a and b. I think the term form just means stuff between parentheses. Bill Smith

Re: Opposite to bean?

2010-06-08 Thread .Bill Smith
Michael, See http://groups.google.com/group/clojure/browse_thread/thread/8e8d3c5e85e4f82d/faf0669fe3e0dca0?q=#faf0669fe3e0dca0 for one idea. Bill Smith Austin, TX -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: problem with Character/isLetter

2010-06-07 Thread .Bill Smith
To complete the thought, user= (Character/isLetter \x) true user= (Character/isLetter (.charAt x 0)) true On Jun 7, 6:17 am, Moritz Ulrich ulrich.mor...@googlemail.com wrote: isLetter accepts single characters, you gave it a string with a length of one. The error is caused by reflection when

API for posting multipart/form-data

2010-05-09 Thread .Bill Smith
Anyone know of a Clojure library (or wrapper) for posting HTTP multipart/form-data? Bill Smith Austin, TX -- 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

constructing a lazy sequence from a Java API that returns pages of data

2010-04-28 Thread .Bill Smith
1.1. I would prefer not to use 1.2 until it's released. I suspect there's a posting or web page somewhere that lays out the general template for doing this kind of thing. Anyone have any suggestions? Thanks, Bill Smith Austin, TX -- You received this message because you are subscribed

Re: constructing a lazy sequence from a Java API that returns pages of data

2010-04-28 Thread .Bill Smith
Thanks Alex. On Apr 28, 4:55 pm, ataggart alex.tagg...@gmail.com wrote: (defn pages   ([src size] (pages src 0 size))   ([src start size]     (lazy-seq       (if-let [page (.getPage src start size)]         (cons page (pages src (inc start) size)) On Apr 28, 2:38 pm, .Bill Smith

Re: Interfaces, Method/Constructor signatures, and ClassCastExceptions (bug?)

2010-03-24 Thread .Bill Smith
Jeremy, Try this instead: (.cast SomeInterface SomeInterfaceImplInstance) Example: user= (.cast (class java.util.Set) (java.util.HashSet.)) java.lang.ClassCastException (NO_SOURCE_FILE:0) user= (.cast java.util.Set (java.util.HashSet.)) #HashSet [] On Mar 23, 9:07 pm, Jeremy Wall

Re: Interfaces, Method/Constructor signatures, and ClassCastExceptions (bug?)

2010-03-24 Thread .Bill Smith
How big is your project? Can you reproduce it using something smaller? On Mar 24, 12:44 pm, Jeremy Wall jw...@google.com wrote: That seems to work but doesn't fix the clojure problem. Since clojure is preforming the cast on my behalf in a call to Reflector.boxArg -- You received this message

Re: Interfaces, Method/Constructor signatures, and ClassCastExceptions (bug?)

2010-03-24 Thread .Bill Smith
Never mind -- didn't realize those classes are part of the Google app engine. On Mar 24, 1:06 pm, .Bill Smith william.m.sm...@gmail.com wrote: How big is your project?  Can you reproduce it using something smaller? On Mar 24, 12:44 pm, Jeremy Wall jw...@google.com wrote: That seems to work

Re: Interfaces, Method/Constructor signatures, and ClassCastExceptions (bug?)

2010-03-24 Thread .Bill Smith
Jeremy, try it this way instead: http://gist.github.com/342607 On Mar 24, 1:22 pm, .Bill Smith william.m.sm...@gmail.com wrote: Never mind -- didn't realize those classes are part of the Google app engine. On Mar 24, 1:06 pm, .Bill Smith william.m.sm...@gmail.com wrote: How big is your

Re: Clojure and OOP

2010-02-11 Thread .Bill Smith
Instead of getting caught up in whether or not it supports OOP, and how to define OOP, I recommend watching http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey. On Feb 11, 6:46 am, HB hubaghd...@gmail.com wrote: Hey, Since Clojure is a LISP dialect, does this mean that it doesn't

Re: defn within defn

2010-02-10 Thread .Bill Smith
Hozumi, nested defn's are definitely not recommended. I suggest using letfn for the inner function. Bill Smith Austin, TX On Feb 10, 3:28 pm, Hozumi fat...@googlemail.com wrote: Hi all. Is it not recommended to use defn within defn? Normal function is faster than the function which has

Re: Parens again

2010-02-03 Thread .Bill Smith
. Bill Smith Austin, TX -- 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 patient with your first post. To unsubscribe from this group

Re: newbie question about ns and :require

2010-01-24 Thread .Bill Smith
, and then add its contents to my namespace. If you use :use, you can call classpath like this: (classpath). I apologize if that seemed overly verbose, but I hope it gets the point across. Bill Smith Austin, TX On Jan 24, 9:28 am, Manfred Lotz manfred.l...@arcor.de wrote: Hi all, I'm stumbling about

Re: Proxy macro, and calling on a protected method

2010-01-24 Thread .Bill Smith
a sledgehammer in the sense that it gives *everyone* public access. Bill Smith Austin, TX On Jan 24, 3:53 pm, Steven E. Harris s...@panix.com wrote: The documentation for the `proxy' macro mentions lack of access in the defined implementation to protected members: ,[ proxy ] | Note that while method

Re: Proxy macro, and calling on a protected method

2010-01-24 Thread .Bill Smith
Thanks for correcting me. I agree you would need to hang on to the Method object. On Jan 24, 5:09 pm, Steven E. Harris s...@panix.com wrote: .Bill Smith william.m.sm...@gmail.com writes: you can use java.lang.reflect.Method.setAccessible to make an otherwise protected method available

Re: Debugging in Clojure

2010-01-21 Thread .Bill Smith
I don't know about *the* preferred way, but it's my preferred way. It's a no-brainer to add print statements. I believe there is at least one logging library available too. On Jan 21, 7:27 pm, ajay gopalakrishnan ajgop...@gmail.com wrote: Is this the preferred way of debugging in Clojure? On

Re: how can i better write this (reflection, str)?

2010-01-14 Thread .Bill Smith
You might change the method-dumps definition to this: method-dumps (map (fn [i x] (str i : x)) (range 0 method-count) methods) It isn't more compact but I suppose it's more Clojure-y. On Jan 14, 6:49 pm, Raoul Duke rao...@gmail.com wrote: hi, i'm guessing there is a more Clojure-y and

Re: Creating an object given a class object

2010-01-12 Thread .Bill Smith
object and a set of argument classes, that's a little harder. On Jan 12, 3:03 am, Shantanu Kumar kumar.shant...@gmail.com wrote: On Jan 12, 12:50 pm, Konrad Hinsen konrad.hin...@fastmail.net wrote: On 11 Jan 2010, at 23:09, .Bill Smith wrote: Every class object has a newInstance method: user

Re: Creating an object given a class object

2010-01-11 Thread .Bill Smith
Every class object has a newInstance method: user= (Class/forName java.util.HashMap) java.util.HashMap user= (.newInstance (Class/forName java.util.HashMap)) #HashMap {} user= Is that what you are looking for? On Jan 11, 4:03 pm, Konrad Hinsen konrad.hin...@fastmail.net wrote: Is there a way

Re: Mocking a namespace?

2010-01-04 Thread .Bill Smith
Brian, I don't blame you -- I wouldn't want to put conditional requires in my code either. Did you consider putting your mock code in a different classpath? Here is another idea. It's tempting to suggest that you write your own version of ns that mucks with its arguments and then passes the

Re: whats the meaning of alias ?

2010-01-02 Thread .Bill Smith
Mike, are you referring to this: http://groups.google.com/group/clojure/browse_thread/thread/b4704108d85693d0/84dd4b690b6d7afd?lnk=gstq=alias#84dd4b690b6d7afd ? Roger, I realize this invalidates your test, but if do this instead, the error goes away: (alias 'c 'coretest) (testing test alias

Re: strange typecheck error

2010-01-01 Thread .Bill Smith
:45 pm, Alex Ott alex...@gmail.com wrote: Hello Bill .Bill Smith  at Thu, 31 Dec 2009 09:20:16 -0800 (PST) wrote:  .S I tried out your example with a couple of files and it appeared to  .S work.  Is it supposed to fail, or is this an example of what you had  .S to do to work around the problem

Re: strange typecheck error

2009-12-31 Thread .Bill Smith
I tried out your example with a couple of files and it appeared to work. Is it supposed to fail, or is this an example of what you had to do to work around the problem you mentioned? It's certainly ok for a function to return different data types. I guess the simplest example of that would be

Re: strange typecheck error

2009-12-30 Thread .Bill Smith
Sorry, I'm confused by the code sample. I see several loops but no corresponding recurs. On Dec 30, 11:53 am, Alex Ott alex...@gmail.com wrote: Hello all I have strange problem with type inference in Clojure.  I have following code (simplified version of real code), (defn- process-char

Re: Parenthesis Inference

2009-12-20 Thread .Bill Smith
can't you understand the reactions?  The Lisp-people have been through this discussion for what? 20 years, 30 years, 40 years?  And it comes up in intervalls which feel like once a month (don't nail me down on the numbers).  Go to comp.lang.lisp and do a search for it.  Really. There is

Re: Can a function determine it's own name at runtime?

2009-12-20 Thread .Bill Smith
On Dec 20, 3:55 pm, David Cabana drcab...@gmail.com wrote: Suppose we define a function called sq: (defn sq [x] (do (println sq) (* x x))) I wanted sq to print it's own name when run; to make it do so I inserted the name as a string. Is there some way to dynamically determine

book

2009-12-04 Thread .Bill Smith
I haven't been tracking all the changes in Clojure since the 1.0 release. Will there be a 1.1 version of the Clojure book? It's one thing to read the API documentation, and something else to have enough context to know why a function or macro exists and when it is appropriate to use it. -- You

Re: Contrib (1.0 compatible) succeeds (but fails :-)

2009-11-18 Thread .Bill Smith
: [...] $ java -version java version 1.6.0_10 Java(TM) SE Runtime Environment (build 1.6.0_10-b33) Java HotSpot(TM) Server VM (build 11.0-b15, mixed mode) Bill Smith -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: Contrib (1.0 compatible) succeeds (but fails :-)

2009-11-18 Thread .Bill Smith
clojure/walk__init.class or clojure/walk.clj on classpath: [...] $ java -version java version 1.6.0_10 Java(TM) SE Runtime Environment (build 1.6.0_10-b33) Java HotSpot(TM) Server VM (build 11.0-b15, mixed mode) Bill Smith -- You received this message because you are subscribed

Re: Contrib (1.0 compatible) succeeds (but fails :-)

2009-11-18 Thread .Bill Smith
I went to http://github.com/richhickey/clojure-contrib/ and clicked the Download button. Was that the wrong thing to do? Bill -- 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

Re: Contrib (1.0 compatible) succeeds (but fails :-)

2009-11-18 Thread .Bill Smith
Correction: I went to http://github.com/richhickey/clojure-contrib/tree/clojure-1.0-compatible and clicked the download button. On Nov 18, 8:14 pm, .Bill Smith william.m.sm...@gmail.com wrote: I went tohttp://github.com/richhickey/clojure-contrib/and clicked the Download button

Re: Contrib (1.0 compatible) succeeds (but fails :-)

2009-11-18 Thread .Bill Smith
Thank you, Mike. I will give that a try. -- 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 patient with your first post. To

Re: generating a static method

2009-03-10 Thread .Bill Smith
That worked. Thank you for your help, Christophe. Bill Smith, Austin, TX --~--~-~--~~~---~--~~ 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

macros

2009-03-10 Thread .Bill Smith
Does the Clojure book contain much conceptual material on macros? I keep finding places where I think a macro might be useful, and then the macro doesn't work and it's hard to understand why. Bill Smith Austin, TX --~--~-~--~~~---~--~~ You received this message

Re: What is Clojure NOT good for?

2009-03-06 Thread .Bill Smith
My wife and I both write software. She think's I'm insane to use Clojure because the poor sucker who has to maintain what I've written will be uncomfortable with anything other than Java. (She may also think the poor sucker won't want to deal with my dubious programming skills, but that's

Re: unbean

2009-02-25 Thread .Bill Smith
It occurs to me that the unbean function could be very useful when writing tests for code that calls Java objects. Yes, that is exactly the use I have in mind. Bill --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

unbean

2009-02-24 Thread .Bill Smith
))) {} (.getPropertyDescriptors (java.beans.Introspector/getBeanInfo clazz)))] (doseq [kv props] (((keyword (first kv)) pmap) (second kv))) x)) Bill Smith --~--~-~--~~~---~--~~ You received this message because you

Re: unbean

2009-02-24 Thread .Bill Smith
I tend to associate bean with Java beans, so the naming seems to be reversed IMHO: bean should convert a Clojure map to a Java bean, and unbean should do the reverse. Agreed the name is awkward. It's getting late here so I don't have time to test, but would a recursive map be converted to

Re: alternate syntax

2009-02-23 Thread .Bill Smith
be compatible, but if I use the second syntax because I don't want to adjust to parentheses, what happens if I need to read library code that's been written using Lisp syntax? Bill Smith --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Creating executable Jars?

2009-01-28 Thread .Bill Smith
Your manifest assumes your main class lives in the default Java package, but doesn't it really live in the progs.comex package? Also, don't you need to use the m switch when you specify a manifest to the jar command? Bill On Jan 27, 10:01 pm, smarf haskell...@gmail.com wrote: (ns

macro help

2009-01-27 Thread .Bill Smith
str '~args #'user/s user= (s 1) #ArrayList [1] user= (s 1 blah) #ArrayList [1, blah] user= (let [c value of c] (s 1 c)) #ArrayList [1, c] user= I'm using revision 1235 with Java 1.6.0_10. Any suggestions? Thanks, Bill Smith --~--~-~--~~~---~--~~ You received

Re: post on test-is and testing styles

2009-01-19 Thread .Bill Smith
I'm not sure there's much to elaborate on. It's a problem, and one I haven't solved, but I have some ideas. Ideally, I'd like to be able to write something like: (defn rnd-valid-name []   (rnd-str [A-Za-z][A-Za-z0-9_]*) (defn rnd-user []   {:uid     (rnd-int 1 100)    :name    

Re: sort behavior question

2009-01-07 Thread .Bill Smith
I wonder if the root cause might be clearer if you were to review the documentation for the sort function and then apply what it says to a smaller dataset, e.g. a pair of lists. Bill --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: detecting running as script

2009-01-03 Thread .Bill Smith
It's in *ns* isn't it? Bill On Jan 3, 12:40 pm, Mark Volkmann r.mark.volkm...@gmail.com wrote: On Fri, Jan 2, 2009 at 11:12 PM, Timothy Pratley timothyprat...@gmail.com wrote: Ah, another left field idea: if you test the namespace you will find running from REPL the namespace will be

Re: making code readable

2008-12-29 Thread .Bill Smith
My challenge to everyone on the list is to start with any version of the snake code you've seen and make it as readable as *you* think it should be by doing things like renaming variables and functions, adding comments and changing indentation. I'd really like to see what *you* think is the

  1   2   >