Re: Full Disclojure - I Need Topics!

2010-01-24 Thread rb
On Jan 25, 6:34 am, Sean Devlin wrote: > Hello everyone, > I'm having a blast making the Full Disclojure series.  It's one the > best projects I've had a chance to work on. > > However, there's going to be a problem soon.  I only have a few more > topics left before I run out.  No more topics, n

Re: Full Disclojure - I Need Topics!

2010-01-24 Thread Roman Roelofsen
2010/1/25 Mark Engelberg : > Debugging techniques, including: > * How to make sense of Clojure's stack traces. > * How to use Java debugging and profiling tools with Clojure. +1 -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, s

Re: Full Disclojure - I Need Topics!

2010-01-24 Thread mac
On 25 Jan, 06:50, Mark Engelberg wrote: > Debugging techniques, including: > * How to make sense of Clojure's stack traces. > * How to use Java debugging and profiling tools with Clojure. +1 for this. I haven't had the energy to try any debugging or profiling tools yet. Would be nice with demo o

Re: Full Disclojure - I Need Topics!

2010-01-24 Thread abhi
> * How to make sense of Clojure's stack traces. > * How to use Java debugging and profiling tools with Clojure. 1+ -- 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

Re: Full Disclojure - I Need Topics!

2010-01-24 Thread Mark Derricutt
I see you did one recently on Leiningen - how about a companion piece on the maven-clojure-plugin [1] and native maven ( covering automated test script generation/running, repl and slime integration ), or going completely experimental the polyglot maven clojure stuff ( adding dynamic scripting to c

Re: Full Disclojure - I Need Topics!

2010-01-24 Thread Mark Engelberg
Debugging techniques, including: * How to make sense of Clojure's stack traces. * How to use Java debugging and profiling tools with Clojure. -- 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

Full Disclojure - I Need Topics!

2010-01-24 Thread Sean Devlin
Hello everyone, I'm having a blast making the Full Disclojure series. It's one the best projects I've had a chance to work on. However, there's going to be a problem soon. I only have a few more topics left before I run out. No more topics, no more videos. This is where you come in. I'm inter

Re: Clojure Kata

2010-01-24 Thread CuppoJava
That's very thoughtful Travis. I was also considering generalizing regular expressions to apply to arbitrary ordered collections for this question. That is the most elegant abstraction for this problem. I suppose there just isn't enough real-world use for a regex on collections to justify the effor

Replacing proxy with reify/deftype

2010-01-24 Thread Mark Engelberg
As has been discussed here previously, one way to generate an uncached stream of numbers is: (defn incs [i] (proxy [clojure.lang.ASeq] [] (first [] i) (next [] (incs (inc i) ASeq implements most of the machinery of sequences, so you can just implement the parts that differ. I'd like

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 available for public access. > > It looks like

Re: Jython interop

2010-01-24 Thread Eric Lavigne
> I was wondering if anyone has tried somehow calling Jython functions > from within Clojure, and how you went about doing this if so.  I have > not used Jython, but I would imagine the Jython interpreter can be > invoked in the same way as any other java code, and Python programs > can be run with

Re: Clojure Kata

2010-01-24 Thread Travis
Occasionally things like this remind me of the similarities between parsing character sequences and dealing with unpredictably ordered collections. For character sequences, the regular expression mechanism has been invented. I wonder if any one else has ever wished for the ability to write a regula

Re: Clojure Conference Poll

2010-01-24 Thread Matt Revelle
Location: DC (central and lots of Clojurers in the area) or Atlanta (cheap) Days of week: Any, suggest Fri-Sat There seem to be at least an equal (probably greater) number of east coast Clojure users in North America and the east coast is an easier destination for any European attendees. I'm happ

Re: Clojure Conference Poll

2010-01-24 Thread Amit Rathore
Richard, Agreed - I'm not committing to anything right now, just throwing out what we might target, if those numbers sounds reasonable to people. Like Tim said, our goal is to keep costs low, so we can keep the price low. Regards, Amit. On Jan 24, 2:51 pm, Tim Dysinger wrote: > We don't know wh

Re: Proxy macro, and calling on a protected method

2010-01-24 Thread Steven E. Harris
".Bill Smith" writes: > you can use java.lang.reflect.Method.setAccessible to make an > otherwise protected method available for public access. It looks like one would have to hang on to the Method object and reuse it, as setting one Method instance's accessibility has no influence over /other/

Re: Clojure Conference Poll

2010-01-24 Thread Tim Dysinger
We don't know what the cost is going to be yet - I want to keep it _low_ but we don't have any sponsors yet nor do we have a small (narrowed) list of locations picked out. We plan on working on these items this month and will release more info soon as we know more. On Sun, Jan 24, 2010 at 9:42 AM

Re: Proxy macro, and calling on a protected method

2010-01-24 Thread .Bill Smith
This is using a sledgehammer to drive in a nail, but you can use java.lang.reflect.Method.setAccessible (http://java.sun.com/javase/7/ docs/api/java/lang/reflect/AccessibleObject.html#setAccessible %28boolean%29) to make an otherwise protected method available for public access. It's a sledgehamme

Jython interop

2010-01-24 Thread rob
Hi, I was wondering if anyone has tried somehow calling Jython functions from within Clojure, and how you went about doing this if so. I have not used Jython, but I would imagine the Jython interpreter can be invoked in the same way as any other java code, and Python programs can be run within it

Re: A new lisper's question about a macro

2010-01-24 Thread Richard Newman
The former is a lot clearer to read, as it uses standard Clojure datastructures. ... which offers other advantages beyond the human, such as (def page-names keys) user=> (page-names foobar) (:page :posts :post) Power comes from algorithms × data structures, and hiding the data structures —

Re: A new lisper's question about a macro

2010-01-24 Thread James Reeves
On Jan 24, 5:05 pm, joel r wrote: > It's meant to be called like this: > (define-template some-template-name >   page some-function-1 >   posts some-function-2 >   post some-function-3) > > It defs a var called some-template-name bound to a map that looks like this: > {:page some-function-1 >   :p

Proxy macro, and calling on a protected method

2010-01-24 Thread Steven E. Harris
The documentation for the `proxy' macro mentions lack of access in the defined implementation to protected members: ,[ proxy ] | Note that while method fns can be provided to override protected | methods, they have no other access to protected members, nor to super, | as these capabilities can

Re: A new lisper's question about a macro

2010-01-24 Thread ataggart
On Jan 24, 9:05 am, joel r wrote: > Hi, > > I was wondering whether there was an elegant way to make this macro do > more work: > > (defmacro define-template [template-name & template-params] >   `(def ~template-name (apply merge (map (fn [[k# v#]] >                                             {

Re: Cyclic require

2010-01-24 Thread Laurent PETIT
2010/1/24 Gabi : > As a side note, I didn't see anywhere in clojure docs that cyclic > references are forbidden. Yeah, and that's why I didn't employ (or intend to ?) the word "forbidden", but rather the words "smells" and "software principles". Smells and principles and general guidelines. Somet

Re: Cyclic require

2010-01-24 Thread Gabi
As a side note, I didn't see anywhere in clojure docs that cyclic references are forbidden. And if it is forbidden, the Exception raised by the runtime should reflect this instead of the odd "No such var->.." exception On Jan 24, 10:44 pm, Laurent PETIT wrote: > Some software principle are certai

Re: Clojure Kata

2010-01-24 Thread CuppoJava
It's an elegant puzzle. Thanks Sean! Here's my take: (defn sift [pred? s] (lazy-seq (if (seq s) (let [key (first s) [vals remaining] (split-with #(not (pred? %)) (rest s))] (cons [key vals] (sift pred? remaining)) Running: (sift string? ["a" 2 "b" 3 4 "c" "d" 4

Re: Cyclic require

2010-01-24 Thread Laurent PETIT
Some software principle are certainly above the languages used to solve a problem, even probably above programming paradigms (OOP, purely functional, etc.). Java certainly has good parts, and having promoted the role and importance of interfaces must certainly be accounted to its credit. But conc

Re: newbie question about ns and :require

2010-01-24 Thread .Bill Smith
Manfred, The (:require clojure.contrib.classpath) tuple tells the ns function to load the clojure.contrib.classpath library if it has not already been loaded. Clojure looks for clojure/contrib/classpath.clj (or the equivalent class file) somewhere in your classpath, which in your case would be i

Clojure Kata

2010-01-24 Thread Sean Devlin
I recently found a scheme problem that I think would be a good exercise for a new Clojure developer. I've written about it here: http://fulldisclojure.blogspot.com/2010/01/code-kata-data-sifter.html Have fun. Sean -- You received this message because you are subscribed to the Google Groups "Cl

Re: Clojure Conference Poll

2010-01-24 Thread Richard Newman
as far as pricing goes, how does something in the $199 range sound? we can probably add a tutorial day Friday for a small additional cost, say $149...? we can certainly have some well-known clojurians conduct the tutorials, I'm sure we'll have plenty of real world clojure experience in the house..

Re: Debugging in Clojure

2010-01-24 Thread e
interesting. thanks for the thoughtful reply. On Sun, Jan 24, 2010 at 2:08 PM, Richard Newman wrote: > That said (and I'm not trying to make this a "charged" statement ... just a >> way to learn more) I had always thought that one of the key things that made >> lisp so complete was that program

Re: Debugging in Clojure

2010-01-24 Thread Richard Newman
That said (and I'm not trying to make this a "charged" statement ... just a way to learn more) I had always thought that one of the key things that made lisp so complete was that programs don't just crash ... that debugging is fully-baked into the *core* of everything. Now, I don't remembe

Re: Clojure IRC help

2010-01-24 Thread joshua-choi
Ah! Never mind! I just got an email telling me that I had to verify the account! I did that, and I can now send messages to the room (I think). Thanks a lot! On Jan 24, 12:00 pm, joshua-choi wrote: > Thanks for the link; it's helpful. I've registered with Freenode as > joshua-choi with a password

Re: Clojure IRC help

2010-01-24 Thread joshua-choi
Thanks for the link; it's helpful. I've registered with Freenode as joshua-choi with a password and nickname, and my IRC client informs me when I reconnect that the server has identified me as joshua-choi. However, when I try to send a message, I still get the same error. Could anything else be a

Re: Clojure IRC help

2010-01-24 Thread David Nolen
Perhaps this might help: http://freenode.net/faq.shtml#userregistration On Sun, Jan 24, 2010 at 1:30 PM, joshua-choi wrote: > Sorry for asking this here, but it's about the Clojure IRC room, which > is kind of related to Clojure, being this group's sister help > resource. > > I know nothing abou

Clojure IRC help

2010-01-24 Thread joshua-choi
Sorry for asking this here, but it's about the Clojure IRC room, which is kind of related to Clojure, being this group's sister help resource. I know nothing about IRC, but I've been using the Colloquy application for Mac OS X to connect to the Clojure IRC room on irc.freenode.net. It was working

Re: newbie question about ns and :require

2010-01-24 Thread David Nolen
On Sun, Jan 24, 2010 at 10:28 AM, Manfred Lotz wrote: > user=> (ns my (:require clojure.contrib.classpath)) > nil > my=> > > which to me looks fine. > > But why does this fail? > > my=> (classpath) > java.lang.Exception: Unable to resolve symbol: classpath in this > context (NO_SOURCE_FILE:2) > r

Re: Clojure Conference Poll

2010-01-24 Thread Amit Rathore
ok folks, we need some more real opinions... :) we're thinking it will be in the Bay Area, some time during early fall. weekend seems logical from the responses so far... as far as pricing goes, how does something in the $199 range sound? we can probably add a tutorial day Friday for a small addi

A new lisper's question about a macro

2010-01-24 Thread joel r
Hi, I was wondering whether there was an elegant way to make this macro do more work: (defmacro define-template [template-name & template-params] `(def ~template-name (apply merge (map (fn [[k# v#]] {(keyword k#) (var-get (resolve v#))})

Re: C interop lib (JNA wrapper)

2010-01-24 Thread mac
A little progress update. I havent had much time to work on this since my initial effort. But this weekend I have gotten structures to work. The reason that special support for structures is needed is to support C api's that pass them by value. Most of the effort to make this work went into how I

Re: newbie question about ns and :require

2010-01-24 Thread Gabi
Sorry, I meant (cp/classpath) .. On Jan 24, 6:06 pm, Gabi wrote: > Maybe try > (ns my (:require [clojure.contrib.classpath :as cp])) > (cp.classpath) > > On Jan 24, 5:28 pm, Manfred Lotz wrote: > > > Hi all, > > I'm stumbling about the very basics. > > > Calling clojure like this: > > > rlwrap j

Re: Cyclic require

2010-01-24 Thread Heinz N. Gies
On Jan 24, 2010, at 17:12 , Stuart Halloway wrote: > If the collaboration is deeply entwined, the two modules should be one > module. If one module uses another, but with occasional callbacks in the > other direction, use an interface or a protocol to define the backchannel. That sounds horribl

Re: Debugging in Clojure

2010-01-24 Thread e
It has confused me since the day I tried to mess around with clojure that this topic isn't brought up more (not that I follow clj regularly) ... so I'm happy to learn that someone added trace capabilities. That said (and I'm not trying to make this a "charged" statement ... just a way to learn mor

Re: Cyclic require

2010-01-24 Thread Stuart Halloway
If the collaboration is deeply entwined, the two modules should be one module. If one module uses another, but with occasional callbacks in the other direction, use an interface or a protocol to define the backchannel. Think about it from the point of view of someone wanting to call your

Re: newbie question about ns and :require

2010-01-24 Thread Gabi
Maybe try (ns my (:require [clojure.contrib.classpath :as cp])) (cp.classpath) On Jan 24, 5:28 pm, Manfred Lotz wrote: > Hi all, > I'm stumbling about the very basics. > > Calling clojure like this: > > rlwrap java > -cp > /home/manfred/clojure/clojure.jar:/home/manfred/clojure/clojure-contrib.j

newbie question about ns and :require

2010-01-24 Thread Manfred Lotz
Hi all, I'm stumbling about the very basics. Calling clojure like this: rlwrap java -cp /home/manfred/clojure/clojure.jar:/home/manfred/clojure/clojure-contrib.jar clojure.main I try: user=> (ns my (:require clojure.contrib.classpath)) nil my=> which to me looks fine. But why does this fai

Re: Cyclic require

2010-01-24 Thread Gabi
You know what? I am not sure that it smells so bad actually. What if I have 2 modules that collaborate with each other and use each other functions ? Why is this so bad? On Jan 24, 5:32 pm, Laurent PETIT wrote: > Short answer: you can't. And yes, it's a "smell" (a bad one) if you > want to achi

Re: What are Vars supposed to be used for?

2010-01-24 Thread Laurent PETIT
2010/1/24 CuppoJava : > That makes sense Jarkko, thanks for the explanation. > > So then, for my example, using a binding and set! would be the proper > way of going about it right? Because I don't intend for multiple > threads to access the job queue. > > And is there a way to change the bound val

Re: Cyclic require

2010-01-24 Thread Laurent PETIT
Short answer: you can't. And yes, it's a "smell" (a bad one) if you want to achieve this. You have to somehow break the cycle : * maybe acknowledge that ns a & b are strongly coupled since there's the need for a cyclic dependency, and merge them. * sometimes one wants to have a & b to have th

Cyclic require

2010-01-24 Thread Gabi
This thing is driving me nuts. If I do a cyclic require(ns-a requires ns-b and ns-b requires ns-a) I get exceptions complaining about "No such var->.." How can cyclic dependencies be done correctly in Clojure ? I know it might be bad practice. But I really need it. -- You received this message b

Re: What are Vars supposed to be used for?

2010-01-24 Thread CuppoJava
That makes sense Jarkko, thanks for the explanation. So then, for my example, using a binding and set! would be the proper way of going about it right? Because I don't intend for multiple threads to access the job queue. And is there a way to change the bound value for another thread? The reason

Re: Clojure Conference Poll

2010-01-24 Thread Seth
When: weekends Where: DC, Boston, NY, San Fran Who: at least one, probably more Newsgroups are such a painful way to vote on things. Google Wave or some other wiki-like thing would make it much easier to aggregate everyone's input. On Jan 24, 8:37 am, Jeff Schwab wrote: > +1 Boston. > > > > Bren

Re: Clojure Conference Poll

2010-01-24 Thread Jeff Schwab
+1 Boston. Brent Millare wrote: Weekend, and East coast, either near the DC area or New York Area, maybe Boston area is OK too. On Jan 22, 12:36 pm, dysinger wrote: We will be organizing a conference in the next month for 2010 (probably in the fall). One question I would like to ask is, give

Re: Debugging in Clojure

2010-01-24 Thread Gabi
Be careful of deftrace. It has a bug that crashes when the defn'ed funcs have string comment on the top of the func On Jan 23, 7:02 am, ataggart wrote: > On Jan 22, 6:27 pm, Mike Meyer > > > 620...@mired.org> wrote: > > On Fri, 22 Jan 2010 17:25:39 -0800 > > > ajay gopalakrishnan wrote: > > > I

Re: Clojure Conference Poll

2010-01-24 Thread Garth Sheldon-Coulson
+1 to Boston/NY/DC/Bay Area in that order On Sun, Jan 24, 2010 at 3:44 AM, Chad Harrington wrote: > - Friday / Saturday > - SF Bay Area > Chad Harrington > chad.harring...@gmail.com > > > On Fri, Jan 22, 2010 at 9:36 AM, dysinger wrote: >> >> We will be organizing a conference in the next month

Re: Leiningen plugin: run

2010-01-24 Thread Timothy Pratley
2010/1/24 Eric Lavigne : >     lein run Great! Very handy thanks. -- 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 yo

Re: Debugging in Clojure

2010-01-24 Thread Timothy Pratley
2010/1/23 ataggart : > If the authors of of c.c.trace are > amenable, I'm inclined to add this functionality to a variant of the > c.c.logging/spy macro Great idea! -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to

Re: What are Vars supposed to be used for?

2010-01-24 Thread Jarkko Oranen
On Jan 24, 6:40 am, CuppoJava wrote: > Thanks for the reply. That seems to match well with how I thought they > were supposed to work. > > I'm just a little confused by the > set!, with-local-vars, functions. What are they supposed to be used > for? > >   -Patrick Vars are mutable reference types

Re: Reminder: IEEE Software Issue on "Multiparadigm Programming"

2010-01-24 Thread Benjamin L. Russell
Greetings, Mr. Wampler, Actually, I was thinking about doing a short cross-comparison of the advantages and disadvantages of Mozart/Oz and Scheme in multiparadigm programming in the textbooks SICP and CTM; however, currently, because of the economic depression, my company has been forced to dow

Re: Clojure Conference Poll

2010-01-24 Thread Chad Harrington
- Friday / Saturday - SF Bay Area Chad Harrington chad.harring...@gmail.com On Fri, Jan 22, 2010 at 9:36 AM, dysinger wrote: > We will be organizing a conference in the next month for 2010 > (probably in the fall). One question I would like to ask is, given > the conference is probably going