Re: How to convert a list to arguments?

2010-07-04 Thread Mike Meyer
On Sun, 4 Jul 2010 20:21:22 -0700 (PDT) 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? Sounds like you want apply: (apply max (list 1 2 3)) => 3 http://www.mired.org/consulting.html

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

How to convert a list to arguments?

2010-07-04 Thread dennis
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 subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that

Re: auto-indent in Counterclockwise

2010-07-04 Thread Lee Spector
On Jul 4, 2010, at 6:46 PM, Laurent PETIT wrote: > > I guess I could make the Tab-as-indent-line behavior go back to the > default mode, and introduce the > Esc.-as-no-interpretation-by-the-editor-for-the-nex-keystroke . So > people wanting to insert a real tab could do it by first hitting the >

Re: suggested changes for "Getting Started with Eclipse and Counterclockwise" page

2010-07-04 Thread Lee Spector
On Jul 4, 2010, at 6:25 PM, Laurent PETIT wrote: > > Change applied! Perfect. Thanks! -Lee -- Lee Spector, Professor of Computer Science School of Cognitive Science, Hampshire College 893 West Street, Amherst, MA 01002-3359 lspec...@hampshire.edu, http://hampshire.edu/lspector/ Phone: 413-559

Re: auto-indent in Counterclockwise

2010-07-04 Thread Laurent PETIT
Hey, 2010/7/5 Lee Spector : > > On Jul 4, 2010, at 4:10 PM, Laurent PETIT wrote: >> So there are 2 possibilities: >>  a. I create an additional "configuration parameter" so that anybody >> can choose if he wants the Tab key to behave "normally" or to be bound >> to the "reindent line" feature. And

Re: suggested changes for "Getting Started with Eclipse and Counterclockwise" page

2010-07-04 Thread Laurent PETIT
2010/7/5 Lee Spector : > > On Jul 4, 2010, at 3:50 PM, Laurent PETIT wrote: >> >> OK, done ! >> >> https://www.assembla.com/wiki/history/clojure/Getting_Started_with_Eclipse_and_Counterclockwise >> > > Wonderful. > > One small question/suggestion. I was not initially creating my files in the > src

Re: auto-indent in Counterclockwise

2010-07-04 Thread Lee Spector
On Jul 4, 2010, at 4:10 PM, Laurent PETIT wrote: > So there are 2 possibilities: > a. I create an additional "configuration parameter" so that anybody > can choose if he wants the Tab key to behave "normally" or to be bound > to the "reindent line" feature. And I make this "structural editing > m

Re: suggested changes for "Getting Started with Eclipse and Counterclockwise" page

2010-07-04 Thread Lee Spector
On Jul 4, 2010, at 3:50 PM, Laurent PETIT wrote: > > OK, done ! > > https://www.assembla.com/wiki/history/clojure/Getting_Started_with_Eclipse_and_Counterclockwise > Wonderful. One small question/suggestion. I was not initially creating my files in the src directory, but rather at the root o

Re: Accept headers of the clojure.xml/parse call

2010-07-04 Thread ataggart
This is an issue with the java lib, not clojure. If you look at the source for clojure.xml you'll see the (default) heavy lifting is done with the following fn: (defn startparse-sax [s ch] (.. SAXParserFactory (newInstance) (newSAXParser) (parse s ch))) And the string s is getting resolved som

Re: auto-indent in Counterclockwise

2010-07-04 Thread Peter Schuller
> What do you think ? What do other people think ? If people want a > configuration parameter, I'll give them one. As Stuart said in another > thread: speak now or ... :) While tabs vs. spaces in the general sense can be debated, one of the nice things about Lisp is that *everyone* (more or less)

Re: auto-indent in Counterclockwise

2010-07-04 Thread Laurent PETIT
Hi again, 2010/7/4 Lee Spector : > > [I'm not sure if the Clojure list is the right place for this, or if it > should go somewhere more specific to CCW -- please let me know if it's the > latter.] There are more specific ccw-related mls, but if nobody complains, I suggest to continue this discu

Re: suggested changes for "Getting Started with Eclipse and Counterclockwise" page

2010-07-04 Thread Laurent PETIT
2010/7/4 Lee Spector : > > On Jul 4, 2010, at 4:32 AM, Laurent PETIT wrote: >> >> If you're OK with this, I volunteer to update the wiki page. > > > Laurent: Yes indeed, I am OK with and appreciate all of the changes you > suggested. OK, done ! https://www.assembla.com/wiki/history/clojure/Getti

Re: Link to API document in the cheat sheet

2010-07-04 Thread Daniel Gagnon
And uses '() for an empty list while () is more idiomatic. On Sun, Jul 4, 2010 at 1:48 PM, ataggart wrote: > The cheatsheet is out of date (e.g., still has 'lazy-cons, old meaning > of 'next). > > > On Jul 2, 2:11 pm, ngocdaothanh wrote: > > Hi, > > > > This is my nth attempt to learn Clojure.

Re: structures contains each other

2010-07-04 Thread Moritz Ulrich
Yup, clojure.contrib.graph is really cool. I'm implementing some pathfinding-stuff with it right now. The generic model (like using a function for the edges) is simple to use and very powerful. On Sat, Jul 3, 2010 at 4:08 AM, Chas Emerick wrote: > Take a look at clojure.contrib.graph.  It's very

Re: Link to API document in the cheat sheet

2010-07-04 Thread ataggart
The cheatsheet is out of date (e.g., still has 'lazy-cons, old meaning of 'next). On Jul 2, 2:11 pm, ngocdaothanh wrote: > Hi, > > This is my nth attempt to learn Clojure. > > I think it will be an improvement if there are links to API document > for functions in the cheat sheet (http://clojure.

Online Clojure for beginners course starting july 19th

2010-07-04 Thread Arie van Wingerden
Hi, at Rubylearning.org a course on Clojure will be taught soon. See the details here ... http://rubylearning.com/blog/2010/07/04/new-course-clojure-for-beginners/ The course starts july 19th and lasts for a week. Kind regards, Arie -- You received this message because you are subscribed

Re: structures contains each other

2010-07-04 Thread ataggart
Assuming no need for coordination, atoms are a fine substitute for refs, but the structure should be similar to Laurent's example (thus avoiding conflation of identity and state), namely the var (e.g., n0, n1) should be an atom of a map containing atoms. E.g., user=> (defn set-in! [node in] (dosyn

How Do I Tell Clojure Which Classloader to Use?

2010-07-04 Thread Nick Mudge
I am writing a 3rd party module in Clojure for a Java Web Start application written in Java. I am using Clojure 1.1. I think that my clojure program and clojure.jar are on the classpath and are being loaded because when clojure.jar is not seen on the class path this error results: java.lang.Class

Re: Link to API document in the cheat sheet

2010-07-04 Thread Peter Schuller
> This is my nth attempt to learn Clojure. > > I think it will be an improvement if there are links to API document > for functions in the cheat sheet (http://clojure.org/cheatsheet). > Clicking a function name will jump right to the description for the > function is very convenient for newbies. W

Re: Clojure 1.2: Unicode string length bug?

2010-07-04 Thread Rasmus Svensson
This is most probably a repl-terminal encoding mismatch issue. Are you using JLine? It seems to be the case that it cannot handle UTF-8. There is a simple way to see if there is encoding mismatch issues: just make a seq of the string: (seq t) if everything is working correctly: => a seq of the 9

Re: suggested changes for "Getting Started with Eclipse and Counterclockwise" page

2010-07-04 Thread Lee Spector
On Jul 4, 2010, at 4:32 AM, Laurent PETIT wrote: > > If you're OK with this, I volunteer to update the wiki page. Laurent: Yes indeed, I am OK with and appreciate all of the changes you suggested. Thanks! -Lee -- Lee Spector, Professor of Computer Science School of Cognitive Science, Hamps

Re: Reflection warning on definterface/deftype fields/methods

2010-07-04 Thread Adrian Cuthbertson
> I think it is the var that should be hinted. In practice you probably > have a function which could have a hinted arg. That's it! Thanks Karl. -- 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: Reflection warning on definterface/deftype fields/methods

2010-07-04 Thread Krukow
On Jul 4, 8:51 am, Adrian Cuthbertson wrote: > I've tried every permutation of type hinting, but cannot get rid of > those warnings. > > Any ideas? > > -Thanks, Adrian. Notice this: user> (set! *warn-on-reflection* true) true user> (import '(java.io File)) java.io.File user> (definterface IFil

Re: suggested changes for "Getting Started with Eclipse and Counterclockwise" page

2010-07-04 Thread Laurent PETIT
Hi Lee! Suggestions are very welcome ! I guess your suggested improvements could as well apply to other "Getting Started" pages, so posting them on the general clojure ml seems right to me. I'll answer "inline", focusing only on the Eclipse+Counterclockwise wiki page: 2010/7/4 Lee Spector : > >