Re: Literate programming in emacs - any experience?

2012-01-24 Thread Colin Yates
The topic is literate programming in emacs, not eclipse ;).

The trivial amount of Clojure I have done so far has all been in emacs and
letting go of paredit, slime, and emacs in general is already pretty hard!

On 24 January 2012 03:06, daly  wrote:

>
> > > For Eclipse I suppose we could invent a chunk syntax
> > > and create a plugin. If people are interested perhaps we
> > > could create a Literate Clojure plugin for Eclipse. See
> > > http://www.eclipse.org/articles/Article-Your%20First%
> > > 20Plug-in/YourFirstPlugin.html
> > > That would make Clojure and Literate much more useful
> > > to Eclipse users.
> >
> > Based on CCW, or a de novo effort?
> >
> Ah. I was unaware of CCW although it has been mentioned here.
>
> I don't use Eclipse. I was just following the principle that
> "advocacy is volunteering" and, since I'm advocating doing
> literate programming and the topic is literate Clojure
> under Eclipse, I felt I needed to set up some kind of
> solution. I try to implement what I advocate (e.g. showing
> tangle for lisp code and HTML code). Otherwise I'd be
> expecting someone else to do stuff I want and that's not
> really how open source should work.
>
> So, no, if CCW is already doing this then follow their lead.
>
> Tim Daly
>
>
> --
> 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
>

-- 
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: Logic program and hierarchical data

2012-01-24 Thread Base
Thank you all!

David, as always, greatly appreciated!

On Jan 23, 11:09 pm, David Nolen  wrote:
> On Tue, Jan 24, 2012 at 12:00 AM, Cedric Greevey  wrote:
> > On Mon, Jan 23, 2012 at 11:41 PM, David Nolen 
> > wrote:
> > > (def homo-sapiens
> > >   {:domain :eukarya
> > >    :kingdom :animalia-metazoa
> > >    :phylum :chordata
> > >    :class :mammalia
> > >    :order :primate
> > >    :family :hominidae
> > >    :genus :homo
> > >    :species :homo-sapiens})
>
> > Looks like putting all the transitive relations in by hand to me.
> > Ideally, once you had a genus set up you'd only have to specify that
> > various species of the genus are species of that genus, and not have
> > to specify kingdom, phylum, class, order, or family for any of them
> > explicitly.
>
> Sure, improvements left as an exercise for the reader ;)
>
> David

-- 
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: ANN: Clojure/West conf and training early bird ends this Friday

2012-01-24 Thread Alex Miller
Below is an updated title and abstract for Richard Gabriel's (http://
dreamsongs.com/) keynote at Clojure/West:


Title: Engineering(,) A Path to Science: “I don’t want to die in a
language I can’t understand

Abstract: "I’m going to talk about one, old paper: “Mixin-based
Inheritance,” by Gilad Bracha and William Cook, published in 1990.
Bracha is now one of Google’s Dart guys. I will draw two observations
from that paper in its context, one trivial but difficult for some to
believe, and one complex whose implications might surprise. The first
is that in the discipline of programming languages, engineers create
the nature that computer scientists study—that is, engineering
precedes science. The second is that we can use Thomas Kuhn’s and Paul
Feyerabend’s notion of incommensurability to detect paradigm shifts in
our field, and what we learn by doing that can be surprising.

In case this sounds boring to you (fair enough), consider how Kuhn
stumbled on the idea of incommensurability:

Incommensurability is a notion that for me emerged from attempts to
understand apparently nonsensical passages in old scientific texts."


On Jan 22, 11:29 pm, Alex Miller  wrote:
> If you want to meet with other Clojure developers, check out Clojure/
> West in San Jose, CA March 16-17th!  It is preceded by several days of
> training (which may also be taken independently from the conference).
> The Clojure/West conference and training early bird rates end *this
> Friday* Jan 27th.
>
> Conference
> * Schedule:http://clojurewest.org/schedule
> * Register:http://regonline.com/clojurewest2012- $375 till Friday!
> * Sponsor:http://clojurewest.org/sponsor-prospectus
>
> Training - $200 off till Friday!
> * Register:http://regonline.com/clojurewest2012training
> * Intro to Clojure (3 days) - Stuart Sierra, Alan Dipert 
> -http://clojurewest.org/training-intro-to-clojure
> * Cascalog (3 days) - Sam Ritchie -http://clojurewest.org/training-cascalog
> * Clojure Web (2 days) - Chris Granger 
> -http://clojurewest.org/training-clojure-web
> * Pallet (2 days) - Hugo Duncan, Toni Batchelli 
> -http://clojurewest.org/training-pallet
>
> Hope you can make it!
> - Alex Miller

-- 
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: Logic program and hierarchical data

2012-01-24 Thread Ryan Senior
I think separating the facts from determining the hierarchy makes it easier:

(defrel typeof* p c)

(facts typeof* [[:homo :homo-sapiens]
[:hominidae :homo]
[:primate :hominidae]
[:mammalia :primate]
[:chordata :mammalia]
[:animalia :chordata]
[:eukarya :animalia]])

(defn typeof [p c]
  (conde
   ((typeof* p c))
   ((fresh [other-p]
   (typeof* other-p c)
   (typeof p other-p)

(run 1 [q]
 (typeof  :eukarya :mammalia)
 (typeof  :eukarya :primate)
 (typeof  :eukarya :hominidae)
 (== q true))

;; => (true

(run* [q]
  (typeof q :homo-sapiens))

;;=> (:homo :hominidae :primate :mammalia :chordata :animalia :eukarya)


-Ryan


On Mon, Jan 23, 2012 at 11:09 PM, David Nolen wrote:

> On Tue, Jan 24, 2012 at 12:00 AM, Cedric Greevey wrote:
>
>> On Mon, Jan 23, 2012 at 11:41 PM, David Nolen 
>> wrote:
>> > (def homo-sapiens
>> >   {:domain :eukarya
>> >:kingdom :animalia-metazoa
>> >:phylum :chordata
>> >:class :mammalia
>> >:order :primate
>> >:family :hominidae
>> >:genus :homo
>> >:species :homo-sapiens})
>>
>> Looks like putting all the transitive relations in by hand to me.
>> Ideally, once you had a genus set up you'd only have to specify that
>> various species of the genus are species of that genus, and not have
>> to specify kingdom, phylum, class, order, or family for any of them
>> explicitly.
>
>
> Sure, improvements left as an exercise for the reader ;)
>
> David
>
> --
> 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
>

-- 
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: How to loop over several sequences in parallel for side-effects?

2012-01-24 Thread joachim
First: Thanks all for your thoughts.

Second: I have the same question as Allen (why would the doseq variant
be faster in this case?)

Finally: so I guess that what I did was also OK then?

Jm

On Jan 20, 9:57 pm, Alan Malloy  wrote:
> But I don't see any reason why this would be faster than (dorun (map
> side-effect-fn s1 s2 s3)). You're creating and then dismantling a
> three-element vector at every iteration to no purpose.
>
> On Jan 20, 12:40 pm, Meikel Brandmeyer  wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > to add to Lars answer:
>
> > (doseq [[a b c] (map vector s1 s2 s3)]
> >   (side-effect-fn a b c))
>
> > This should do the trick.
>
> > Sincerely
> > Meikel

-- 
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


How to add a new type of collection?

2012-01-24 Thread joachim
Dear,

I am using a java class that implements sparse matrices (see
http://javasourcecode.org/html/open-source/mahout/mahout-0.5/org/apache/mahout/math/SparseMatrix.html).
I was wondering how to add them to clojure as a new type of
collection, so that I can use nth and count etc. on them?

Thanks, Joachim.

-- 
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: Clojure for Cocoa

2012-01-24 Thread Axel Katerbau, Objectpark
Hi Konrad,

On 23 Jan., 05:13, Konrad Hinsen 
wrote:
> David Nolen writes:
>
>  > Having a version of Clojure that integrates with OS X as well as Clojure
>  > integrates with the JVM will be a much more ambitious task but it would be
>  > really, really cool.
>
> As this would imply integrating with the C/C++/Objective universe in
> general, it would also be very useful outside of the OS X platform.
> It just looks like a lot of work.

sure. But integrating with the Objective-C runtime would be necessary
to fully embrace the Cocoa frameworks which is IMHO crucial for "real"
Mac/iOS programming with Clojure.

- Axel

-- 
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: Clojure for Cocoa

2012-01-24 Thread Axel Katerbau, Objectpark
Hi David,

On 23 Jan., 04:00, David Nolen  wrote:

> This would be cool. I think just comes down to how ambitious you are.
>
> ClojureScript is effectively Clojure-in-Clojure. Given that we can target
> JavaScript communicating with Objective-C is not that difficult, i.e.
> JSCocoa.
>
> Having a version of Clojure that integrates with OS X as well as Clojure
> integrates with the JVM will be a much more ambitious task but it would be
> really, really cool.
>
> Projects that seem relevant, at least to me:
>
> * F-Script
> * JSCocoa
> * Clozure CL
> * MacRuby

I think the JSCocoa/Clojurescript would work somehow but the latter is
more what I'd love to have.
Thanks for the pointers.

Clojure in Clojure would be a nice start to have e.g. a LLVM frontend.
But it's really quiet as far as CiC goes, right?

- Axel

-- 
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: Concurrency Talk materials

2012-01-24 Thread Sergey Stupin
This link  http://clojure.googlegroups.com/web/ClojureConcurrencyTalk.pdf is 
broken. Where can i get slides? 
Thank you.

-- 
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: Literate programming in emacs - any experience?

2012-01-24 Thread Stuart Sierra
With a little hacking, org-babel works with Clojure editing & evaluation in 
SLIME. I've been using it to write Clojure training materials.

You need the latest versions of org-mode, SLIME, and clojure-mode. My 
.emacs has the relevant elisp snippets. 
http://github.com/stuartsierra/dotfiles

-S

-- 
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: How to add a new type of collection?

2012-01-24 Thread Stuart Sierra
The fundamental interfaces are all written in Java. ISeq, 
IPersistentCollection, and so on. You can implement then in deftype.

Look at (ancestors (class [])) as a place to start.

-S

-- 
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: Literate programming in emacs - any experience?

2012-01-24 Thread Colin Yates
Thanks Stuart.

On 24 January 2012 14:18, Stuart Sierra  wrote:

> With a little hacking, org-babel works with Clojure editing & evaluation
> in SLIME. I've been using it to write Clojure training materials.
>
> You need the latest versions of org-mode, SLIME, and clojure-mode. My
> .emacs has the relevant elisp snippets.
> http://github.com/stuartsierra/dotfiles
>
> -S
>
>  --
> 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
>

-- 
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: Concurrency Talk materials

2012-01-24 Thread Kevin Ilchmann Jørgensen
https://encrypted.google.com/search?hl=en&q=ClojureConcurrencyTalk.pdf

Gives me  
ftp://ftp.elet.polimi.it/users/Matteo.Giovanni.Rossi/Didattica/FunProgLang4Parallelism/04-ClojureConcurrencyTalk.pdf

Is that it ?

/Kevin


On Mon, Jan 23, 2012 at 6:14 AM, Sergey Stupin  wrote:
> This link  http://clojure.googlegroups.com/web/ClojureConcurrencyTalk.pdf is
> broken. Where can i get slides?
> Thank you.
>
> --
> 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

-- 
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: Clojure for Cocoa

2012-01-24 Thread Timothy Baldridge
> Clojure in Clojure would be a nice start to have e.g. a LLVM frontend.
> But it's really quiet as far as CiC goes, right?

It should be mentioned that writing a Clojure compiler is not a very
long task it basically comes down to the following tasks:

1) Implement the persistent classes (PersistentList, PersistentHashMap, etc.)
2) Implement the LispReader
3) Implement the Compiler
4) Start fixing bugs in core.clj

About a month ago I started implementing Clojure on the Python VM.
It's still in pre-alpha, but the current system can compile and run
over 500 lines of clojure's core.clj.
(https://github.com/halgari/clojure-py)

Now, the fun part is adapting the "clojure-jvm way" of doing things to
a system that your tool-chain prefers. So, for instance, in Java we
have Namespace.java to handle namespace creation, and tracking. But in
Python the module system works perfectly fine for us. So
clojure.lang.Namespace doesn't even exist in clojure-py. Other clojure
functions such as "cast" have absolutely no use at all in clojure-py
and are therefore removed. However, other functions like "vec" are
implemented in pure clojure code in clojure-py, while they are
implemented in java code in clojure-jvm

So next we have to ask a different question, do you want your
clojure-objc compiler to depend on java to run? This is what
clojurescript does. It does not have a compiler written in javascript.
Instead the compiler is written Java, and this compiler outputs
javascript. This means that all clojurescript macros must be
compile-able by clojure-jvm, while the rest of the code has to be
clojurescript compatible. In clojure-py the compiler is written in
python, and is completely independent from clojure-jvm

Finally you'll need to research how hard it is to get llvm to
interface with the objc runtime. So if I say this in clojure:

(instance? clojure.lang.IPersistentList x)

What llvm functions will you call to a) find
clojure.lang.IPersistentList and b) how will you determine the class
of x.

Some things to think about,

Timothy

-- 
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: Clojure for Cocoa

2012-01-24 Thread David Nolen
On Mon, Jan 23, 2012 at 4:55 AM, Axel Katerbau, Objectpark <
akater...@googlemail.com> wrote:

> Hi David,
>
> On 23 Jan., 04:00, David Nolen  wrote:
>
> > This would be cool. I think just comes down to how ambitious you are.
> >
> > ClojureScript is effectively Clojure-in-Clojure. Given that we can target
> > JavaScript communicating with Objective-C is not that difficult, i.e.
> > JSCocoa.
> >
> > Having a version of Clojure that integrates with OS X as well as Clojure
> > integrates with the JVM will be a much more ambitious task but it would
> be
> > really, really cool.
> >
> > Projects that seem relevant, at least to me:
> >
> > * F-Script
> > * JSCocoa
> > * Clozure CL
> > * MacRuby
>
> I think the JSCocoa/Clojurescript would work somehow but the latter is
> more what I'd love to have.
> Thanks for the pointers.
>
> Clojure in Clojure would be a nice start to have e.g. a LLVM frontend.
> But it's really quiet as far as CiC goes, right?
>
> - Axel
>

As I said CiC is effectively ClojureScript. Reusable parts like the
analyzer have already being extracted from it.

I don't think there's any interest to take on something like LLVM from the
Clojure/core team - but I don't think they're discouraging anyone either.
Clojure targets the JVM, CLR, and JavaScript. From what I can tell it's up
to the community to push it to even more platforms.

David

-- 
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: How to loop over several sequences in parallel for side-effects?

2012-01-24 Thread Armando Blancas
Well, you can always use the (time) macro and pick what runs faster:

(dorun (map some-fn-with-side-effects sequence-1 sequence-2))

(doseq [x (map some-fn-with-side-effects sequence-1 sequence-2))])

(doseq) could be faster in some cases because its implementation uses
chunked sequences. Now, (doseq) can take multiple sequences, but that
may not be what you want:
user=> (doseq [x '(1 2) y '(3 4)] (println x y))
1 3
1 4
2 3
2 4



On Jan 23, 3:51 am, joachim  wrote:
> First: Thanks all for your thoughts.
>
> Second: I have the same question as Allen (why would the doseq variant
> be faster in this case?)
>
> Finally: so I guess that what I did was also OK then?
>
> Jm
>
> On Jan 20, 9:57 pm, Alan Malloy  wrote:
>
>
>
>
>
>
>
> > But I don't see any reason why this would be faster than (dorun (map
> > side-effect-fn s1 s2 s3)). You're creating and then dismantling a
> > three-element vector at every iteration to no purpose.
>
> > On Jan 20, 12:40 pm, Meikel Brandmeyer  wrote:
>
> > > Hi,
>
> > > to add to Lars answer:
>
> > > (doseq [[a b c] (map vector s1 s2 s3)]
> > >   (side-effect-fn a b c))
>
> > > This should do the trick.
>
> > > Sincerely
> > > Meikel

-- 
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


How to use goog.dom.query

2012-01-24 Thread Jonas
Hi all

I was wondering if it's possible to use goog.dom.query[1] from 
ClojureScript or ClojureScript One? It's a third party module but it's 
bundled with the Closure version which is downloaded by scripts/bootstrap. 
I've tried (:require [goog.dom.query :as query]) but that doesn't work out 
of the box for me. Looking at the source code[2] I can see it referenced 
several times which makes me hopeful that I should get it working. It seems 
that maybe I should add 

:libs ["closure/library/third_party/closure"]

or something similar to my build options but still no luck.

[1]: 
http://closure-library.googlecode.com/svn/docs/closure_third_party_closure_goog_dojo_dom_query.js.html
[2]: 
https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/closure.clj#L555

-- 
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: How to use goog.dom.query

2012-01-24 Thread Mark Rathwell
You can look at how Pinot does it, some links to get you started:

https://github.com/ibdknox/pinot
https://github.com/ibdknox/pinot/blob/master/project.clj
https://github.com/ibdknox/pinot/blob/master/src/pinot/dom.cljs
https://groups.google.com/forum/#!msg/clj-noir/x5x9vcI-T4E/FaCfb8jhDXoJ


On Tue, Jan 24, 2012 at 12:35 PM, Jonas  wrote:
> Hi all
>
> I was wondering if it's possible to use goog.dom.query[1] from ClojureScript
> or ClojureScript One? It's a third party module but it's bundled with the
> Closure version which is downloaded by scripts/bootstrap. I've tried
> (:require [goog.dom.query :as query]) but that doesn't work out of the box
> for me. Looking at the source code[2] I can see it referenced several times
> which makes me hopeful that I should get it working. It seems that maybe I
> should add
>
>     :libs ["closure/library/third_party/closure"]
>
> or something similar to my build options but still no luck.
>
> [1]: http://closure-library.googlecode.com/svn/docs/closure_third_party_closure_goog_dojo_dom_query.js.html
> [2]: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/closure.clj#L555
>
> --
> 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

-- 
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: How to use goog.dom.query

2012-01-24 Thread Dave Sann
The third party libs are not included in the std closurescript jar.

pinot requires a modified jar that contains the extra libs. If you follow 
the instructions for pinot - you can get this lib and install it - it's 
fairly painless.

I don't know of an easy way to include these without doing this.

There is a version with a newer closure library here:

   - https://github.com/davesann/clojurescript-goog-jar

(It is currently this version of the closure library : 
closure-library-2010-r1376.zip)

I made some notes on how I created this here: 

   - https://groups.google.com/d/topic/clj-noir/x5x9vcI-T4E/discussion


Cheers

Dave

-- 
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

Help coding Eller's maze algorithm.

2012-01-24 Thread Gabriele Carrettoni
Hi, I'm trying to code the algorithm described 
here 
with 
no luck.
I'm struggling to find the best data structure to hold each cell, how to 
random join cells and how to build the next row. 
I'm not necessarily looking for code, but i would like to have some hints 
because this algo is driving me nuts and i always end up with a lot of 
messy code that doesn't feel right. (and in fact it isn't because it never 
works).

Thanks in advance.

-- 
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

Conflicting transactions

2012-01-24 Thread Ersin Er
Hi,

What does "conflicting transactions" actually mean in terms of Clojure STM?
Are they write-write transactions on a data structure or are they more
granularly considered conflicting for example if they are manipulating the
same element of a target data structure (e.g. HashMap)?

Thanks.

-- 
Ersin Er

-- 
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: How to use goog.dom.query

2012-01-24 Thread Dave Sann
when I say clojurescript jar here - I meant specifically

the goog.jar found in the lib dir of your clojurescript install. This 
contains the closure libraries.

-- 
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: How to add a new type of collection?

2012-01-24 Thread Ben Mabey

On 1/24/12 7:20 AM, Stuart Sierra wrote:
The fundamental interfaces are all written in Java. ISeq, 
IPersistentCollection, and so on. You can implement then in deftype.


Look at (ancestors (class [])) as a place to start.

-S


I believe the OP wanted to know if they could extend a java data 
structure (a mahout matrix in this case) to adhere to the collections 
interfaces.  As far as I know you can't do that without wrapping the 
original data structure or by using proxy.  Correct?  Either way, you 
aren't really extending the original java type to act like a clojure 
collection.


--
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


Adding primitive type hints to anonymous functions

2012-01-24 Thread Ben Mabey

Does the new primitive support added in 1.3 extend to anonymous functions?

If so, I am doing something wrong because I can't get them to work:

(definterface IPrimitiveTester
  (getType [^int x])
  (getType [^long x])
  (getType [^float x])
  (getType [^double x])
  (getType [^Object x]))

(deftype PrimitiveTester []
  IPrimitiveTester
  (getType [this ^int x] :int)
  (getType [this ^long x] :long)
  (getType [this ^float x] :float)
  (getType [this ^double x] :double)
  (getType [this ^Object x] :object))

(defmacro pt [x]
  `(.getType (PrimitiveTester.) ~x))

(defn with-defn ^double [^double x]
  (+ x 0.5))


(def with-def (fn ^double [^double x]
(+ x 0.5)))


(pt (with-defn 1.0)) ; => :double

(pt (with-def 1.0)) ; => :object



So.. is the above user error, known limitation, bug, or new issue?

Thanks,
Ben

--
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: Conflicting transactions

2012-01-24 Thread Kevin Downey
On Tue, Jan 24, 2012 at 8:49 AM, Ersin Er  wrote:
> Hi,
>
> What does "conflicting transactions" actually mean in terms of Clojure STM?
> Are they write-write transactions on a data structure or are they more
> granularly considered conflicting for example if they are manipulating the
> same element of a target data structure (e.g. HashMap)?
>
> Thanks.

Conflicts occur if two transactions alter or ref-set the same ref. It
seems obvious from your question that you haven't looked at the stm at
all (or clojure for that matter) so I suggest you read some
documentation or watch a video on it.

http://blip.tv/clojure/clojure-concurrency-819147

> --
> Ersin Er
>
> --
> 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



-- 
And what is good, Phaedrus,
And what is not good—
Need we ask anyone to tell us these things?

-- 
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: How to add a new type of collection?

2012-01-24 Thread Stuart Sierra
Oh, I see. Yes, you can't do that in Clojure right now, because the core 
functions are not based on Protocols.

ClojureScript is built on Protocols from the ground up. It would be nice to 
have this in Clojure too, but would require some pretty serious redesign.
-S

-- 
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: How to add a new type of collection?

2012-01-24 Thread endbegin
I know this isn't exactly what the OP is looking for, but the Incanter 
project has done something for dense matrices that might work. The Matrix 
type has been imported (which is a java class), and a whole bunch of 
functions have been implemented on that class.
See here
https://github.com/liebke/incanter/blob/master/modules/incanter-core/src/incanter/core.clj

-- 
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: Adding primitive type hints to anonymous functions

2012-01-24 Thread Tassilo Horn
Ben Mabey  writes:

Hi Ben,

> Does the new primitive support added in 1.3 extend to anonymous
> functions?

I guess, it should.  At least they are not disregarded...

--8<---cut here---start->8---
user> (def with-def (fn ^float [^float x]
(+ x 0.5)))
;Only long and double primitives are supported
;  [Thrown class java.lang.IllegalArgumentException]
; Evaluation aborted.
--8<---cut here---end--->8---

> If so, I am doing something wrong because I can't get them to work:
>
> (definterface IPrimitiveTester
>   (getType [^int x])
>   (getType [^long x])
>   (getType [^float x])
>   (getType [^double x])
>   (getType [^Object x]))
>
> (deftype PrimitiveTester []
>   IPrimitiveTester
>   (getType [this ^int x] :int)
>   (getType [this ^long x] :long)
>   (getType [this ^float x] :float)
>   (getType [this ^double x] :double)
>   (getType [this ^Object x] :object))
>
> (defmacro pt [x]
>   `(.getType (PrimitiveTester.) ~x))
>
> (defn with-defn ^double [^double x]
>   (+ x 0.5))
>
> (def with-def (fn ^double [^double x]
> (+ x 0.5)))
>
> (pt (with-defn 1.0)) ; => :double
> (pt (with-def 1.0)) ; => :object
>
> So.. is the above user error, known limitation, bug, or new issue?

Looks like a bug to me.  And it's pretty strange, because defn expands
into a (def foo (fn ...)) anyway...

Oh, you can add the return type metadata to the def-ed var like so:

--8<---cut here---start->8---
user> (def ^{:tag Double/TYPE}
with-def (fn  [^double x]
(+ x 0.5)))
#'user/with-def
user> (pt (with-def 3))
:double
--8<---cut here---end--->8---

But OTOH, the metadata of `with-defn' does not have :tag.  And basically
it shouldn't, because with overloaded arities, the return type may
differ between versions...

Bye,
Tassilo

-- 
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