On Feb 9, 2:37 am, Wardrop wrote:
> That seems like what I'm after, thanks. I assume this would be pretty
> reliable across all platforms running the JVM.
In .NET, on the other hand, this value is stored in
System.Environment.ProcessorCount. Perhaps it would be worthwhile to
make oft-requested in
Hi,
On Feb 9, 9:29 pm, Chouser wrote:
> It may be worth noting that using 'send' to dispatch actions to
> an agent already takes into account the number of CPUs available.
> This essentially means it's safe to queue up sends on as many
> agents as you want -- hundreds, even thousands of agents -
Hi,
I'm exploring the jexcelapi library (http://
jexcelapi.sourceforge.net), and one of the classes there is
jxl.write.Number. So, when I do:
=> (import 'jxl.write.Number)
I get:
Number already refers to: class java.lang.Number in namespace: user
[Thrown class java.lang.IllegalStateException]
If I remember correctly it will work just fine if you don't import it and
you refer to it like (jxl.write.Number...
Please correct me if I'm wrong.
Joop Kiefte
2010/2/11 igorrumiha
> Hi,
>
> I'm exploring the jexcelapi library (http://
> jexcelapi.sourceforge.net), and one of the classes there
Hey,
Since Clojure is a LISP dialect, does this mean that it doesn't
support OOP?
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 - pl
On 11 February 2010 22:46, HB wrote:
> Since Clojure is a LISP dialect, does this mean that it doesn't
> support OOP?
You might find this article interesting:
http://blog.thinkrelevance.com/2009/8/12/rifle-oriented-programming-with-clojure-2
And related:
http://stackoverflow.com/questions/151785
On Feb 11, 1:24 pm, Joop Kiefte wrote:
> If I remember correctly it will work just fine if you don't import it and
> you refer to it like (jxl.write.Number...
>
> Please correct me if I'm wrong.
You are correct! Thanks!
--
Igor Rumiha
--
You received this message because you are subscribed to
On Feb 11, 12:46 pm, HB wrote:
> Hey,
> Since Clojure is a LISP dialect, does this mean that it doesn't
> support OOP?
> Thanks.
To quote Dr. Alan Kay:
"OOP to me means only messaging, local retention and protection and
hiding of state-process, and extreme late-binding of all things. It
can be d
You can work with java objects. But clojure itself is not object oriented,
because it's functional, and object orientation requires state manipulation.
Other lisps support object orientation, common-lisp for example.
cheers,
/J
On Thu, Feb 11, 2010 at 1:46 PM, HB wrote:
> Hey,
> Since Clojure
I think you're running into http://bugs.sun.com/view_bug.do?bug_id=6924497
which is unrelated to JMX itself but is a problem of incompatibility
between the JDK class library and the JVM, if for example you are
running with HotSpot Express. A fix should appear in a JDK 6 update
but in the meantime i
Joel Westerberg wrote:
You can work with java objects. But clojure itself is not object
oriented, because it's functional, and object orientation requires state
manipulation.
By whose definition? Are you saying there is no such thing as an
immutable object?
Other lisps support object orien
I'm wondering what the rationale is for using multimethods vs. cond,
and where it's best to use either? Multimethods seem to be very
seldom used, usually to dispatch on type, but I can see advantages to
using data to dynamically define only the methods you need, rather
than having all-encompassing
The problem is about the overloading of the "object based" expression.
A step forward could be to recognize that:
* Java is a weak/simplified version of a class based language
(simplifications made for several well known reasons: ease of adoption
by C/C++ crowd: - algol like syntax-, reduced func
We had about 60 people show up for our first meeting and I've had some
very positive feedback and a couple of companies have approached me
about sponsoring our next meeting. We are looking for speakers to
talk about anything Clojure. The group is a mix of people using
Clojure commercially to peop
2010/2/11 Bryce :
> I'm wondering what the rationale is for using multimethods vs. cond,
> and where it's best to use either? Multimethods seem to be very
> seldom used, usually to dispatch on type, but I can see advantages to
> using data to dynamically define only the methods you need, rather
>
On Thu, Feb 11, 2010 at 10:27 AM, Laurent PETIT wrote:
> 2010/2/11 Bryce :
> > I'm wondering what the rationale is for using multimethods vs. cond,
> > and where it's best to use either? Multimethods seem to be very
> > seldom used, usually to dispatch on type, but I can see advantages to
> > usi
can we creat threads in clojure?
On Feb 11, 8:11 pm, Laurent PETIT wrote:
> The problem is about the overloading of the "object based" expression.
>
> A step forward could be to recognize that:
> * Java is a weak/simplified version of a class based language
> (simplifications made for several we
I'm concerned specifically about exceptions that occur during macro
expansion. As often as not, these exceptions are the result of calling the
macro with incorrect arguments rather than any problem in the macro itself,
but the stack trace doesn't contain enough information to locate the
offending
In the example, you can find a reference to the actual macro (line and name)
in the second part (Caused by:). By the nature of macro's I think this might
be not the most human way to get the line number, but surely the way the JVM
sees it.
2010/2/11 John Williams
> I'm concerned specifically abo
Yeah, in practice it seems like multimethods are pretty much just used
as a way to let users of a library extend the API to support
additional types. If you had a cond expression dispatching on the
type of an argument, for example, then the user would have to modify
the source code of your library
On 11 February 2010 13:46, HB wrote:
> Hey,
> Since Clojure is a LISP dialect, does this mean that it doesn't
> support OOP?
> Thanks.
Regardless of whether Clojure supports OOP, not supporting it
certainly doesn't follow from being a Lisp dialect. Take a look at
CLOS (Common Lisp Object System),
i can echo that last reply. I wanted to use clojure and may return to it
... awesome idea. But haven't had ANY luck with dev environments ... VC,
included. gone down many blind alleys. It was almost a year ago that I
tried, though. perhaps I should try again.
On Thu, Feb 11, 2010 at 12:44 PM,
Hi,
I'm doing my first steps in Clojure and I would like to get some
feedback on my implementation of the Bowling Game Kata. The code is
here http://softnoise.wordpress.com/2010/02/07/the-bowling-kata-in-clojure.
I can post the code here if that's preferred.
I'm mostly interested if there is anyt
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
Hi,
On Feb 11, 1:46 pm, HB wrote:
> Since Clojure is a LISP dialect, does this mean that it doesn't
> support OOP?
Careful not to come to the conclusion that if something's a Lisp, it's
not OOP.
For instance, Common Lisp has a powerful OOP system which includes
multiple-inheritance, metaobject p
I suspect that Clojure is actually more suited to OOP than Java,
assuming you're going by Dr. Kay's definition. :)
Another Kay quote:
"I invented Object-Oriented Programming, and C++ is not what I had in
mind."
--
You received this message because you are subscribed to the Google
Groups "Cl
Martin,
It's very simple, I like it.
There two things that stand out to me, both having to do with
readabiliby.
Instead of using (def score) you should use (declare score). declare
exists for the purpose of making forward declarations. That one is
black and white. You have to do it.
The other I
I struggle fairly often with keeping clojure/contrib/slime up to date
on my machine - it seems that every time I update it, something
fundamental has broken (like build.xml going away in contrib). There
are a few things that seem to try to make this easier (like clojure-
mode's install-clojure, or
What are other people doing to maintain their installations? Is there
some simple way to keep all of these projects up to date? Or do people
simply not update all of these projects often?
I suck it up. Fortunately I was in the process of switching to
Leiningen when contrib suddenly moved to Ma
I just have a hard time keeping it working when I update. I understand
that being on the bleeding edge is rough, but it's hard for me to
think that this isn't especially frustrating for new users, who I
suspect will find that most tutorials or guides to setting up clojure
with slime (for example) a
On 11 February 2010 19:59, Paul Mooser wrote:
> What are other people doing to maintain their installations? Is there
> some simple way to keep all of these projects up to date? Or do people
> simply not update all of these projects often?
If you don't need to insist on running your own build, y
hi,
the expression problem
(http://en.wikipedia.org/wiki/Expression_Problem) talks about some of
the relevant trade-offs.
sincerely.
--
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
On Thu, Feb 11, 2010 at 4:46 AM, HB wrote:
> Hey,
> Since Clojure is a LISP dialect, does this mean that it doesn't
> support OOP?
> Thanks.
http://lambda-the-ultimate.org/node/3465
sincerely.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post
On 11 February 2010 00:44, Sean Devlin wrote:
> Take a look here:
>
> http://clojure.org/contributing
Um... I strongly suspect that this may be a supremely silly question,
but I can't seem to figure out what's supposed to go in some of the
fields.
Does one specify "Clojure" as the first project
Here are some windows friendly options:
http://vimeo.com/tag:install_clojure
Sean
On Feb 11, 1:11 pm, e wrote:
> i can echo that last reply. I wanted to use clojure and may return to it
> ... awesome idea. But haven't had ANY luck with dev environments ... VC,
> included. gone down many blin
Hi all, long time lurker first time irritant.
I have been playing with clojure for a little while, and finding it most
excellent; however my lack of lisp thinking keeps leading me to write
ugly code.
I have the following code in java:
--
static final String CONNECTOR_ADDRESS =
"com.sun.
Hi All –
I would like to read in a text file and map the results to a struct,
and seem to be hung up.
The data set would look like:
Minneapolis\tMN\t55409
Beverly Hills\tCA\t90210
New York City\tNY\t10023
Etc….
Using duck streams:
(defn load-data [f] (into [] (ds/read-lines f)))
Yields a lo
You can use get on Properties. Use .foo for method calls. Use literal
vec syntax, not list. Use or for conditional branches instead of (if
foo foo ...).
Untested:
(defn obtain-local-connection [vmid]
(let [vm (VirtualMachine/attach vmid)
props (.getSystemProperties vm)
acqu
You can also you #_ to comment out a line of code
#_(.vm detach)
so that you don't have to put )) on the next line.
Brenton
On Feb 11, 10:39 am, Greg Bowyer wrote:
> Hi all, long time lurker first time irritant.
>
> I have been playing with clojure for a little while, and finding it most
> exc
Sorry, you are not commenting out a line of code but ignoring the next
form.
On Feb 11, 12:49 pm, Brenton wrote:
> You can also you #_ to comment out a line of code
>
> #_(.vm detach)
>
> so that you don't have to put )) on the next line.
>
> Brenton
>
> On Feb 11, 10:39 am, Greg Bowyer wrote:
>
Most of that java code is just pasting together library function
calls. I'm not sure if there's any more elegant ways of doing that.
Your clojure code looks fine for the most part I think. It's mostly
just a question of style. The only thing that sticks out is the call
to (list). That's generally n
On 11 February 2010 21:07, Richard Newman wrote:
>> What are other people doing to maintain their installations? Is there
>> some simple way to keep all of these projects up to date? Or do people
>> simply not update all of these projects often?
>
> I suck it up. Fortunately I was in the process o
On 11 February 2010 17:57, John Pall wrote:
> can we creat threads in clojure?
Yes.
Clojure 1.2.0-master-SNAPSHOT
user=> (Thread.)
#
But often you would use an agent or pmap etc. instead of creating
explicit threads.
--
Michael Wood
--
You received this message because you are subscribed t
On Thu, Feb 11, 2010 at 10:59 AM, Paul Mooser wrote:
> I struggle fairly often with keeping clojure/contrib/slime up to date
> on my machine - it seems that every time I update it, something
> fundamental has broken (like build.xml going away in contrib). There
> are a few things that seem to try
How about
(for [line (ds/read-lines file)]
(apply struct location
(rest (re-match #"([\w ]+)\t([\w ]+)\t([\w ]+)\t" line
?
Or
(for [line (ds/read-lines file)]
(let [[_ city state zip] (re-match #"..." line)] ; possibly with
regex from above
(struct location city state zip)))
Us
As Michael said, your original code works fine for me (running 1.2.0
master).
user=> (do (send artisan manufacture) (println @material @products
@products-store))
4 3 2
nil
user=> (do (send artisan manufacture) (println @material @products
@products-store))
3 0 6
nil
user=> (do (send artisan manu
Fantastic!
A million thank yous Michal!
On Feb 11, 3:40 pm, Michał Marczyk wrote:
> How about
>
> (for [line (ds/read-lines file)]
> (apply struct location
> (rest (re-match #"([\w ]+)\t([\w ]+)\t([\w ]+)\t" line
>
> ?
>
> Or
>
> (for [line (ds/read-lines file)]
> (let [[_ city state
As part of our clojure-contrib clean-up effort:
* c.c.java is gone
* as-str moved to c.c.string
* as-file and as-url moved to c.c.io
* properties stuff moved to c.c.properties
* wall-hack stuff move to c.c.reflect
These changes have been committed to the master branch on Github.
-SS
--
You rec
On 11 February 2010 22:48, Base wrote:
> Fantastic!
>
> A million thank yous Michal!
Not at all. :-)
Sincerely,
Michał
--
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 fro
Thanks a lot for your reply, Phil - I had no idea it was deprecated.
I'll make an effort to do what you've suggested!
On Feb 11, 1:29 pm, Phil Hagelberg wrote:
> On Thu, Feb 11, 2010 at 10:59 AM, Paul Mooser wrote:
>
> > I struggle fairly often with keeping clojure/contrib/slime up to date
> >
On Jan 1, 1:45 pm, Phil Hagelberg wrote:
> You can get this to work, but as you can see it's very manual and
> error-prone. The basicslimeREPL is working using automated
> installation from ELPA.
I am using the ELPA installation method, it's working well via the
automatic install. Thank you for p
I'm using counterclockwise, clojure version 1.1.0. The exception
stopped occurring I think I had to recompile the code.
I structured the code this way because of the way the problem is
formulated (e.g. the owner should be the only one to inc materials
etc), yet, the more I look at it the more it s
I now have another problem. When I run this in the repl:
(add-watch products :prodkey send-products)
(add-watch material :matkey ask-material)
(dump material products products-store)
(loop [cnt 10]
(map #(send % client-act) clients)
(map #(send % manufacture) artisans)
(if (zero? cnt
On Fri, Feb 5, 2010 at 12:50 PM, Phil Hagelberg wrote:
> Wow, I certainly was not expecting that level of response; this is great.
>
> Looks like the 11th (Thursday) is the crowd favorite. Once again, the
> location is http://bit.ly/c9jinW
>
> We'll be meeting in the back. Zoka is a big place, but
Paul,
I first struggled to find a way to do everything manually cause I
didn't like someone else's self installer messing up my distributions
setup. I think I've found a satisfactory hybrid approach to setup my
IDE on any machine now in 4 chunked steps.
1. I rely on the distro to install emacs, s
On 12 February 2010 03:19, Martin Hauner wrote:
> I'm mostly interested if there is anything in my code one would/should
> never do that way.
Looks excellent, you've aced it!
I'd like to discuss switching...
You wrote:
(cond
(empty? rolls) 0
(strike? rolls)(+ (score-strike rolls) (sc
Sadly, it looks like trying to follow the ELPA instructions to get
package.el going on my emacs ("carbon emacs") on the Mac doesn't
actually work - I'll have to debug into it later to figure out what's
actually going on, but unfortunately, for now, it's another dead end.
On Feb 11, 1:59 pm, Paul
On 12 February 2010 10:22, MiltondSilva wrote:
> (add-watch products :prodkey send-products)
> (add-watch material :matkey ask-material)
> (dump material products products-store)
> (loop [cnt 10]
> (map #(send % client-act) clients)
> (map #(send % manufacture) artisans)
> (if (zero? cnt
>(e.g. the owner should be the only one to inc materials
etc)
What's so special about the inc function as opposed to any other
function?
>Also, ask-materials and send-products should
> be call immediately after a certain threshold. ask-materials != dec,
> one decrements the other increments and
On Feb 11, 4:22 pm, MiltondSilva wrote:
> I now have another problem. When I run this in the repl:
>
> (add-watch products :prodkey send-products)
> (add-watch material :matkey ask-material)
> (dump material products products-store)
> (loop [cnt 10]
> (map #(send % client-act) clients)
>
On Feb 11, 4:34 pm, Timothy Pratley wrote:
> On 12 February 2010 03:19, Martin Hauner wrote:
>
> > I'm mostly interested if there is anything in my code one would/should
> > never do that way.
>
> Looks excellent, you've aced it!
>
> I'd like to discuss switching...You wrote:
>
> (cond
> (emp
On Thu, Feb 11, 2010 at 1:20 PM, Jeff Kowalczyk
wrote:
> The installed packages:
>
> clojure-mode-1.6
> slime-20091016
> slime-repl-20091016
> swank-clojure-1.1.0
>
> include snapshots of slime and slime/contrib/slime-repl.el. Will these
> be merged with upstream slime soon?
I spoke with the slim
Michael,
I'm not sure of the full feature list of leiningen but since it
maintains a local repo, there might be a way (or if not, it should be
added) to install locally built libs and clojure versions (projects
normally without project.clj files). Perhaps there is a way to add
that information (by
63 matches
Mail list logo