REPL Namespace Display

2008-12-18 Thread brian
owdy> (clojure.core/refer 'clojure.core) nil howdy> *ns* # howdy> (remove-ns 'howdy) # howdy> *ns* # howdy> howdy> (in-ns 'user) # howdy> Switching to another ns corrects it. BTW l'm really looking forward to digging into this language as a lo

Re: REPL Namespace Display

2008-12-18 Thread brian
That's correct. And I couldn't reproduce with the java clojure.lang.Repl either. Guess I was thinking it was just a pass through... I'm an emacs & slime noob too ;) -Brian On Dec 18, 6:00 pm, Chouser wrote: > On Thu, Dec 18, 2008 at 6:02 PM, brian wrote: > > &g

Re: Is knowing Java a prerequisite for using Clojure?

2009-09-17 Thread Brian
commendation and your background you might be able to get by with going directly to the java language specification ( http://java.sun.com/docs/books/jvms/second_edition/html/VMSpecTOC.doc.html). Brian F. On Thu, Sep 17, 2009 at 10:59 AM, Terrance Davis wrote: > > I'll add my two ce

Re: frameworks

2009-09-18 Thread Brian
I thought the question was looking for the Clojure equivalent to Ruby on Rails (i.e. Conjure ). On Fri, Sep 18, 2009 at 9:54 AM, David Nolen wrote: > What do you mean by development frameworks? IDE support? > On Fri, Sep 18, 2009 at 8:08 AM, demet

Re: Funding Clojure 2010

2009-12-17 Thread brian
wrapped as possible, with a good online tutorial, and chat help all bundled together in a quick install. Brian Rich Hickey wrote: > Funding Clojure 2010 > > Background > -- > > It is important when using open source software that you consider who > is pa

newbie clojure/eclipse question

2010-01-03 Thread brian
looked in the run configuration,and x is in the default classpath. thanks Brian -- 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 -

newbie swank clojure emacs

2010-01-10 Thread brian
when I call slime (require 'swank.swank) (swank.swank/ignore-protocol-version "2010-01-06") (do (.. java.net.InetAddress getLocalHost getHostAddress) nil)(swank.swank/start-server "/cygdrive/c/DOCUME~1/brian/LOCALS~1/Temp/slime.2848" :encoding "iso-latin-1-unix&quo

Re: newbie swank clojure emacs

2010-01-11 Thread brian
10, 2010 at 5:58 AM, brian wrote: Hi, I'm trying to follow the directions at: http://riddell.us/tutorial/slime_swank/slime_swank.html I'm doing this under cygwin. I think I did everything correctly, but it seems not to find the clojure.jar file although I have it and the clojure-c

clojure box "value as variable is void ?"

2010-01-11 Thread brian
ev/project/src” “c:/dev/my-lib.jar”)) and I get this error when I bring clojure box up: Warning (initialization): An error occurred while loading `c:/Documents and Settings/brian/.emacs': Symbol's value as variable is void: “c:/dev/project/src” of course, these aren't my real p

trying to call jar files in clojure box

2010-01-12 Thread brian
mbol: defroutes in this context (NO_SOURCE_FILE:1) [Thrown class clojure.lang.Compiler$CompilerException] I get the same problem when I setq in my .emacs. Thanks Brian -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, sen

classpath in clojure box

2010-01-12 Thread brian
Hi all, I put the example code from Programming Clojure book here: C:\shcloj-code\code\examples I verified that "introduction.clj" is there. This is cut and pasted from my .emacs file located in c:\program files\brian (setq swank-clojure-classpath (list "c:\shcloj-cod

Re: classpath in clojure box

2010-01-13 Thread brian
Shawn Hoover wrote: On Tue, Jan 12, 2010 at 10:05 PM, brian <mailto:brw...@gmail.com>> wrote: Hi all, I put the example code from Programming Clojure book here: C:\shcloj-code\code\examples I verified that "introduction.clj" is there. This is

Re: classpath in clojure box

2010-01-13 Thread brian
I was wondering if this is the right statement for setting the external classpath? setq swank-clojure-classpath Shawn Hoover wrote: On Tue, Jan 12, 2010 at 10:05 PM, brian <mailto:brw...@gmail.com>> wrote: Hi all, I put the example code from Programming Clojure book

Re: classpath in clojure box

2010-01-14 Thread brian
Shawn Hoover wrote: On Wed, Jan 13, 2010 at 8:38 PM, brian <mailto:brw...@gmail.com>> wrote: I was wondering if this is the right statement for setting the external classpath? setq swank-clojure-classpath Another way is to use M-x swank-clojure-project. You enter a

Re: classpath in clojure box

2010-01-14 Thread brian
Michael Wood wrote: 2010/1/14 brian : Shawn Hoover wrote: On Wed, Jan 13, 2010 at 8:38 PM, brian mailto:brw...@gmail.com>> wrote: I was wondering if this is the right statement for setting the external classpath? setq swank-clojure-classpath Another way is to u

Re: classpath in clojure box

2010-01-14 Thread brian
Michael Wood wrote: 2010/1/14 brian : Shawn Hoover wrote: On Wed, Jan 13, 2010 at 8:38 PM, brian mailto:brw...@gmail.com>> wrote: I was wondering if this is the right statement for setting the external classpath? setq swank-clojure-classpath Another way is to u

Re: [ANN] units.clj - unit conversion functions without repeating yourself

2010-01-14 Thread Brian
This is more java related but there is a java library and application ( http://futureboy.us/frinkdocs/) that provides a set of very powerful unit conversion tools. On Thu, Jan 14, 2010 at 10:49 AM, Scott Jaderholm wrote: > Hi, > > I created a library that provides unit conversion functions[1] fo

Re: classpath in clojure box

2010-01-15 Thread brian
ok i see it Brian Shawn Hoover wrote: On Thu, Jan 14, 2010 at 3:17 AM, brian <mailto:brw...@gmail.com>> wrote: The above didn't work, but apparently it doesn't pick up my .emacs file, which has (setq swank-clojure-classpath (list "c:/s

Microsoft drops Software Transactional Memory

2010-05-14 Thread Brian
Not directly related to Clojure but I thought this would be of interest to folks: http://www.infoq.com/news/2010/05/STM-Dropped http://www.reddit.com/r/programming/comments/c4367/microsofts_experiments_with_software/ -- You received this message because you are subscribed to the Google Groups "C

Re: D&D + Clojure?

2018-04-05 Thread Brian
I'm interested. For my own uses I would be curious to see how difficult it would be to update (degrade? retrograde? :) ) to 3.5/Pathfinder. On Thu, Apr 5, 2018 at 11:04 AM, Davide Taviani wrote: > Hey! > I'm a DM, a user of OrcPub2 and a full-time clojure + cljs developer (for > data science s

Re: Reviewers needed for new Clojure book!

2015-08-25 Thread Brian
A bit late to the party but please include me in the list of possible reviews. thanks, BDF. On Tue, Aug 25, 2015 at 12:06 AM, Akhil Wali wrote: > Thank you everyone for the great response! > I'll notify Packt and they shall contact anyone who is shortlisted as a > reviwer. > > > On Monday, Augu

Re: Help with idiomatic clojure.

2015-11-12 Thread Brian
; Also, in terms of enforcing contracts - Prismatic Schema is highly > recommended but hard to ‘englishify’ the errors. Failures are considered > API failures rather than happy-case failures. > > On 12 Nov 2015, at 16:09, Brian Forester wrote: > > I'm writing a very small

Re: Help with idiomatic clojure.

2015-11-13 Thread Brian
nt (if (seq some-sequence) true false) is preferred by > some (I won’t say more idiomatic) than (if (empty? some-sequence) true > false). Also, in no-errors branch you probably want to return status: 200? > > > On 12 Nov 2015, at 19:44, Brian wrote: > > Thanks Colin, Thanks Er

Re: Anyone on Google+ yet?

2011-07-14 Thread Brian
https://plus.google.com/100763770877733610336/posts On Thu, Jul 14, 2011 at 3:15 PM, Jonathan Cardoso wrote: > https://plus.google.com/115729535012467854741 > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email

Re: ClojureScript Presentation - video

2011-07-23 Thread Brian
Here ya go: http://blip.tv/clojure/rich-hickey-unveils-clojurescript-5399498 Brian On Jul 21, 1:09 am, Harrison Maseko wrote: > Hi all, > I did not watch the live cast of Rich's presentation on ClojureScript. > Could someone please point me to a video or audio recording of the

Meaningless Poll Time: Which JVM Language Is On Top?

2012-02-23 Thread Brian
http://java.dzone.com/polls/which-jvm-language-top-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 - please be patient with your first post

Re: Clojure Conj extracurricular activities spreadsheet

2011-10-30 Thread Brian
Please sign me up for: * ClojureScript * core.logic / minikanren * Go * Jamming with Overtone * The web and Clojure On Oct 30, 6:10 am, Krukow wrote: > On Oct 25, 5:11 pm, Fogus wrote: > > > This should be epic. > > Indeed. Please sign me up for: > > * ClojureScript > * Pallet -- You received

Re: randomize a collection?

2008-12-02 Thread Brian Doyle
4f?lnk=gst&q=shuffle#0e19ab338452c64f > The recommendation was to use java.util.Collections/shuffle and an > example was given: > > (defn shuffle [coll] > (let [l (java.util.ArrayList. coll)] >(java.util.Collections/shuffle l) >(seq l))) > > user=> (shuffle [1

Re: A try on condp (was: Re: proposal: match multimethod)

2008-12-03 Thread Brian Doyle
Can you include an example usage of this function? Thanks. On Wed, Dec 3, 2008 at 12:51 PM, Meikel Brandmeyer <[EMAIL PROTECTED]> wrote: > Hi Stuart and Rich, > > Am 03.12.2008 um 19:00 schrieb Stuart Sierra: > >> I'm pretty sure I don't like the sound of that at all. We had a nice >>> discussio

Re: Bug: recur won't work in tail position within cond

2008-12-03 Thread Brian Doyle
This seems to work for me: (defn sub-til-0 [n] (cond (zero? n) 0 :else (recur (dec 1 I'm not sure what those extra ['s are for in your example. On Wed, Dec 3, 2008 at 9:39 PM, puzzler <[EMAIL PROTECTED]> wrote: > > (defn sub-til-0 [n] > (if (zero? n) 0 (recur (dec 1 > >

unsupported binding form for cond-let

2008-12-05 Thread Brian Doyle
I started to play with cond-let in the contrib.cond package and got an unexpected error: user=> (cond-let [x (zero? 0)] (println "hello world")) java.lang.Exception: Unsupported binding form: (zero? 0) (NO_SOURCE_FILE:11) user=> (cond-let x (zero? 0) (println "hello world")) hello world Maybe it

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

2008-12-09 Thread Brian Doyle
Stuart, I have a ~/.cljrc file that has this stuff in there and in my bash (clj) script to start clojure I do: $JAVA -cp $CLOJURE_JARS clojure.lang.Repl ~/.cljrc On Tue, Dec 9, 2008 at 1:12 PM, Stuart Halloway <[EMAIL PROTECTED]>wrote: > > Why can't I call set! in user.clj? (And what is the idi

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

2008-12-09 Thread Brian Doyle
Steve, Could you post your bash shell script that starts Clojure? I would like to see what you have concerning the new options that can be passed to the updated clojure.jar. Thanks. On Tue, Dec 9, 2008 at 1:59 PM, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote: > user.clj is loaded before threa

Learning Clojure

2008-12-10 Thread Brian W
I've created a new Clojure intro at http://en.wikibooks.org/wiki/Learning_Clojure. While Rich's screencasts and reference docs are great, they don't always lay things out in a digestible order. My intro is meant as a sequential tour through the essential concepts, not a practical tutorial. In par

Re: Learning Clojure

2008-12-10 Thread Brian Will
sps never had to see wide adoption. On Dec 10, 12:03 pm, "J. McConnell" <[EMAIL PROTECTED]> wrote: > On Wed, Dec 10, 2008 at 1:27 PM, Brian W <[EMAIL PROTECTED]> wrote: > > > Another issue I had is we don't have a good blanket term for Vars, > > Refs,

Re: Not understanding the proper use of map

2008-12-10 Thread Brian Carper
On Dec 10, 12:07 pm, "Michael Wood" <[EMAIL PROTECTED]> wrote: > OK, I think I know why this happens. It's treating the '+ as the key > for a map, and using the second integer as the default value. I'm not > sure why it treats an integer as a map, though: > Wow, that's a bit of a gotcha. It's

Re: Learning Clojure

2008-12-10 Thread Brian Will
towards the end. Vars have to be introduced before I can discuss namespaces, but the thread- local binding aspect of Vars can be deferred to later. btw, you'll see a few notes I left in the text in square brackets where I wasn't sure on some point.

Re: Learning Clojure

2008-12-10 Thread Brian Will
Hopefully keeping the whole text reasonably short will encourage volunteers. Thanks for your feedback. --Brian Will --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group

Re: Learning Clojure

2008-12-11 Thread Brian Will
Tim, just go ahead and make any changes you like. If I don't like them, I can always revert ;) Actually, I'm sure anything you add we can find a place for, but like I said, that would likely be a separate example page in most cases. Thanks, Randall, I mention keywords-as-functions where I talk ab

Re: Java interop question

2008-12-11 Thread Brian Doyle
This article has a good example using the proxy function. http://gnuvince.wordpress.com/2008/11/18/fetching-web-comics-with-clojure-part-2/ On Thu, Dec 11, 2008 at 1:22 PM, Randall R Schulz wrote: > > On Thursday 11 December 2008 11:31, Mark Engelberg wrote: > > I understand how Clojure lets yo

iteration idioms

2008-12-12 Thread Brian Will
st old) (prepend3 new (first old) user=> (24 6 3 5 3 5 7 3 5 3 2) Again, hardly elegant. Maybe there's a cleaner way to use loop in these cases, or maybe I'm just forgetting some function(s) to use. Hopefully someone can demonstrate better idioms to handle

Re: iteration idioms

2008-12-12 Thread Brian Will
Thanks, Mark. I don't suppose (reduce into ...) is a common enough idiom that it deserves its own function? Perhaps (into x) should do (reduce into x), e.g. (into [[3 5] [6 7]]) => [3 5 6 7]. This makes sense to me, but maybe it's too semantically different from (into x y). If not, though, you co

Re: Gorilla: Release of Version 1.1.0

2008-12-13 Thread Brian Doyle
I'm sure I'm doing something stupid but I can't start up gorilla. Exception in thread "main" java.lang.NoClassDefFoundError: de/kotka/gorilla Caused by: java.lang.ClassNotFoundException: de.kotka.gorilla at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessContr

Re: Gorilla: Release of Version 1.1.0

2008-12-13 Thread Brian Doyle
Thanks Meikel, removing the ~'s worked. Oh and thanks for vimclojure and gorilla! On Sat, Dec 13, 2008 at 9:28 AM, Meikel Brandmeyer wrote: > Hi, > > Am 13.12.2008 um 17:17 schrieb Brian Doyle: > > Here is my script: >> >> java -cp >> ~/share/clojure.j

Re: Updated 'show' and 'source'

2008-12-15 Thread Brian Doyle
This is great stuff. Thanks Chouser! On Fri, Dec 12, 2008 at 10:37 PM, Chouser wrote: > > I've added updated versions of 'show' and 'source' to a new lib named > clojure.contrib.repl-utils > > 'show' is for exploring classes at the REPL. What's new is that it > now displays the modifiers of th

calling use with a seq of strings

2008-12-15 Thread Brian Doyle
I have a seq of strings that are namespaces like, ("clojure.contrib.str-utils", "clojure.contrib.duck-streams"). I wanted to call the use function on this seq. I can't seem to do that though. Any way I can do this or is this just a bad idea? Thanks. --~--~-~--~~~-

Re: calling use with a seq of strings

2008-12-15 Thread Brian Doyle
p symbol (list "clojure.contrib.str-utils" > "clojure.contrib.duck-streams"))) > -Stuart Sierra > > On Dec 15, 3:51 pm, "Brian Doyle" wrote: > > I have a seq of strings that are namespaces like, > > ("clojure.contrib.str-utils", "clojure.contri

possible bug with seq and Enumeration?

2008-12-15 Thread Brian Doyle
According to the docs the seq function should be able to take an enumeration, but here is what I see: user=> (seq (.elements (doto (java.util.Vector.) (.add "hello") (.add "world" java.lang.IllegalArgumentException: Don't know how to create ISeq from: (NO_SOURCE_FILE:0) SVN 1160, thanks. --

Re: possible bug with seq and Enumeration?

2008-12-15 Thread Brian Doyle
Using enumeration-seq does the trick! Thanks. user=> (enumeration-seq (.entries (java.util.zip.ZipFile. ""))) On Mon, Dec 15, 2008 at 5:14 PM, Rich Hickey wrote: > > > > On Dec 15, 6:01 pm, "Brian Doyle" wrote: > > According to the docs t

Re: understanding quoting

2008-12-15 Thread Brian Doyle
On Mon, Dec 15, 2008 at 9:43 PM, Daniel Eklund wrote: > > > Looks like an if then else version of the map lookup?? > > ie: (if (%1 %2) (%1 %2) %3) > > Is this a special feature of maps in general, such that you can look > > up a key but return something else if it doesn't exist? > > I hadn't come

Re: doall and dorun

2008-12-15 Thread Brian Doyle
I'll take a crack at this. It may appear that the doall and dorun return something different with subsequent calls but they don't actually. The doall always returns the sequence (1 2) and dorun always returns nil. The first time (doall x) is called the for loop executes and prints 1 2 (a side e

Re: running Gorilla

2008-12-18 Thread Brian Doyle
LocalLeader usually means \ On Thu, Dec 18, 2008 at 3:36 PM, Mark Volkmann wrote: > > On Thu, Dec 18, 2008 at 4:10 PM, Meikel Brandmeyer wrote: > > Hi, > > > > Am 18.12.2008 um 23:06 schrieb Mark Volkmann: > >> > >> Error detected while processing /Users/Mark/.vim/plugin/gorilla.vim: > >> line

Re: for FAQ: what are use/require/import/refer?

2008-12-20 Thread Brian Doyle
This would make an excellent FAQ question and answer! On Sat, Dec 20, 2008 at 9:53 AM, Stuart Sierra wrote: > > This might make a good FAQ question: > > On Dec 20, 11:25 am, chris wrote: > > I am unclear as to the difference between refer, import use, and require. > > Hi Chris, > > require: Load

Re: multiple sets on one item - is this a good idea?

2008-12-20 Thread Brian Doyle
Instead of require call use and should get you what you want. On Dec 20, 2008 9:15 AM, "chris" wrote: That helped, thanks Christophe. I have one more problem: I put it in a util file, under a util namespace: (ns lambinator.util) (defmacro sets! [vars & rest] `(do ~@(map (fn [flds] `(set! (.

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

2008-12-21 Thread Brian Sletten
Adam, I just joined the list, but I am very interested in working with you on the SPARQL DSL. Let me catch up on what you've written and we'll muddle through it together. Glad to see there are other Clojure-loving SemWeb nerds around here. :) --~--~-~--~~~---~--~-

Re: How to encapsulate local state in closures

2008-12-21 Thread Brian Doyle
I haven't been following the new atom stuff, so I was wondering why atom would be best in this situation, vs a ref? Thanks. On Sun, Dec 21, 2008 at 1:03 PM, Parth Malwankar wrote: > > > > On Dec 21, 11:47 pm, chris wrote: > > I would like to be able to encapsulate local state in a closure. > >

Re: Exercise: how to print multiplication table?

2008-12-22 Thread Brian Doyle
2008/12/22 J. McConnell > On Mon, Dec 22, 2008 at 10:23 AM, Piotr 'Qertoip' Włodarek > wrote: > > > > Being new to Clojure, to Lisp and to functional programming in > > general, I have some trouble wraping my head around it. > > > > As the first exercice, I would like to print multiplication tab

ns references clarification

2008-12-22 Thread Brian Doyle
It would appear that using (:import ...) and (import ...) with the ns function work the same (svn rev 1172.) 1:1 user=> (ns blah (import (java.net URL))) nil 1:2 blah=> (URL. "http://www.clojure.org";) #http://www.clojure.org> and 1:1 user=> (ns blah2 (:import (java.net URL))) nil 1:2 blah2=> (U

Re: Some code review for clj-record?

2008-12-28 Thread Brian Doyle
Having used Rails myself I wanted to check this out and play with it. I'm having some trouble just loading the clj_record/core.clj file though: 1:1 user=> (load-file "clj_record/core.clj") java.lang.Exception: Unable to resolve symbol: db in this context (core.clj:19) I'm sure it's something I'

Re: making code readable

2008-12-29 Thread Brian Doyle
Looking at this code the uppercase variables stands out. This isn't idiomatic is it? (def GRID_SIZE 10) (def HEIGHT 600) (def MARGIN 50) On Mon, Dec 29, 2008 at 12:19 PM, Mark Volkmann wrote: > > On Mon, Dec 29, 2008 at 11:11 AM, lpetit wrote: > > > > You should consider using docstrings for d

Re: Some code review for clj-record?

2008-12-29 Thread Brian Doyle
Hume > wrote: > > The db configuration isn't reasonable at the moment. You can run > > clj_record/test/main.clj as a script but not load it from the REPL. > > Let me see if I can get it to work both ways and push an update. > > > > On Sun, Dec 28, 2008 at 6:2

Re: Some code review for clj-record?

2008-12-30 Thread Brian Doyle
On Mon, Dec 29, 2008 at 10:20 PM, John D. Hume wrote: > > On Mon, Dec 29, 2008 at 7:15 PM, Brian Doyle > wrote: > > I noticed that in the init-model macro you are creating a 'defn table [] > > ...' function in the > > model namespace and was wondering why you

Re: Understanding how to use namespaces

2008-12-30 Thread Brian Doyle
On Tue, Dec 30, 2008 at 11:25 PM, Mark Engelberg wrote: > > Thanks, that helps dramatically. It took me a while to figure out how > to edit the SLIME startup to include my clojure files directory in the > classpath, but I got it working. > > So it seems like you have to make sure the namespace al

Re: Some code review for clj-record?

2009-01-02 Thread Brian Doyle
espace was just misspelled. On Wed, Dec 31, 2008 at 9:39 AM, John D. Hume wrote: > > Hi Brian, > > On Tue, Dec 30, 2008 at 11:41 AM, Brian Doyle > wrote: > > (ns com.example.user) > > (clj-record.core/init-model) > > > > but when I do that I get the error: &

Re: literate snake

2009-01-03 Thread Brian Will
ght (and (= direction :up) top right-half) :left true direction))) --Brian Will On Jan 2, 11:07 am, "Mark Volkmann" wrote: > I've written a new version of the snake program that uses a more > literate style and therefore, to my eyes, calls for far fewer > co

Re: literate snake

2009-01-03 Thread Brian Will
ection :down) at-bottom) (if left-half :right :left) (and (= direction :left) at-left) (if top-half :down :up) (and (= direction :up) at-top) (if left-half :right :left) true direction))) On Jan 3, 9:28 am, "Mark Volkmann" wrote: > On Sat, Jan 3, 2009 at 3:03 AM, Br

Re: meaning and pronunciation of Clojure

2009-01-03 Thread Brian Will
Yes. Pronounced "closure" as if the "j" is French. On Jan 3, 1:06 pm, "Mark Volkmann" wrote: > I assume that the name "Clojure" is taken from the word "closure", > replacing the "s" with a "j" for Java. I've never seen that in writing > though and my curiosity compels me to have this verified. I

Re: automatic concurrency

2009-01-03 Thread Brian Will
licit direction from the programmer, however, is another matter. The implementations of Haskell that do this are experimental and not widely used. http://en.wikipedia.org/wiki/Automatic_parallelization --Brian Will On Jan 3, 12:20 pm, "Mark Volkmann" wrote: > One of the s

Re: automatic concurrency

2009-01-03 Thread Brian Will
rite event-driven code, but it would all involve just one thread, much like Javascript events work in the browser now.) > The article looks out-of-date and inaccurate, alas... Yeah, I got this impression as well. I coulda sworn it was better the last time I looked at it. --Brian Will On

Re: Some code review for clj-record?

2009-01-04 Thread Brian Doyle
Looks good. I didn't know about the *file* var. On Sun, Jan 4, 2009 at 11:22 AM, John D. Hume wrote: > > Brian, > I incorporated your changes and then made changes to load and run all > clj_record/test/*-test.clj files. Than

finding all vars starting with *

2009-01-04 Thread Brian Doyle
Today I found out about the var *file*. I looked it up *file* on clojure.com/api and couldn't find anything. Is there some place where all of these vars are defined? Is there some way programatically I can find them all? Thanks. --~--~-~--~~~---~--~~ You receive

Re: Some code review for clj-record?

2009-01-04 Thread Brian Doyle
iveRecord model. On Sun, Jan 4, 2009 at 2:22 PM, Brian Doyle wrote: > Looks good. I didn't know about the *file* var. > > On Sun, Jan 4, 2009 at 11:22 AM, John D. Hume wrote: > >> >> Brian, >> I incorporated your changes and then made changes to load and run all

Re: Very noob file reading and printing question

2009-01-06 Thread Brian Doyle
On Tue, Jan 6, 2009 at 4:47 PM, Tom Ayerst wrote: > Its not the println, nor getting a reader (duckstreams is fine, I can do > that). Its the converting it to a seq and stepping through it printing each > element (which should be a line). Its the loopy, steppy bit, just for a side > effect; that

writing bytes to a file

2009-01-07 Thread Brian Doyle
I couldn't find anything in core or contrib that wrote out bytes to a file so I wrote something to do it. Is this functionality already implemented and I just couldn't find it? If there isn't anything already, would this be something good to put in contrib somewhere? Thanks. (defn write-by

Re: writing bytes to a file

2009-01-07 Thread Brian Doyle
Looks like spit is for printing just text. On Wed, Jan 7, 2009 at 12:20 PM, Paul Barry wrote: > clojure.contrib.duck_streams/spit? > > > On Wed, Jan 7, 2009 at 2:14 PM, Brian Doyle wrote: > >> I couldn't find anything in core or contrib that wrote out >> bytes t

Re: writing bytes to a file

2009-01-08 Thread Brian Doyle
istream #^String filename] (write-stream-to-file istream filename 4096))) On Thu, Jan 8, 2009 at 2:28 AM, James Reeves wrote: > > On Jan 7, 7:14 pm, "Brian Doyle" wrote: > >(defn write-bytes > > "Writes the bytes from the in-stream to the given fil

Re: writing bytes to a file

2009-01-08 Thread Brian Doyle
On Thu, Jan 8, 2009 at 11:34 AM, James Reeves wrote: > > On Jan 8, 5:05 pm, "Brian Doyle" wrote: > > I incorporated most of James ideas but I don't like the name pipe-stream. > > Then wouldn't copy-stream be better? write-stream isn't specific > e

Re: writing bytes to a file

2009-01-08 Thread Brian Doyle
On Thu, Jan 8, 2009 at 12:36 PM, Brian Doyle wrote: > > > On Thu, Jan 8, 2009 at 11:34 AM, James Reeves > wrote: > >> >> On Jan 8, 5:05 pm, "Brian Doyle" wrote: >> > I incorporated most of James ideas but I don't like the name >> pipe

Re: How can I find all files ending with .clj, for example

2009-01-08 Thread Brian Doyle
Here's one of many ways to do this: (filter #(.endsWith (.getName %1) ".clj" ) (file-seq (java.io.File. "."))) On Thu, Jan 8, 2009 at 5:48 PM, wubbie wrote: > > Hi all, > > I can use file-seq > (file-seq (File. ".")) > But how can I filter out all files ending with .clj? > Do we use re-find, r

Re: How can I find all files ending with .clj, for example

2009-01-08 Thread Brian Doyle
This works: (filter #(re-find #"\.clj$" (str %)) (file-seq(java.io.File. "."))) On Thu, Jan 8, 2009 at 7:16 PM, wubbie wrote: > > I tried > > (filter #(re-find #"\.clj$" %) (seq (file-seq(java.io.File. "." > -> java.lang.ClassCastException: java.io.File cannot be cast to > java.lang.CharSe

Re: Setting a value inside a map of map of maps...

2009-01-11 Thread Brian Doyle
I think you can just use the update-in function like: 1:1 user=> (def m {:a {:b {:c {:d 3) #'user/m 1:2 user=> (update-in m [:a :b :c :d] - 5) {:a {:b {:c {:d -2 On Sun, Jan 11, 2009 at 11:08 AM, CuppoJava wrote: > > Hi, > I'm just wondering if there's a clever way of creating a new ma

Re: How to create and read from a stream of random characters?

2009-01-12 Thread Brian Doyle
Chouser's solution works well, but I found that you can end up with an empty string sometimes or never getting the maxlength that you passed in. 1:2 user=> (take 3 (seq-of-rand-strings 10)) ("ngene" "" "dwlbzndqx") I added an inc before calling the take and that clears things up. (defn seq-of-ra

Re: *1 *2 isn't working properly

2009-01-14 Thread Brian Doyle
Here's an example of *1 *2 *3 1:1 user=> (str "gavin") "gavin" 1:2 user=> (str "teri") "teri" 1:3 user=> (str "brian") "brian" 1:4 user=> (str-join " " [*1 *2 *3]) "brian teri gavin" On Wed, Jan

Re: QT Jambi and the Repl

2009-01-16 Thread Brian Carper
On Jan 16, 5:38 pm, levand wrote: > Has anyone here had success in using Clojure with QT Jambi? > > I'm currently experimenting with porting my app from Swing to QT, and > although Jambi might well be the theoretically superior framework, it > seems like Swing is a lot easier to use with Clojure.

Re: Unexpected binding behavior

2009-01-20 Thread Brian Carper
On Jan 20, 10:06 am, "Hugh Winkler" wrote: > Inside FP, outside FP, all I want is no surprises. I agree, this is confusing for new users. Especially given the counter-intuitive (for a new person) way the REPL forces evaluation of everything, making everything seem to be eager when it's not. Th

Re: symbols, vars and namespaces

2009-01-27 Thread Brian Doyle
On Tue, Jan 27, 2009 at 7:43 AM, Chouser wrote: > > On Tue, Jan 27, 2009 at 8:51 AM, Mark Volkmann > wrote: > > > > Are these statements correct? Actually, I know some are correct > > because I just looked though the source. Hopefully others that haven't > > will find this interesting. > > > > S

Re: Denver/Boulder Clojure users

2009-02-05 Thread Brian Doyle
I live in southeast Denver and have been doing some Clojure on my own for a few months now. On Thu, Feb 5, 2009 at 12:39 PM, chris wrote: > > Are there any existing clojure users in the Denver/Boulder area (other > than me)?. > > Chris > > > --~--~-~--~~~---~--~~

Re: why fn key doesn't do what I want?

2009-02-14 Thread Brian Doyle
On Sat, Feb 14, 2009 at 2:24 PM, wubbie wrote: > > Hi, > > a quick question: > > user=> (keys {:a 1 :b 2}) > (:a :b) > > But > user=> (key {:a 1}) > java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot > be cast to java.util.Map$Entry (NO_SOURCE_FILE:0) > > I see defn key in core.

Re: Newbie: Separating and grouping the elements in a bunch of vectors

2009-02-15 Thread Brian Doyle
>From the original question it looked like there was a vector of unknown length of vectors [[a0 a1 a2] [b0 b1 b2] ...] So my solution is something like: 1:12 user=> (def vecs [[:a0 :a1 :a2] [:b0 :b1 :b2]]) #'user/vecs 1:13 user=> (partition (count vecs) (interleave (flatten vecs))) ((:a0 :a1) (:

Is syntax quote "reader" only?

2009-02-16 Thread Brian Will
I'm a bit mystified how syntax quote does what it does. I don't see how syntax quote can quote the whole while unquoting parts without some evaluation-time intervention. If I had to implement it myself, I'd just punt the problem to evaluation-time by introducing a special form 'unquote', e.g.:

Importing lots of Java classes at once

2009-02-20 Thread Brian Carper
One could argue that wildcard imports in Java (import package.*) are evil, pollute your namespaces, create potential naming conflicts, etc. One would probably be correct. One could also argue that having to manually type a list of dozens of classnames is pretty tedious, especially if all you wan

Re: Importing lots of Java classes at once

2009-02-24 Thread Brian Doyle
de > than [2] ripped off from a different forum, but which (in my limited > experience) seems to work OK. I'll email it to you privately, and to > anyone else who wants to use it (just ask). > > -Jason > > On Feb 20, 9:33 pm, Brian Carper wrote: > > One could ar

Re: sequences from Enumerations

2009-03-02 Thread Brian Doyle
I had the same issue and ended up having to use enumeration-seq function. Seems strange but it worked. On Mon, Mar 2, 2009 at 4:22 PM, Mark Volkmann wrote: > > Should I be able to do something like this? > > (doseq [table-column (-> jtable .getColumnModel .getColumns)] > > javax.swing.JTable has

Re: sequences from Enumerations

2009-03-02 Thread Brian Doyle
That makes sense now. Thanks for the link to the thread. On Mon, Mar 2, 2009 at 5:01 PM, Stephen C. Gilardi wrote: > > On Mar 2, 2009, at 6:37 PM, Brian Doyle wrote: > > I had the same issue and ended up having to use enumeration-seq function. >> Seems >> strange b

Re: On the importance of recognizing and using maps

2009-03-08 Thread Brian Carper
On Mar 8, 10:53 am, Rich Hickey wrote:> > In looking at some of the libraries, I am a bit concerned that maps > are not being used when the logical entity is in fact a map. One time I find myself abusing vectors where maps would be better is in a situation where I have to retrieve key/value pair

clj-web-crawler

2009-03-09 Thread Brian Doyle
I wrote a Clojure script that wraps the Apache commons-client library for crawling the web. It's a simple 125 line script and I also wrote some test cases for it as well. I was wondering if this is something that could/should be included in clojure.contrib or if it should be a standalone Clojure

advice needed converting large files to xml

2009-03-16 Thread Brian Doyle
I've been using Clojure for about 6 months now and really like it. I am somewhat new to multi-threading and using any of the parallel features in Clojure though. I have a situation where I need to convert 7 files from CSV to XML. Each one of these files is about 180MB apiece in size. I have d

Re: advice needed converting large files to xml

2009-03-16 Thread Brian Doyle
ne ; process line ; write line ) ["input-file1", "input-file2", "input-file3", ]) Thanks. > > > On Mon, Mar 16, 2009 at 5:56 PM, Brian Doyle wrote: > >> I've been using Clojure for

Re: advice needed converting large files to xml

2009-03-16 Thread Brian Doyle
On Mon, Mar 16, 2009 at 4:29 PM, Mark Volkmann wrote: > > On Mon, Mar 16, 2009 at 4:56 PM, Brian Doyle > wrote: > > I've been using Clojure for about 6 months now and really like it. I am > > somewhat new to multi-threading > > and using any of the parallel feat

Re: New release 20090320

2009-03-20 Thread Brian Carper
On Mar 20, 7:15 am, Rich Hickey wrote: > New release 20090320 -http://clojure.googlecode.com/files/clojure_20090320.zip > > Incorporates all the recent additions - fully lazy seqs, :let option > for doseq/for, letfn for mutually recursive local fns, synchronous > watches, multi-arg set/union/diff

  1   2   3   4   5   6   7   8   9   10   >