Re: How do I call Foo.class?

2010-04-10 Thread Mike Mazur
Hi,

On Sat, Apr 10, 2010 at 04:31, dknesek doug.kne...@gmail.com wrote:
 So to be clear - I should be able to use:

 (. getEnrty entry-url PortfolioEntry)

Is that typo in your code? s/getEnrty/getEntry/

Mike

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe, reply using remove me as the subject.


Re: Getting started with labrepl...

2010-04-10 Thread Mike Mazur
Hi,

On Sat, Apr 10, 2010 at 12:19, Douglas Philips d...@mac.com wrote:
  Run lein deps:
  $ lein deps
  No project.clj found in this directory.

You need to run `lein deps` from within the labrepl directory. If you
clone the labrepl repo, project.clj will be there.

HTH,
Mike

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe, reply using remove me as the subject.


Re: Error when tried to compile with C-c C-k in emacs.

2010-04-10 Thread Stefan Kamphausen
Hi,

 Understood. But I'm not one of those people. I'm lucky if I have a
 couple hours each week to work on this, and that time must be split
 between reviewing incoming contributions *and* writing new code. I
 hope you'll forgive me

whoa, nothing to forgive here.  I am very thankful for the work you
did!

Cheers,
Stefan

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe, reply using remove me as the subject.


nailgun: simple example problem

2010-04-10 Thread Manfred Lotz
Hi there,
As a clojure newbie I tried to run a nailgun example from Phil
Hagelburg which I found here in the archive.

I created a directory example. In example I put a file project.clj

snip--
(defproject example 0.1
:description Example application via nailgun
:dependencies [[org.clojure/clojure
  1.1.0]
   [org.clojure/clojure-contrib
  1.0-SNAPSHOT]]
:main example)
snap--


and a Makefile which does the standard calls to lein.


In directory src/nailgun/ I put example.clj which looks like this:

snip--
(ns nailgun.example
  (:use [clojure.contrib.duck-streams])
  (:import [com.martiansoftware.nailgun NGServer NGContext]
   [java.io BufferedReader InputStreamReader
OutputStreamWriter PrintWriter])
  (:gen-class))

(gen-class :name nailgun.Example
   :prefix Example-
   :methods [#^{:static true}
  [nailMain [com.martiansoftware.nailgun.NGContext] void]] 
   :main false)

(defn Example-nailMain
  [#^NGContext context]
  (let [out (writer (- context .out))]
(copy (- context .in) out)
(.flush out)))

(defn -main []
  (.start (Thread. (NGServer.

snap--

Now make UBERJAR creates example-standalone.jar.

When now I try: java -server -jar example-standalone.jar
I get:

Exception in thread main java.lang.NoClassDefFoundError: example
Caused by: java.lang.ClassNotFoundException: example
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: example. Program will exit.


Is it just a missing parameter in my invocation? or did I do anything
completely wrong due to not really understanding what's going on?



-- 
Thanks,
Manfred


-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe, reply using remove me as the subject.


Re: Symbol resolution (between quote and eval/execution)

2010-04-10 Thread Douglas Philips

On 2010 Apr 10, at 1:42 AM, Per Vognsen wrote:
On Sat, Apr 10, 2010 at 12:25 PM, Douglas Philips d...@mac.com  
wrote:
The differences between def and binding are also weird, since  
binding does
not also shadow the meta-data on the var, so not only :macro will  
be wrong,

but :file, :line, :arglists could also be wrong.


The binding form doesn't provide the semantics of temporary
redefinition.


It provides something which is operationally equivalent, http://clojure.org/vars 
 says:
	Per-thread bindings for one or more Vars can be established via the  
macro binding and within-thread they obey a stack discipline:

...
	Functions defined with defn are stored in Vars, allowing for the re- 
definition of functions in a running program.


Even the official docs call it re-definition.



I don't see why :macro and :arglists need to reside on the var rather
than the function itself and it indeed does lead to some surprises in
odd corner cases. But it is certainly logical and proper that :file
and :line reside on the var.



If I am trying to debug a problem with function foo, and I look at the  
meta data for foo to find out where it is defined, I'm going to get  
the root binding meta data even if the foo that I am debugging has  
actually been rebound with binding? That seems like a bug. It  
certainly won't help me figure out where to find the code that is  
actually being run when I call foo. So far as I can tell from the  
docs, once I'm in the scope of a binding, I cannot even get at the  
root binding (or any other binding up the stack).




Anyway, I hope this excursion was enlightening. It forced me to
reinforce my understanding of some of these issues.


Yes, it has been. I realized this morning that Vars are what symbols  
used to be.
That def creates Vars from symbols is an easy subtlety to (keep)  
forgetting:

http://clojure.org/lisps
* Symbols are not storage locations (see Var)
* All (global) Vars can be dynamically rebound without interfering  
with lexical local bindings. No special declarations are necessary to  
distinguish between dynamic and lexical bindings. Since Clojure is a  
Lisp-1, (global) functions can be dynamically rebound.


Thanks,
-Doug

--
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe, reply using remove me as the subject.


Re: Clojure Concurrency Screencast Available

2010-04-10 Thread Craig Andera
Right, good point: I should have seen that coming given the target audience.
:)

Within a few hours, a mobile download link will appear with wmvs and mp4s
in a variety of resolutions so you can watch these offline on the device of
your choosing. The conversion lags the rest of the process a little bit, but
I'm told the upload is in progress now.

Hope that helps.

On Fri, Apr 9, 2010 at 7:22 PM, Jeff Heon jfh...@gmail.com wrote:

 I must say I appreciate video sharing sites like blip.tv and Vimeo
 that allows one to download and watch their videos offline.
 Very practical for those commuting and using portable devices 8)

 --
 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, send email to
 clojure+unsubscr...@googlegroups.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

 To unsubscribe, reply using remove me as the subject.


-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Error when tried to compile with C-c C-k in emacs.

2010-04-10 Thread Phil Hagelberg
On Sat, Apr 10, 2010 at 1:16 AM, Stefan Kamphausen
ska2...@googlemail.com wrote:
 Understood. But I'm not one of those people. I'm lucky if I have a
 couple hours each week to work on this, and that time must be split
 between reviewing incoming contributions *and* writing new code. I
 hope you'll forgive me

 whoa, nothing to forgive here.  I am very thankful for the work you did!

Sorry if I came off as snarky. I think the real root of the problem is
that Slime doesn't do real releases, they just expect everyone to
track head all the time. This is sloppy and makes for a poor
experience for users downstream. If they provided stable releases to
work from, then bringing our swank up to a given release would be a
lot more doable, rather than having to keep up with perpetual churn
with no real target in mind.

-Phil

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: nailgun: simple example problem

2010-04-10 Thread Phil Hagelberg
On Sat, Apr 10, 2010 at 3:27 AM, Manfred Lotz manfred.l...@arcor.de wrote:
 snip--
 (defproject example 0.1
    :description Example application via nailgun
    :dependencies [[org.clojure/clojure
                      1.1.0]
                   [org.clojure/clojure-contrib
                      1.0-SNAPSHOT]]
    :main example)
 snap--

 When now I try: java -server -jar example-standalone.jar
 I get:

 Exception in thread main java.lang.NoClassDefFoundError: example
 Caused by: java.lang.ClassNotFoundException: example
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
 Could not find the main class: example. Program will exit.

Using a single-segment namespace (example vs example.core) is advised
against as it interferes with some aspects of AOT. I suspect this is
what's causing the problem.

http://clojure-log.n01se.net/date/2010-03-08.html#i43

-Phil

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe, reply using remove me as the subject.


Re: My non-ELPA Emacs swank-clojure setup

2010-04-10 Thread Phil Hagelberg
On Sat, Apr 10, 2010 at 9:10 AM, DanL leidis...@gmail.com wrote:
 Usually installing Emacs Lisp packages like this is easy and requires
 1-2 lines of Elisp in your ~/.emacs,swank-clojureis the exception.

 Like Ævar, I am not aware of any other language mode that makes the
 usual way of installing/configuring as hard as swank-clojure. That is
 why I use a pretty ancient version of it, which in turn prevents me
 from using the latest cvs slime (I don't know if swank-clojure works
 with slime head atm), another PITA for people using Slime for both CL
 and Clojure, but another topic.

I don't think that's a fair comparison. Do you know of any other elisp
modes that must maintain compatibility across three wildly different
Lisp dialects while being distributed across two separate package
managers?

 Ideally, it should be made easy for both groups.

A capital idea. Are you volunteering? =)

-Phil

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe, reply using remove me as the subject.


Re: My non-ELPA Emacs swank-clojure setup

2010-04-10 Thread DanL
Hello!

On 10 Apr., 18:57, Phil Hagelberg p...@hagelb.org wrote:

  Like Ævar, I am not aware of any other language mode that makes the
  usual way of installing/configuring as hard asswank-clojure. That is
  why I use a pretty ancient version of it, which in turn prevents me
  from using the latest cvs slime (I don't know ifswank-clojureworks
  with slime head atm), another PITA for people using Slime for both CL
  andClojure, but another topic.

 I don't think that's a fair comparison. Do you know of any other elisp
 modes that must maintain compatibility across three wildly different
 Lisp dialects while being distributed across two separate package
 managers?

I didn't mean to be unfair, I know you a little from IRC, you were
always polite and helpful, and as I said, I really appreciate the work
being done. The problems (for me) started before you were  swank-
clojure's maintainer.

There was a time when installing swank-clojure in the usual emacs
way was basically a no-brainer for someone accustomed to emacs.
Granted, it is definitely not a trivial language-mode, but I just feel
that every improvement that has been done to make swank-clojure more
newbie-friendly made it more hard to use in the traditional way.

I am not sure wether that it is distributed across two separate
package managers or compatibility across Lisp dialects is the reason
for the status quo. I rather have the impression that much more time
and work was invested in making it easy to use in an automagical than
in keeping it useable the traditional way. Don't get me wrong: I
don't want to blame you or anyone else, and after all it's just an
impression.

  Ideally, it should be made easy for both groups.

 A capital idea. Are you volunteering? =)

While I am capable of keeping an old version working for me, I am not
sure if I could be of much help for you. What I do is just having one
clojure.jar, running it from the command line, and connecting to swank
via slime-connect. No downloading of anything, no automatic
configuration of anything, no automatic testing. That's pretty much
all I need and want. Since the current version of swank-clojure seems
to have moved on from what I use and (half-way) understand, I think
I'd be of little help. Frankly, I care as much about Elpa as I care
about customize ... I'm happy when I don't have to deal with it.

That being said, I'll take a look at the recend codebase and see if I
can wrap my head around it. If I can contribute anything of help, I'll
let you know.


Cheers

dhl

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe, reply using remove me as the subject.


Re: My non-ELPA Emacs swank-clojure setup

2010-04-10 Thread Ævar Arnfjörð Bjarmason
On Sat, Apr 10, 2010 at 16:57, Phil Hagelberg p...@hagelb.org wrote:
 On Sat, Apr 10, 2010 at 9:10 AM, DanL leidis...@gmail.com wrote:
 Ideally, it should be made easy for both groups.

 A capital idea. Are you volunteering? =)

What would be involved in that? The hack I have is just a monkeypatch
on top of swank-clojure that Works For Me. It may not be the best idea
to do it.

Maybe swank-clojure could provide some settable variables / core code
to make the stuff I and DanL want to do with it easy.

I'm not familiar with the history but is there any reason why
swank-clojure isn't being integrated into the SLIME distribution
itself? That should make it easier to make it work out of the box.

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: nailgun: simple example problem

2010-04-10 Thread Manfred Lotz
Hi Phil,


On Sat, 10 Apr 2010 09:54:29 -0700
Phil Hagelberg p...@hagelb.org wrote:

 On Sat, Apr 10, 2010 at 3:27 AM, Manfred Lotz manfred.l...@arcor.de
 wrote:
  snip--
  (defproject example 0.1
     :description Example application via nailgun
     :dependencies [[org.clojure/clojure
                       1.1.0]
                    [org.clojure/clojure-contrib
                       1.0-SNAPSHOT]]
     :main example)
  snap--
 
  When now I try: java -server -jar example-standalone.jar
  I get:
 
  Exception in thread main java.lang.NoClassDefFoundError: example
  Caused by: java.lang.ClassNotFoundException: example
         at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
         at
  sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at
  java.lang.ClassLoader.loadClass(ClassLoader.java:266) Could not
  find the main class: example. Program will exit.
 
 Using a single-segment namespace (example vs example.core) is advised
 against as it interferes with some aspects of AOT. I suspect this is
 what's causing the problem.
 
 http://clojure-log.n01se.net/date/2010-03-08.html#i43
 

Hmm, I have to admit that I don't understand what I should change in
terms of naming.

But how were you able to test it when you tried out your code?




-- 
Thanks,
Manfred


-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe, reply using remove me as the subject.


Re: My non-ELPA Emacs swank-clojure setup

2010-04-10 Thread DanL
On 10 Apr., 19:44, Ævar Arnfjörð Bjarmason ava...@gmail.com wrote:
 I'm not familiar with the history but is there any reason why
 swank-clojure isn't being integrated into the SLIME distribution
 itself? That should make it easier to make it work out of the box.

As far as I know, there were problems with the protocol using symbols
in CL's package::symbol syntax (and some other characters not being
allowed in Clojure) after changes in CVS Slime about five months ago.
Even if swank-clojure was integrated, it wouldn't be an official
part of Slime, but a contrib. I suppose CVS Slime's restless nature
and (as far as I know) non-existent documentation of the protocol also
have their parts to play.

Regards

dhl

-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe, reply using remove me as the subject.


Re: Getting started with labrepl...

2010-04-10 Thread Douglas Philips

On 2010 Apr 10, at 3:11 AM, Mike Mazur wrote:

On Sat, Apr 10, 2010 at 12:19, Douglas Philips d...@mac.com wrote:

 Run lein deps:
 $ lein deps
 No project.clj found in this directory.


You need to run `lein deps` from within the labrepl directory. If you
clone the labrepl repo, project.clj will be there.

HTH,


I'm not facile with git, but I guess my confusion was that somehow  
lein would be used for the initial pull, not just the dependencies.  
I'll know not to make that misunderstanding again, we can only be  
complete newbies once, but I think  the getting started needs to be  
more explicit about this. Ideally it would have the exact copy'n'paste  
git command needed.


Thanks for the help.

-Doug

--
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe, reply using remove me as the subject.


How to hide data representation with keywords for deftype accessor?

2010-04-10 Thread Sophie
(deftype A [x]) gives me an accessor (:x anA)

Then I decide to change data representation of A without impacting
client code, but I don't seem able to define a function
(defn :x [anA] ...)

Should I be doing something different?

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 your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe, reply using remove me as the subject.


Re: nailgun: simple example problem

2010-04-10 Thread Manfred Lotz
On Sat, 10 Apr 2010 15:10:58 -0700
Brendan Ribera brendan.rib...@gmail.com wrote:

 Try this instead:
 
...
   :main *nailgun.*example)
 

Thanks a lot. 

Yes

 :main nailgun.example)  

does work fine.




-- 
Manfred


-- 
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, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe, reply using remove me as the subject.