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 Groups

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 c

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 release

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 "natu

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 un

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 p

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, se

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 [numb

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 uns

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 th

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 firs

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: 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 unsub

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 u

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 Not

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 *place

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: 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 2

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 - plea

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 po

Re: assert, illegal arguments, pre-conditions

2011-02-25 Thread .Bill Smith
In the Java world, examples of an Error classare 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), NoCl

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 - plea

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 wrote: > I'm new to Lisps in

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 t

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
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 w

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 rele

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

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" Bi

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 wa

Re: Loading JNI

2011-01-03 Thread .Bill Smith
eract with a Java wrapper 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.

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.

Re: Community attitude

2010-12-21 Thread .Bill Smith
u may find 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 - pl

Re: about the repl

2010-12-18 Thread .Bill Smith
n 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.

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 moderate

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=gst&q=refactor#8faba94a24f19639. Is anyone aware of more recent developments? Bill Smith Austin, TX

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 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 >              (M, c) Home() >

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 recei

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,

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 g

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 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 > &g

Re: filtering with multiple predicates

2010-07-23 Thread .Bill Smith
rks > 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" wrote: > > > I want to filter a list base

filtering with multiple predicates

2010-07-23 Thread .Bill Smith
%) (g %) (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 subscri

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 wrote: > On 10 July 2010 15:06, Stuart Halloway wrote: > > > (6) Because docstrings

bigint discrepency

2010-07-10 Thread .Bill Smith
1, shouldn't "1.5" also coerce to 1? user=> *clojure-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 pos

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 wrote: > On Fri, Jul 9, 2010 at 4:32 AM, zkim wrote: > > > Questions / thoughts? > > > -Zack > > This is great. I think the main

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 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 because you are

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 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 clojure@googlegroups.

Re: Miscellaneous noob questions

2010-06-17 Thread .Bill Smith
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 be

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, sen

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 wrote: > isLetter accepts single characters, you gave it a string with a length of one. > The error is caused by reflection when clojure searches for a f

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 n

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 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 

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

2010-04-28 Thread .Bill Smith
API. I'm using Clojure 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

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" wrote: > Never mind -- didn't realize those classes are part of the Google app > engine. > > On Mar 24, 1:06 pm, ".Bill Smith" wrote: > > > How bi

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" wrote: > How big is your project?  Can you reproduce it using something > smaller? > > On Mar 24, 12:44 pm, Jeremy Wall wrote: > > > That seems

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 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 because you ar

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.)) # On Mar 23, 9:07 pm, Jeremy Wall wrote: > You can also

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 wrote: > Hey, > Since Clojure is a LISP dialect, does this mean that it doesn't > support OOP? > Than

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 wrote: > Hi all. > Is it not recommended to use defn within defn? > > Normal function is faster than the function which h

Re: Parens again

2010-02-03 Thread .Bill Smith
and it's open source. 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 f

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" wrote: > ".Bill Smith" writes: > > you can use java.lang.reflect.Method.setAccessible to make an > > otherwise protected method availa

Re: Proxy macro, and calling on a protected method

2010-01-24 Thread .Bill Smith
7;s a sledgehammer in the sense that it gives *everyone* public access. Bill Smith Austin, TX On Jan 24, 3:53 pm, "Steven E. Harris" wrote: > The documentation for the `proxy' macro mentions lack of access in the > defined implementation to protected members: > > ,[ proxy ] &g

Re: newbie question about ns and :require

2010-01-24 Thread .Bill Smith
fied library if it hasn't already been loaded, 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, Manfre

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 wrote: > Is this the preferred way of debugging in Clojure? > > On Thu, Jan 21, 201

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 wrote: > hi, > > i'm guessing there is a more Clojure-y and compact way t

Re: Creating an object given a class object

2010-01-12 Thread .Bill Smith
n that takes a class object and a set of argument classes, that's a little harder. On Jan 12, 3:03 am, Shantanu Kumar wrote: > On Jan 12, 12:50 pm, Konrad Hinsen wrote: > > > On 11 Jan 2010, at 23:09, .Bill Smith wrote: > > > > Every class object has a newInstance method:

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")) # user=> Is that what you are looking for? On Jan 11, 4:03 pm, Konrad Hinsen wrote: > Is there a way to create a new object by call

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 res

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=gst&q=alias#84dd4b690b6d7afd ? Roger, I realize this invalidates your test, but if do this instead, the error goes away: (alias 'c 'coretest) (testing "test alias fun

Re: strange typecheck error

2010-01-01 Thread .Bill Smith
Integer object, not an int primitive. On Dec 31 2009, 12:45 pm, Alex Ott 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

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 th

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 wrote: > Hello all > > I have strange problem with type inference in Clojure.  I have following > code (simplified version of real code), > > (defn- process-char [#^InputStream

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 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 the name

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 n

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
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 unsubs

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" wrote: > I went tohttp://github.com/richhickey/clojure-contrib/and clicked > the Download button.  Was that the w

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 pos

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

2009-11-18 Thread .Bill Smith
sed by: java.io.FileNotFoundException: Could not locate > > 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 H

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

2009-11-18 Thread .Bill Smith
alk.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 to the Google Groups "Clojure" gro

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 th

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 u

Re: generating a static method

2009-03-09 Thread .Bill Smith
a.lang.String[]); } I'm using Clojure rev 1327. 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

generating a static method

2009-03-09 Thread .Bill Smith
Would someone mind showing me a brief example of how to define a static method (using gen-class)? Thanks, Bill Smith Austin, TX --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Re: class of java array

2009-03-09 Thread .Bill Smith
e question, "How do I determine what type of object is inside an array?" I interpreted the original question to be, "How do I distinguish Arrays from other kinds of objects?" Here's one way to do that: user=> (.isArray (class (into-array ["a"]))) true user=>

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 anothe

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 Gr

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 con

unbean

2009-02-24 Thread .Bill Smith
method (getParameterTypes) (assoc m (keyword name) (fn [v] (. method (invoke x (into-array [v]) m))) {} (.getPropertyDescriptors (java.beans.Introspector/getBeanInfo clazz)))] (doseq [kv props] (((ke

Re: alternate syntax

2009-02-23 Thread .Bill Smith
cessor, code written in the two syntaxes should 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 --~--~-~--~~~---~

Re: Junit and Clojure and the new gen-class

2009-02-11 Thread .Bill Smith
Is it fair to say you really want to use Junit rather than the test framework in clojure-contrib? I can think of reasons why you might want to use Junit but I don't want to put words in your mouth. Bill --~--~-~--~~~---~--~~ You received this message because you

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 wrote: > (ns progs.comex.compileexamples >

macro help

2009-01-27 Thread .Bill Smith
'args=[a,b,value of c]'. To take the extra Java class out of the loop, I wrote this second macro: user=> (defmacro s [& args] `(java.util.Arrays/asList (into-array (map str '~args #'user/s user=> (s "1") # user=> (s "1" "blah") # us

  1   2   >