Re: aot compilation: minimise the scope of the resulting classes

2012-05-22 Thread Philip Aston
On Tuesday, May 22, 2012 6:06:21 PM UTC+1, Hugo Duncan wrote:
>
> Phil Hagelberg writes: 
> > One solution is to call require at runtime inside function bodies 
> > rather than at the top-level. Then to call the functions from the 
> > runtime-required namespace, use the resolve function. 
>
> Another is to use :impl-ns option in genclass and implement the java class 
> in a separate 
> namespace (assuming you are using genclass). 
>
>
Thank you both for the rapid assistance.

- 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

[ANN] clojure-echonest-api

2012-05-22 Thread Simone Mosciatti
Hi everybody,

I have release a library to query the echonest[1][2] API.
This is my very first job so I'm looking for feedback, especially about how 
to manage some basic configuration[3] and how introduce asynchronously 
agent[4]...

I am very happy to have finished this job...

Please contact me for every question or just to say that i did everything 
wrong...

Simone Mosciatti

[1] http://the.echonest.com/
[2] http://developer.echonest.com/ 
[3] Lines 16 and 18 
https://github.com/siscia/echonest-clojure-api/blob/master/src/echonest_api/with-doc-core.clj#L16
[4] Line 7 
https://github.com/siscia/echonest-clojure-api/blob/master/src/echonest_api/with-doc-core.clj#L7

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

ANN Welle 1.0 final

2012-05-22 Thread Michael Klishin
Welle RC1 was announced here about a week ago [1], so this will be a short one.

No issues have been found since 1.0.0-RC1 and documentation guides at 
http://clojureriak.info are now
complete, so it's time to release Welle 1.0.0 final.

Change log:
https://github.com/michaelklishin/welle/blob/master/ChangeLog.md

Documentation:
http://clojureriak.info

Updates on Twitter @ClojureWerkz.

That's about it.

1. https://groups.google.com/forum/#!topic/clojure/zUFKYZlYjfw

MK

-- 
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: aot compilation: minimise the scope of the resulting classes

2012-05-22 Thread Hugo Duncan
Phil Hagelberg  writes:

> On Mon, May 21, 2012 at 10:56 AM, Philip Aston  wrote:
>> I'd like to compile the bare minimum, even if this means some sort of
>> thunk in Bootstrap. How can I do this?
>
> One solution is to call require at runtime inside function bodies
> rather than at the top-level. Then to call the functions from the
> runtime-required namespace, use the resolve function.

Another is to use :impl-ns option in genclass and implement the java class in a 
separate
namespace (assuming you are using genclass).

Hugo

-- 
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: aot compilation: minimise the scope of the resulting classes

2012-05-22 Thread Phil Hagelberg
On Mon, May 21, 2012 at 10:56 AM, Philip Aston  wrote:
> I'm using lein2 to aot compile a namespace than generates a Java
> "Bootstrap" class. Bootstrap implements an interface and delegates
> calls to other namespaces.
>
> For some reason, the resulting jar file includes compiled classes for
> the delegate namespaces, and many of their transitive dependencies.

This is a known bug in Clojure with a patch in Jira:
http://dev.clojure.org/jira/browse/CLJ-322

> I'd like to compile the bare minimum, even if this means some sort of
> thunk in Bootstrap. How can I do this?

One solution is to call require at runtime inside function bodies
rather than at the top-level. Then to call the functions from the
runtime-required namespace, use the resolve function.

-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: defrecord with "inheritance"

2012-05-22 Thread Warren Lynn
Maybe some macros can help. But if it is a good and common pattern,
then it should be included as part of the the language. One thing I am
glad to see in Clojure is it absorbed some known good macros in Common
Lisp (like "awhen" becomes "when-let") so people don't need to re-
invent the wheels again and get things so fragmented (which is
something I am very frustrated with Common Lisp)

On May 21, 7:23 pm, kovas boguta  wrote:
> On Mon, May 21, 2012 at 6:08 PM, Mark Engelberg
>
>  wrote:
> > I never said I want inheritance.  I want convenient reuse of partial
> > implementations.  Inheritance is one way to achieve it, but I'd like to
> > think that Clojure can find a better way.
>
> We also have macros.
>
> You can always make your own
>
> (defmytype TypeName ...)
>
> and make compile to a  deftype that rolls in the protocol
> implementations you want to reuse.
>
> I believe the current mechanisms
>
>
>
>
>
>
>
> > are insufficient.  Copy and paste is not good enough.  Mergeable maps are a
> > good idea, but the current way of doing things steers people away from that
> > solution and requires too much forethought to actively plan for reuse.  If I
> > implement a protocol inside of defrecord, all that implementation is "locked
> > inside" and no one can get at it or reuse it in other contexts.  This flies
> > in the face of so many design principles of Clojure which generally eschew
> > unnecessary encapsulation and privacy to make it easy to get at, reuse, and
> > extend data and functions.
>
> > As I proposed in an earlier email, one brainstorm I have about this is:
>
> > (get-protocol-implementation  ) gives you back
> > a mapping of the functions used by that type to implement that protocol.
> > Also, we need a way to use mappings of functions inside of
> > defrecord/deftype, not just extend, if that is technologically feasible.
>
> > I am genuinely interested in further brainstorms on the topic of how to
> > encourage reuse of protocol implementations *without* inheritance.
>
> > --
> > 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: defrecord with "inheritance"

2012-05-22 Thread Warren Lynn
Seems to me an approach like this requires too much manual work. If I
know Employee have all the data fields of Person, then I know all
functions working on Person will work on Employee. That is clear and
simple.

In my view, in our programming work, maybe 80% or more time are spent
on simple things and maintenance, so we should not only focus on how
powerful and how clever the language solves difficult problems that
other languages cannot not easily solve. We should also do no worse
than other languages when it comes to those mundane and simple things.

On May 22, 1:09 am, Softaddicts  wrote:
> Interesting demonstration, except for one thing, defining getters is a waste 
> of
> time :)
>
> When you need to define accessors, you start to run into inefficient use of
> your time. It still a bearable workload in Java because of all this heavy 
> tooling that allows
> to select for which fields accessors will be generated.
> Without getters, you would also expose mutable stuff to the universe.
>
> However in Clojure the values are not mutable... Why bother defining
> an accessor to a read-only value ?
>
> A better way would be something like:
>
> (defprotocol Personable
>     (person [this])
>      (age [this] )
>
> (defprotocol CensusOperators
>     (age [this]))
>
> (extend-protocol Personable
>     Person
>     (person [this] this)
>     Employee
>     (person [this] (:person this)))
>
> (extend-protocol CensusOperators
>      Person
>      (age [this] (date-dif (java.util.Date.) (:birthday this)
>
> Much more convenient to me. I can take anything and make it a person.
> Even from a Clojure map just by extending it and returning a Person instance.
> You expose the Person abstraction when available instead of hiding it.
>
> Computed values like the age ? This is something that could be computed
> for other entities like an animal.
>
> So you can write (age (person )) or (age (animal )).
>
> This is why I tell people to get out of their usual thinking process. Get 
> lazy,
> playing hide and seek was fun at pre-school age but in your code and data
> structures ?
>
> Luc P.
>
>
>
>
>
>
>
>
>
> > I think it's misleading to use inheritance to reduce code duplication.
> > Inheritance is about indicating function typing and creating typed
> > contracts, both of which are fairly un-idiomatic in Clojure.
>
> > However, there is another way to prevent code duplication: use composition
> > instead.  Instead of having the Employee class mirror the attributes of the
> > Person (which if you really wanted, you could easily do via a "defperson"
> > like macro that would slug on extra fields), why not have an Employee carry
> > a Person as one of its attributes?  This approach is more similar to the
> > Haskell/functional way of working with record types (I think Haskell's
> > newtype operator works similarly under the covers).  There is also an
> > analogue to the decorator pattern in Java.
>
> > In this case, you would specify a Personable protocol, which both Person
> > and Employee implement; for all the basic operations, Employee would just
> > defer to its internal person.  Example:
>
> > (defrecord Person [name birthday])
>
> > (defrecord Employee [title person])
>
> > (defprotocol Personable
> >   (name [this])
> >   (age [this))
>
> > (extend-protocol Personable
> >   Person
> >   (name [this] (:name this))
> >   (age [this] (date-dif (java.util.Date.) (:birthday this)) ;;date diff
> > defined elsewhere
> >   Employee
> >   (name [this] (name (:person this))
> >   (age [this] (age (:person this)))
>
> > Arguably, if we were deferring to the current Java best practices and
> > encapsulation, one should be creating interfaces of getters and setters
> > rather than directly accessing instance variables anyway, making the extra
> > protocol definition no more work than doing it correctly in modern Java.
>
> > Best,
> > Mark
>
> > On Sunday, May 20, 2012 10:22:55 AM UTC-7, Warren Lynn wrote:
>
> > > So from what I read  the philosophy of Clojure discourages inheritance
> > > on concrete data types. However, maybe I am too entrenched in my OO
> > > thinking, how do I define a new record type that includes all the data
> > > members of another record type? I am thinking about the classic
> > > Employee/Person example.
>
> > > If I can define a record of Employee with Person's data members
> > > included, even that is not true inheritance (as no protocols of
> > > "Person" will be automatically extended to "Employee"), I need that
> > > for function re-use (so a function working on Person will
> > > automatically work on Employee because Employee is guaranteed to have
> > > all the data members in Person).
>
> > > Also, again, maybe I am too OO minded, is there a way inherit another
> > > record type's protocol implementation? That seems to give the best
> > > combination of both worlds (OO and functional), so you can either have
> > > you own very customized combination of data type/protocols, or use the
> > 

Re: [ANN] checkero 0.1.0 : A Clojure code similarity search tool

2012-05-22 Thread Arnoldo Muller
Hi Sean,

It does not have a wikipedia page. It is based on the following paper:

http://www.springerlink.com/content/23072603g83224v5/

The docs are a bit sparse so if you have questions do not hesitate to ask 
:) 

Regards,

AM. 

On Tuesday, May 22, 2012 9:47:49 AM UTC-6, Sean Neilan wrote:
>
> Just curious, what is the name of the tree distance function and does it 
> have a wikipedia page?
>
> Very, very cool!
>
> On May 22, 2012, at 12:36 AM, Arnoldo Muller  wrote:
>
> Checkero finds common Clojure source code inside a set of directories. It 
> is primarily intended to study how Clojure learners write functions. As a 
> side effect, you can find if students have honestly completed their 
> homework. It could also be used to find commonly used patterns in code that 
> require refactoring. The algorithm uses a state-of-the-art tree distance 
> function that quickly finds common tree patterns. It analyzes the 
> syntactical structure of Clojure programs and finds similar expressions.
>
> You can find more details here:
> https://github.com/amuller/checkero
>
> Suggestions and feedback are more than welcome!
>
> Arnoldo Muller 
>
>
>
>  -- 
> 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: [ANN] checkero 0.1.0 : A Clojure code similarity search tool

2012-05-22 Thread Sean Neilan
Just curious, what is the name of the tree distance function and does it
have a wikipedia page?

Very, very cool!

On May 22, 2012, at 12:36 AM, Arnoldo Muller 
wrote:

Checkero finds common Clojure source code inside a set of directories. It
is primarily intended to study how Clojure learners write functions. As a
side effect, you can find if students have honestly completed their
homework. It could also be used to find commonly used patterns in code that
require refactoring. The algorithm uses a state-of-the-art tree distance
function that quickly finds common tree patterns. It analyzes the
syntactical structure of Clojure programs and finds similar expressions.

You can find more details here:
https://github.com/amuller/checkero

Suggestions and feedback are more than welcome!

Arnoldo Muller



 --
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: Can't start clojurescript browser-connected repl

2012-05-22 Thread D.Bushenko
David,

I have just tried hosting index.html, main.js and out/ under 
tomcat7/webapps/my/ directory, executed the cljs repl, navigated to 
localhost:8080/my/index.html, and it worked!

Thanks, that was very helpful! 
Dmitry

P.S. I think, the note about hosting index.html on some kind of webserver 
should be added to the README.md.

-- 
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: Can't start clojurescript browser-connected repl

2012-05-22 Thread David Nolen
Loading the file directly in your browser will not work. The Closure
transport we use does not support that anymore.

David

On Tue, May 22, 2012 at 10:40 AM, D.Bushenko  wrote:

> Hey guys,
>
> Something is going totally wrong in the project samples/repl. This is OK
> that navigating to localhost:9000 wakes up the repl. But there is a file
> index.html which loads the compiled src/repl/test.cljs. As the test.cljs
> file contains the code (repl/connect "http://localhost:9000/repl";),
> loading the index.html should also wake up the repl. I don't know why it is
> not mentioned in README.md. I think, index.html should be also described in
> the readme file.
>
> Dmitry
>
>
>  --
> 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: Can't start clojurescript browser-connected repl

2012-05-22 Thread D.Bushenko
Hey guys, 

Something is going totally wrong in the project samples/repl. This is OK 
that navigating to localhost:9000 wakes up the repl. But there is a file 
index.html which loads the compiled src/repl/test.cljs. As the test.cljs 
file contains the code (repl/connect "http://localhost:9000/repl";), loading 
the index.html should also wake up the repl. I don't know why it is not 
mentioned in README.md. I think, index.html should be also described in the 
readme file.

Dmitry

-- 
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: Can't start clojurescript browser-connected repl

2012-05-22 Thread David Nolen
The README.md was up-to-date. test.cljs is now also up-to-date in master.

On Tue, May 22, 2012 at 10:26 AM, Raju Bitter wrote:

> Ok, you mean if you open the HTML page from disk, the REPL is not
> working for you. I can confirm that.
>
>
> There are conflicting instructions in the test.cljs file, and in the
> README.md
>
> https://github.com/clojure/clojurescript/blob/master/samples/repl/src/repl/test.cljs
> " ;; Open the file samples/repl/index.html"
>
> https://github.com/clojure/clojurescript/blob/master/samples/repl/README.md
> "Open http://localhost:9000/ in a browser. When this page is loaded it
> will connect to the REPL."
>
> Guess the commment in src/repl/test.cljs should be updated then. I'm
> not sure if the browser-connected REPL should work if the HTML page is
> loaded from disk. I see a JavaScript error in the browser console,
> URI file:/robots.txt is invalid for field ppu
>
> Looks like a security problem to me. Maybe someone from the
> ClojureScript team knows more.
>
> -  Raju
>
> --
> 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: Can't start clojurescript browser-connected repl

2012-05-22 Thread D.Bushenko
Raju,

This is great that you have found the problem! But is there a way I can 
connect a REPL to my web-page? What should I do for that? Do I need to load 
the page through the request to the web-server?

Dmitry

вторник, 22 мая 2012 г., 17:26:37 UTC+3 пользователь Raju Bitter написал:
>
> Ok, you mean if you open the HTML page from disk, the REPL is not 
> working for you. I can confirm that. 
>
>
> There are conflicting instructions in the test.cljs file, and in the 
> README.md 
>
> https://github.com/clojure/clojurescript/blob/master/samples/repl/src/repl/test.cljs
>  
> " ;; Open the file samples/repl/index.html" 
>
> https://github.com/clojure/clojurescript/blob/master/samples/repl/README.md 
> "Open http://localhost:9000/ in a browser. When this page is loaded it 
> will connect to the REPL." 
>
> Guess the commment in src/repl/test.cljs should be updated then. I'm 
> not sure if the browser-connected REPL should work if the HTML page is 
> loaded from disk. I see a JavaScript error in the browser console, 
> URI file:/robots.txt is invalid for field ppu 
>
> Looks like a security problem to me. Maybe someone from the 
> ClojureScript team knows more. 
>
> -  Raju 
>

-- 
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: Can't start clojurescript browser-connected repl

2012-05-22 Thread Raju Bitter
Ok, you mean if you open the HTML page from disk, the REPL is not
working for you. I can confirm that.


There are conflicting instructions in the test.cljs file, and in the README.md
https://github.com/clojure/clojurescript/blob/master/samples/repl/src/repl/test.cljs
" ;; Open the file samples/repl/index.html"

https://github.com/clojure/clojurescript/blob/master/samples/repl/README.md
"Open http://localhost:9000/ in a browser. When this page is loaded it
will connect to the REPL."

Guess the commment in src/repl/test.cljs should be updated then. I'm
not sure if the browser-connected REPL should work if the HTML page is
loaded from disk. I see a JavaScript error in the browser console,
URI file:/robots.txt is invalid for field ppu

Looks like a security problem to me. Maybe someone from the
ClojureScript team knows more.

-  Raju

-- 
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: Can't start clojurescript browser-connected repl

2012-05-22 Thread D.Bushenko
The browser is opened and the test page is loaded (after the repl is 
started). This is the most weird bcs it should work. At least if I navigate 
to localhost:9000 it works pretty well.

вторник, 22 мая 2012 г., 16:55:06 UTC+3 пользователь Raju Bitter написал:
>
> Dimitry, 
>
> are you trying to evaluate the expressinon (+ 1 1) with the browser 
> window closed? That's not going to work! 
>
> With the browser-connected REPL, the browser JS engine is used to 
> evaluate the JavaScript. If you don't use the browser-connected REPL, 
> ClojureScript will use the embedded Rhino JS engine. 
>
> - Raju 
>

-- 
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: Core.logic, dynamically generated goals

2012-05-22 Thread Alex Robbins
Good to think about. Thanks Brian.

On Sun, May 20, 2012 at 5:44 PM, Brian Marick  wrote:
>
> On May 19, 2012, at 1:12 PM, Alex Robbins wrote:
>
>> Is it possible to use dynamically generated goals in run* ?
>
> You might want to think macros. I have written macros that tweak `run` bodies 
> for various purposes:
>
>
>        `(~@runner [~qvar]
>                 (l/fresh [~(gensyms :procedure) ~(gensyms :animal)]
>                          (procedure-applies-to-animal-o ~(gensyms :procedure)
>                                                         ~(gensyms :animal))
>                          (l/== ~(gensyms :procedure) ~procedure)
>                          (l/== ~(gensyms :animal) ~animal)
>                          ~setter))]
>
>
> -
> Brian Marick, Artisanal Labrador
> Now working at http://path11.com
> Contract programming in Ruby and Clojure
> Occasional consulting on Agile
>
>
> --
> 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: Can't start clojurescript browser-connected repl

2012-05-22 Thread Raju Bitter
Dimitry,

are you trying to evaluate the expressinon (+ 1 1) with the browser
window closed? That's not going to work!

With the browser-connected REPL, the browser JS engine is used to
evaluate the JavaScript. If you don't use the browser-connected REPL,
ClojureScript will use the embedded Rhino JS engine.

- Raju

-- 
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: Can't start clojurescript browser-connected repl

2012-05-22 Thread D.Bushenko
Raju,

That's correct, I'm talking about the project 
https://github.com/clojure/clojurescript/tree/master/samples/repl .

Dmitry

вторник, 22 мая 2012 г., 16:51:16 UTC+3 пользователь Raju Bitter написал:
>
> Pierre-Henry, 
>
> I think you are referring to the ClojureScript One tutorial? 
> http://clojurescriptone.com/getting-started.html 
>
> The commands listed there will only work with ClojureScript One, not 
> with the ClojureScript examples in Git. Dimitry is trying to get the 
> browser-connected REPL in the ClojureScript samples to work. 
>
> https://github.com/clojure/clojurescript/tree/ad0e4af1b20fe829ea3a7feb1b7067250309b1cc/samples/repl
>  
>
> - Raju 
>

-- 
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: Lexer and parser generator in Clojure

2012-05-22 Thread Lukas Domagala
you could try https://github.com/Cyrik/clparsec . i´m still working on an
alpha release, but it already has all the basic parsec operators

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

Application monitoring with Netty?

2012-05-22 Thread Jeroen van Dijk
Hi all,

I'm planning to deploy an app on Heroku that exploits some features of
Aleph (e.g. streaming responses). Coming from the Ruby world I've been
spoiled with all the application metrics that NewRelic provides. For
Clojure, however, they currently only support Jetty based apps. Does anyone
know similar solutions that work with Netty or has anyone got NewRelic
working with Netty? The option I am trying to avoid is writing a NewRelic
client myself.

Thanks,
Jeroen

-- 
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: Can't start clojurescript browser-connected repl

2012-05-22 Thread Raju Bitter
Pierre-Henry,

I think you are referring to the ClojureScript One tutorial?
http://clojurescriptone.com/getting-started.html

The commands listed there will only work with ClojureScript One, not
with the ClojureScript examples in Git. Dimitry is trying to get the
browser-connected REPL in the ClojureScript samples to work.
https://github.com/clojure/clojurescript/tree/ad0e4af1b20fe829ea3a7feb1b7067250309b1cc/samples/repl

- Raju

-- 
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: defrecord with "inheritance"

2012-05-22 Thread David Nolen
On Tue, May 22, 2012 at 8:29 AM, nicolas.o...@gmail.com <
nicolas.o...@gmail.com> wrote:>>

> > Why should most extensions manipulate mutable fields?
> >
> Most certainly won't. Now none of them can.


Good :)

-- 
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: defrecord with "inheritance"

2012-05-22 Thread nicolas.o...@gmail.com
>
> Access internal state?
>>

Like __hash in your code.

>> For example, the earlier hash example cannot be put as an extension.
>
> Why should most extensions manipulate mutable fields?
>
Most certainly won't. Now none of them can.

-- 
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: defrecord with "inheritance"

2012-05-22 Thread David Nolen
On Tue, May 22, 2012 at 8:04 AM, nicolas.o...@gmail.com <
nicolas.o...@gmail.com> wrote:

> And then you need to include everything accessing the internal state of
> your data structures in a big deftype with little possibility of reuse.


Access internal state?

> For example, the earlier hash example cannot be put as an extension.
>
Why should most extensions manipulate mutable fields?

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: defrecord with "inheritance"

2012-05-22 Thread nicolas.o...@gmail.com
> The only exception is mutable fields in the type where you don't want
uncontrolled access. There you indeed need a protocol to handle the
synchronisation of the field access.
>
>
And then you need to include everything accessing the internal state of
your data structures in a big deftype with little possibility of reuse.

For example, the earlier hash example cannot be put as an extension.

Another related problem is the fact that lambda do not close over the
mutable fields within a deftype. (Or at least that is what i understood
from several strange error messages.) FP stops at the doors of deftype...

-- 
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: defrecord with "inheritance"

2012-05-22 Thread David Nolen
It sounds like you have issue with working with something as low level as
deftype not with protocols nor how they are intended to be used. Most
people don't need to bother with equivalence or lookup - they have
defrecord.

On Monday, May 21, 2012, Mark Engelberg wrote:

> On Mon, May 21, 2012 at 4:00 PM, David Nolen 
> 
> > wrote:
>
>> The only two protocols that involve specifying more than 2 fns is
>> IWatchable (3) and MultiFn (5). It's not clear to me that they would
>> benefit from partial specification.
>>
>
> I don't think there's enough body of code using protocols to really know
> what is going to turn out to be the natural size for protocols but even if
> we talk about "total" reuse instead of "partial" reuse, the issue is still
> the same -- the implementation of protocols is generally locked up with no
> easy way to reuse.  If I know I want to implement ILookup the same way it
> was implemented for some other data structure, I have to be able to see
> your code, and then copy and paste it.  For some things, it is obvious how
> to reimplement, but for some it is not.
>
> When I implemented priority maps, I had a difficult time figuring out all
> the interfaces that needed to be implemented, and it was especially
> difficult to figure out the right way to implement the various notions of
> equivalence and equality.  Basically, I just wanted it to behave like the
> built-in maps.  I had to copy and paste, and shortly after I completed my
> implementation, a change was made to how these concepts were handled in the
> core.  My notion of equality became out-of-sync with that of built-in maps
> because I had no convenient way to say, "Do it the way regular maps do
> it."  I ended up having to rewrite that code.
>
> So there is a maintenance issue here too.  When Nicolas pointed out the
> many repetitions of something like the implementation of, say, ILookup,
> your response was that it would never be a big deal to just do a
> search-replace if you wanted to make a change.  But that assumes that the
> only copies occur in your own code.  When map equality changed, no one
> automatically did a search and replace in my code to make sure it would
> stay consistent.  This is why code reuse mechanisms that don't rely on
> copy/paste search/replace are valuable, especially in the core, where other
> people are trying hard to make structures that behave in a core-like way.
>
>
>  --
> 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 '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  'clojure%2bunsubscr...@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: Can't start clojurescript browser-connected repl

2012-05-22 Thread D.Bushenko
This is the README.md shipped with the clojurescript/samples/repl project. 
I also tried the steps from the comments to the 
clojurescript/samples/repl/src/repl/test.cljs -- the same result.

-- 
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: defrecord with "inheritance"

2012-05-22 Thread Meikel Brandmeyer (kotarak)
Hi,

Am Dienstag, 22. Mai 2012 09:01:31 UTC+2 schrieb Nicolas Oury:
>
>
> I think the whole thread is about the trade-off: some people complains 
> that deftype lacks features. 
>

It's not about trade-offs. It's about deftype seemingly lacking features.
 

> Another problem with extend is that you can't access your instance 
> variables with it.


Oh, you can!

user=> (deftype Foo [x])
user.Foo
user=> (defprotocol AFoo (foo [this]))
AFoo
user=> (extend-protocol AFoo Foo (foo [this] (.x this)))
nil
user=> (foo (Foo. 5))
5

The only exception is mutable fields in the type where you don't want 
uncontrolled access. There you indeed need a protocol to handle the 
synchronisation of the field access.

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

Re: defrecord with "inheritance"

2012-05-22 Thread Softaddicts
My strategy here would be different, the conversion fn would be part of
the cell attributes. Maybe with the help of a lightweight factory fn to ease
record allocation.

The Convertable protocol would simply refer to the closure attribute, call it
and pass this as the unique parameter.

The reasons for this choice ?

A) The delta between the derived types is minimal, in your example,
  it's not the data that changes, only a variation in the rendering.

B) Rendering is a fundamental operation.
 Without it, I think the Cell would be much less useful if not at all.
 It's pretty much part of the Cell.

C) Locality.

 In real life you would probably have more than one operation that needs a
 dispatch. If you create new types and protocols to cope with this, you
 will end up with a maze of definitions. Using a helper factory fn to 
allocate
 the record and choosing appropriate dispatchs will
 centralize this in one spot.

 No heavy cond needed at rendering time, just at dispatch assignment.
 The dispatch can then refer to private fns that will take care of rendering
 far away from your data type/protocol definitions.

 Take your example and add 30 variations of rendering as defrecords and
 defprotocol and let me know how your esthetic sensor feels afterward :)

 I am not fond of creating variations of defrecords when the data 
attributes are
 the same. Already in Java I cannot stand the russian puppet syndrom where
 ancestor classes have a couple of getters/setters less than their 
descendants :)

Of course if the data properties varies a lot and you end passing nil to many
constructor args, then you have a clear case where it's time to
create different types and corresponding dispatch/protocols. Up to you to
figure when and why...

I try to restrict my use protocols to bridge behavior between different Clojure 
data types
or to add different behaviors to these, so far so good. My needs for 
defrecord/deftype
is nearly nil.

I do not try to hide implementation details while operating basically on the 
same data
representation by adding more definitions.
Other strategies exist that require less code and definitions, dispatch fns is 
one,
multi methods another

Luc P.

> Hey Luc,
> 
> That's a cool casting strategy to cleanly build a standard way to get at 
> the person piece of any type of applicable record.  In the pure composition 
> case, it's actually a nice solution to build functions know how to unpack 
> the Person aspect of a subtype.
> 
> However, I think which strategy is best depends very much on whether you 
> plan to extensively change the protocol implementation between the the 
> different  related types.  In the case where Employee simply carries extra 
> information with regard to a person, I agree that it is nice simply to 
> define a mechanism to extract the base type and just act on it directly.  
> However if you wish to do something more complicated or override default 
> behavior extensively, I think the encapsulated "newtyped" way is more 
> convenient.
> 
> For example, how about we build a little DSL to represent different types 
> of Excel cells.  In Excel, everything is represented as a float, so we have 
> to keep track of the type separately.  I think using a record type is a 
> fairly natural way to encode this extra data on type of Cell, where I might 
> have reached for inheritance in traditional OOP.
> 
> (defprotocol Convertable
>   (convert-cell [this]))
> 
> (defrecord Cell [row col float-value])
> 
> (defrecord MoneyCell [cell])
> 
> (defrecord DateCell [cell])
> 
> (defrecord NumberCell [cell])
> 
> (extend-protocol Convertable
> NumberCell
> (convert-cell [this] (float (-> this :cell :float-value))
> DateCell
> (convert-cell [this] (excel-date (-> this :cell :float-value)) ;; 
> Translate an Excel datestamp to java.util.Date
> MoneyCell
> (convert-cell [this] (bigdec (convert-cell (Number (:cell this) 
> ;;BigDecimals are for exact money handling.
> 
> Blindly unpacking the Cell type (via a Cellable convention like in the 
> Person example) would lose information we need to accurately describe the 
> conversion process and call the best function.  This strategy also 
> leverages ones of the best aspects of protocols: how extensible they are to 
> new types of data.  If I ever decide to support a StringCell type or a 
> BooleanCell, I would just be one extend-protocol away rather than having to 
> rewrite some gnarly embedded cond to work with my new type of cell.  Of 
> course for operations that don't care about their type, creating a protocol 
> to extract the cell and working directly with its attributes (such as 
> manipulating row and position directly), makes a great deal of sense.
> 
> Best,
> Mark
> 
> On Monday, May 21, 2012 10:09:02 PM UTC-7, Luc wrote:
> >
> > Interesting demonstration, except for one thing, defining getters is a 
> > waste of 
> > time :) 
> >
> > When

Re: defrecord with "inheritance"

2012-05-22 Thread David Nolen
Field access works just fine with extend.

On Tuesday, May 22, 2012, nicolas.o...@gmail.com wrote:

> > Everyone just reiterates the mantra “It's slower! It's slower! It's
> > slower!”, but no one talks about the trade-offs. And I bet only a very
> > small fraction ever checked what “slower” means in their specific use
> > case.
>
> I think the whole thread is about the trade-off: some people complains
> that deftype lacks features.
> Another problem with extend is that you can't access your instance
> variables with
> it. And so you end up creating fake Protocols for that, which is even
> worse than a big deftype.
>
> --
> 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: Can't start clojurescript browser-connected repl

2012-05-22 Thread David Nolen
Which README.md? Might have missed updating one.

Thanks

On Tuesday, May 22, 2012, Дмитрий Бушенко wrote:

> No, I didn't try that since it wasn't in the README.md file. I thought the
> steps described in the readme should be sufficient to run the repl, isn't
> it?
>
> 2012/5/22 Pierre-Henry Perret 
>
> Hoops ->  Have you started the dev server ? repl > (dev-server) ?
>
> Le mardi 22 mai 2012 10:29:00 UTC+2, D.Bushenko a écrit :
>
> I have just tried 
> http://localhost:8080/**development
> as well as 
> http://localhost:9000/**development-- 
> nothing happens. The server doesn't respond to the first URI at all, the
> second URI just doesn't exist.
>
> 2012/5/22 Pierre Henry Perret 
>
> Hi Dimitry,
>
> Have you tried 
> http://localhost:8080/**development
>
>
> ?
>
> --
> Pierre
>
>
>
>
> 2012/5/22 D.Bushenko 
>
> Hi all,
>
> I'm trying to run clojurescript repl connected to browser and have failed
> in all my attempts. I'm running the "clojurescript/samples/repl" project
> provided with the clojurescript distribution. I'm following the README.md
> step by step and doing the following:
>
> dim@tarantoga:~/clojure/**clojurescript/samples/repl$ ../../script/repl
> Clojure 1.4.0
> user=> (use 'cljs.closure)
> nil
> user=> user=> (def opts {:output-to "main.js" :output-dir "out"})
> #'user/opts
> user=> (build "src" opts)
> nil
> user=> (require '[cljs.repl :as repl])
> nil
> user=> (require '[cljs.repl.browser :as browser])
> nil
> user=> (def env (browser/repl-env))
> #'user/env
> user=> (repl/repl env)
> "Type: " :cljs/quit " to quit"
> ClojureScript:cljs.user> (+ 1 1)
>
> Then I open the file clojurescript/samples/repl/**index.html in my
> Firefox 12 and waiting for the result of evaluation of the last expression
> "(+ 1 1)". Nothing happens, the repl just hangs.
>
> If I navigate to localhost:9000 everything goes OK, the repl works.
>
> What I'm doing wrong and how to connect the repl to the web page?
>
> P.S. Using java version "1.6.0_32"
> Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
>
> Dmitry
>
> --
> 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+unsubscribe@**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+unsubscribe@**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 e
>
>

-- 
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: defrecord with "inheritance"

2012-05-22 Thread Softaddicts
Bad copy & paste, forgot to remove age from the Personable def.


> On May 22, 2012 7:09 AM, "Softaddicts"  wrote:
> > A better way would be something like:
> >
> > (defprotocol Personable
> >(person [this])
> > (age [this] )
> >
> > (defprotocol CensusOperators
> >(age [this]))
> >
> > (extend-protocol Personable
> >Person
> >(person [this] this)
> >Employee
> >(person [this] (:person this)))
> >
> > (extend-protocol CensusOperators
> > Person
> > (age [this] (date-dif (java.util.Date.) (:birthday this)
> >
> > Much more convenient to me. I can take anything and make it a person.
> 
> I really don't understand your example. Personable#age conflicts with
> CensusOperators#age if you define them in the same Namespace (and you'll
> get a warning telling you so) . If they're in separate namespaces , what's
> the point of Personable #age, given you never define an implementation?
> 
> > Even from a Clojure map just by extending it and returning a Person
> instance.
> > You expose the Person abstraction when available instead of hiding it.
> >
> > Computed values like the age ? This is something that could be computed
> > for other entities like an animal.
> >
> > So you can write (age (person )) or (age (animal )).
> >
> > This is why I tell people to get out of their usual thinking process. Get
> lazy,
> > playing hide and seek was fun at pre-school age but in your code and data
> > structures ?
> >
> > Luc P.
> >
> >
> > > I think it's misleading to use inheritance to reduce code duplication.
> > > Inheritance is about indicating function typing and creating typed
> > > contracts, both of which are fairly un-idiomatic in Clojure.
> > >
> > > However, there is another way to prevent code duplication: use
> composition
> > > instead.  Instead of having the Employee class mirror the attributes of
> the
> > > Person (which if you really wanted, you could easily do via a
> "defperson"
> > > like macro that would slug on extra fields), why not have an Employee
> carry
> > > a Person as one of its attributes?  This approach is more similar to the
> > > Haskell/functional way of working with record types (I think Haskell's
> > > newtype operator works similarly under the covers).  There is also an
> > > analogue to the decorator pattern in Java.
> > >
> > > In this case, you would specify a Personable protocol, which both Person
> > > and Employee implement; for all the basic operations, Employee would
> just
> > > defer to its internal person.  Example:
> > >
> > > (defrecord Person [name birthday])
> > >
> > > (defrecord Employee [title person])
> > >
> > > (defprotocol Personable
> > >   (name [this])
> > >   (age [this))
> > >
> > > (extend-protocol Personable
> > >   Person
> > >   (name [this] (:name this))
> > >   (age [this] (date-dif (java.util.Date.) (:birthday this)) ;;date diff
> > > defined elsewhere
> > >   Employee
> > >   (name [this] (name (:person this))
> > >   (age [this] (age (:person this)))
> > >
> > > Arguably, if we were deferring to the current Java best practices and
> > > encapsulation, one should be creating interfaces of getters and setters
> > > rather than directly accessing instance variables anyway, making the
> extra
> > > protocol definition no more work than doing it correctly in modern Java.
> > >
> > > Best,
> > > Mark
> > >
> > > On Sunday, May 20, 2012 10:22:55 AM UTC-7, Warren Lynn wrote:
> > > >
> > > > So from what I read  the philosophy of Clojure discourages inheritance
> > > > on concrete data types. However, maybe I am too entrenched in my OO
> > > > thinking, how do I define a new record type that includes all the data
> > > > members of another record type? I am thinking about the classic
> > > > Employee/Person example.
> > > >
> > > > If I can define a record of Employee with Person's data members
> > > > included, even that is not true inheritance (as no protocols of
> > > > "Person" will be automatically extended to "Employee"), I need that
> > > > for function re-use (so a function working on Person will
> > > > automatically work on Employee because Employee is guaranteed to have
> > > > all the data members in Person).
> > > >
> > > > Also, again, maybe I am too OO minded, is there a way inherit another
> > > > record type's protocol implementation? That seems to give the best
> > > > combination of both worlds (OO and functional), so you can either have
> > > > you own very customized combination of data type/protocols, or use the
> > > > very common OO pattern. Just like we have both the single-typed
> > > > dispatching (which is more OO like and covers a large portion of use
> > > > cases), and more advanced multimethods.
> > > >
> > > > 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
> you

Re: Can't start clojurescript browser-connected repl

2012-05-22 Thread D.Bushenko
No, it doesn't. That's why I'm here looking for help.

-- 
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: Can't start clojurescript browser-connected repl

2012-05-22 Thread Pierre Henry Perret
Right, just follow that, it should work.

--
Pierre


2012/5/22 Дмитрий Бушенко 

> No, I didn't try that since it wasn't in the README.md file. I thought the
> steps described in the readme should be sufficient to run the repl, isn't
> it?
>
>
> 2012/5/22 Pierre-Henry Perret 
>
>> Hoops ->  Have you started the dev server ? repl > (dev-server) ?
>>
>> Le mardi 22 mai 2012 10:29:00 UTC+2, D.Bushenko a écrit :
>>
>>> I have just tried 
>>> http://localhost:8080/**development
>>> as well as 
>>> http://localhost:9000/**development-- 
>>> nothing happens. The server doesn't respond to the first URI at all, the
>>> second URI just doesn't exist.
>>>
>>> 2012/5/22 Pierre Henry Perret 
>>>
 Hi Dimitry,

 Have you tried 
 http://localhost:8080/**development


 ?

 --
 Pierre




 2012/5/22 D.Bushenko 

 Hi all,
>
> I'm trying to run clojurescript repl connected to browser and have
> failed in all my attempts. I'm running the "clojurescript/samples/repl"
> project provided with the clojurescript distribution. I'm following the
> README.md step by step and doing the following:
>
> dim@tarantoga:~/clojure/**clojurescript/samples/repl$
> ../../script/repl
> Clojure 1.4.0
> user=> (use 'cljs.closure)
> nil
> user=> user=> (def opts {:output-to "main.js" :output-dir "out"})
> #'user/opts
> user=> (build "src" opts)
> nil
> user=> (require '[cljs.repl :as repl])
> nil
> user=> (require '[cljs.repl.browser :as browser])
> nil
> user=> (def env (browser/repl-env))
> #'user/env
> user=> (repl/repl env)
> "Type: " :cljs/quit " to quit"
> ClojureScript:cljs.user> (+ 1 1)
>
> Then I open the file clojurescript/samples/repl/**index.html in my
> Firefox 12 and waiting for the result of evaluation of the last expression
> "(+ 1 1)". Nothing happens, the repl just hangs.
>
> If I navigate to localhost:9000 everything goes OK, the repl works.
>
> What I'm doing wrong and how to connect the repl to the web page?
>
> P.S. Using java version "1.6.0_32"
> Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
>
> Dmitry
>
> --
> 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+unsubscribe@**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+unsubscribe@**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
>>
>
>  --
> 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: Can't start clojurescript browser-connected repl

2012-05-22 Thread Дмитрий Бушенко
No, I didn't try that since it wasn't in the README.md file. I thought the
steps described in the readme should be sufficient to run the repl, isn't
it?

2012/5/22 Pierre-Henry Perret 

> Hoops ->  Have you started the dev server ? repl > (dev-server) ?
>
> Le mardi 22 mai 2012 10:29:00 UTC+2, D.Bushenko a écrit :
>
>> I have just tried 
>> http://localhost:8080/**development
>> as well as 
>> http://localhost:9000/**development-- 
>> nothing happens. The server doesn't respond to the first URI at all, the
>> second URI just doesn't exist.
>>
>> 2012/5/22 Pierre Henry Perret 
>>
>>> Hi Dimitry,
>>>
>>> Have you tried 
>>> http://localhost:8080/**development
>>>
>>>
>>> ?
>>>
>>> --
>>> Pierre
>>>
>>>
>>>
>>>
>>> 2012/5/22 D.Bushenko 
>>>
>>> Hi all,

 I'm trying to run clojurescript repl connected to browser and have
 failed in all my attempts. I'm running the "clojurescript/samples/repl"
 project provided with the clojurescript distribution. I'm following the
 README.md step by step and doing the following:

 dim@tarantoga:~/clojure/**clojurescript/samples/repl$ ../../script/repl
 Clojure 1.4.0
 user=> (use 'cljs.closure)
 nil
 user=> user=> (def opts {:output-to "main.js" :output-dir "out"})
 #'user/opts
 user=> (build "src" opts)
 nil
 user=> (require '[cljs.repl :as repl])
 nil
 user=> (require '[cljs.repl.browser :as browser])
 nil
 user=> (def env (browser/repl-env))
 #'user/env
 user=> (repl/repl env)
 "Type: " :cljs/quit " to quit"
 ClojureScript:cljs.user> (+ 1 1)

 Then I open the file clojurescript/samples/repl/**index.html in my
 Firefox 12 and waiting for the result of evaluation of the last expression
 "(+ 1 1)". Nothing happens, the repl just hangs.

 If I navigate to localhost:9000 everything goes OK, the repl works.

 What I'm doing wrong and how to connect the repl to the web page?

 P.S. Using java version "1.6.0_32"
 Java(TM) SE Runtime Environment (build 1.6.0_32-b05)

 Dmitry

 --
 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+unsubscribe@**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+unsubscribe@**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
>

-- 
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: Can't start clojurescript browser-connected repl

2012-05-22 Thread Pierre-Henry Perret
Hoops ->  Have you started the dev server ? repl > (dev-server) ?

Le mardi 22 mai 2012 10:29:00 UTC+2, D.Bushenko a écrit :
>
> I have just tried http://localhost:8080/development  as well as 
> http://localhost:9000/development  -- 
> nothing happens. The server doesn't respond to the first URI at all, the 
> second URI just doesn't exist.
>
> 2012/5/22 Pierre Henry Perret 
>
>> Hi Dimitry,
>>
>> Have you tried http://localhost:8080/development 
>>
>> ?
>>
>> --
>> Pierre
>>
>>
>>
>>
>> 2012/5/22 D.Bushenko 
>>
>> Hi all,
>>>
>>> I'm trying to run clojurescript repl connected to browser and have 
>>> failed in all my attempts. I'm running the "clojurescript/samples/repl" 
>>> project provided with the clojurescript distribution. I'm following the 
>>> README.md step by step and doing the following:
>>>
>>> dim@tarantoga:~/clojure/clojurescript/samples/repl$ ../../script/repl
>>> Clojure 1.4.0
>>> user=> (use 'cljs.closure)
>>> nil
>>> user=> user=> (def opts {:output-to "main.js" :output-dir "out"})
>>> #'user/opts
>>> user=> (build "src" opts)
>>> nil
>>> user=> (require '[cljs.repl :as repl])
>>> nil
>>> user=> (require '[cljs.repl.browser :as browser])
>>> nil
>>> user=> (def env (browser/repl-env))
>>> #'user/env
>>> user=> (repl/repl env)
>>> "Type: " :cljs/quit " to quit"
>>> ClojureScript:cljs.user> (+ 1 1)
>>>
>>> Then I open the file clojurescript/samples/repl/index.html in my Firefox 
>>> 12 and waiting for the result of evaluation of the last expression "(+ 1 
>>> 1)". Nothing happens, the repl just hangs.
>>>
>>> If I navigate to localhost:9000 everything goes OK, the repl works. 
>>>
>>> What I'm doing wrong and how to connect the repl to the web page?
>>>
>>> P.S. Using java version "1.6.0_32"
>>> Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
>>>
>>> Dmitry
>>>
>>> -- 
>>> 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
>>
>
>

-- 
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: Can't start clojurescript browser-connected repl

2012-05-22 Thread Дмитрий Бушенко
I have just tried http://localhost:8080/development  as well as
http://localhost:9000/development  --
nothing happens. The server doesn't respond to the first URI at all, the
second URI just doesn't exist.

2012/5/22 Pierre Henry Perret 

> Hi Dimitry,
>
> Have you tried http://localhost:8080/development
>
> ?
>
> --
> Pierre
>
>
>
>
> 2012/5/22 D.Bushenko 
>
> Hi all,
>>
>> I'm trying to run clojurescript repl connected to browser and have failed
>> in all my attempts. I'm running the "clojurescript/samples/repl" project
>> provided with the clojurescript distribution. I'm following the README.md
>> step by step and doing the following:
>>
>> dim@tarantoga:~/clojure/clojurescript/samples/repl$ ../../script/repl
>> Clojure 1.4.0
>> user=> (use 'cljs.closure)
>> nil
>> user=> user=> (def opts {:output-to "main.js" :output-dir "out"})
>> #'user/opts
>> user=> (build "src" opts)
>> nil
>> user=> (require '[cljs.repl :as repl])
>> nil
>> user=> (require '[cljs.repl.browser :as browser])
>> nil
>> user=> (def env (browser/repl-env))
>> #'user/env
>> user=> (repl/repl env)
>> "Type: " :cljs/quit " to quit"
>> ClojureScript:cljs.user> (+ 1 1)
>>
>> Then I open the file clojurescript/samples/repl/index.html in my Firefox
>> 12 and waiting for the result of evaluation of the last expression "(+ 1
>> 1)". Nothing happens, the repl just hangs.
>>
>> If I navigate to localhost:9000 everything goes OK, the repl works.
>>
>> What I'm doing wrong and how to connect the repl to the web page?
>>
>> P.S. Using java version "1.6.0_32"
>> Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
>>
>> Dmitry
>>
>> --
>> 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
>

-- 
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: Can't start clojurescript browser-connected repl

2012-05-22 Thread Pierre Henry Perret
Hi Dimitry,

Have you tried http://localhost:8080/development

?

--
Pierre




2012/5/22 D.Bushenko 

> Hi all,
>
> I'm trying to run clojurescript repl connected to browser and have failed
> in all my attempts. I'm running the "clojurescript/samples/repl" project
> provided with the clojurescript distribution. I'm following the README.md
> step by step and doing the following:
>
> dim@tarantoga:~/clojure/clojurescript/samples/repl$ ../../script/repl
> Clojure 1.4.0
> user=> (use 'cljs.closure)
> nil
> user=> user=> (def opts {:output-to "main.js" :output-dir "out"})
> #'user/opts
> user=> (build "src" opts)
> nil
> user=> (require '[cljs.repl :as repl])
> nil
> user=> (require '[cljs.repl.browser :as browser])
> nil
> user=> (def env (browser/repl-env))
> #'user/env
> user=> (repl/repl env)
> "Type: " :cljs/quit " to quit"
> ClojureScript:cljs.user> (+ 1 1)
>
> Then I open the file clojurescript/samples/repl/index.html in my Firefox
> 12 and waiting for the result of evaluation of the last expression "(+ 1
> 1)". Nothing happens, the repl just hangs.
>
> If I navigate to localhost:9000 everything goes OK, the repl works.
>
> What I'm doing wrong and how to connect the repl to the web page?
>
> P.S. Using java version "1.6.0_32"
> Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
>
> Dmitry
>
> --
> 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: New release of Domina (now with reworked eventing)

2012-05-22 Thread Dmitry Groshev
cljsbuild still screams on me when building Domina with the latest 
Clojurescript and cljsbuild.

WARNING: Use of undeclared Var domina/.DomContent at line 459 
/home/si14/repos/domina/src/cljs/domina.cljs
WARNING: Use of undeclared Var domina/.nodes at line 459 
/home/si14/repos/domina/src/cljs/domina.cljs
WARNING: Use of undeclared Var domina/.single-node at line 459 
/home/si14/repos/domina/src/cljs/domina.cljs

and so on.

On Thu, 3 May 2012 at 1:22:19 UTC+4 David Nolen wrote:
>
> Michal Marczyk submitted a patch - should be fixed in master.
>
> David
>
> On Sat, Apr 28, 2012 at 3:26 PM, Luke VanderHart <
> luke.vanderh...@gmail.com> wrote:
>
>> Yep, still happens against master.
>>
>> Trying to reduce it to a simpler test case now (and also see if it still 
>> happens when I take lein-cljsbuild out of the equation).
>>
>>
>> On Saturday, April 28, 2012 1:29:07 PM UTC-4, David Nolen wrote:
>>>
>>> Which version of ClojurScript? Have you tried building against master?
>>>
>>> David
>>>
>>> On Sat, Apr 28, 2012 at 1:19 PM, Luke VanderHart <
>>> luke.vanderh...@gmail.com> wrote:
>>>
 David,

 Yes. I've been looking at that today. Something is going on that is not 
 so straightforward, though - I think there might be a compiler issue (or 
 else I'm misunderstanding some aspect of the compiler).

 For example, I'm getting the warning on compiler-generated vars. e.g:

 WARNING: Use of undeclared Var domina.css/t7256 at line 14

 Still investigating (though if you happen to know what's going on, 
 please let me know)


 On Friday, April 27, 2012 3:26:43 PM UTC-4, David Nolen wrote:

> lein-cljsbuild is now becoming the tool of choice for many CLJS devs. 
> One thing I've noticed about domina is that it's not particularly careful 
> about declaration order. This results in a spew of compiler warnings when 
> building your project with domina. It would be nice to sprinkle the code 
> with the necessary declares to eliminate these warnings.
>
> David
>
> On Fri, Apr 27, 2012 at 10:47 AM, Luke VanderHart wrote:
>
> Some of you may already be aware of of Domina, a jQuery-inspired DOM 
>> manipulation library I've been working on. It's been out there for a 
>> while, 
>> but I just finished up a round of changes that I think bring it to a 
>> certain degree of completion for basic use (although there's definitely 
>> a 
>> lot of cool stuff that still remains to be added).
>>
>> Most notable is a new set of eventing functions; I hope they'll 
>> provide an easy-to-use, low-level foundation for building more complex 
>> data- and event-driven web applications.
>>
>> Please check it out: 
>> https://github.com/levand/**domi**na/
>>
>> Feedback, pull request, etc. are welcome.
>>
>> Thanks!
>>
>> -Luke  
>>
>> -- 
>> 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+unsubscribe@**googlegrou**ps.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+unsubscribe@**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
>>
>
>
четверг, 3 мая 2012 г., 1:22:19 UTC+4 пользователь David Nolen написал:
>
> Michal Marczyk submitted a patch - should be fixed in master.
>
> David
>
> On Sat, Apr 28, 2012 at 3:26 PM, Luke VanderHart <
> luke.vanderh...@gmail.com> wrote:
>
>> Yep, still happens against master.
>>
>> Trying to reduce it to a simpler test case now (and also see if it still 
>> happens when I take lein-cljsbuild out of the equation).
>>
>>
>> On Saturday, April 28, 2012 1:29:07 PM UTC-4, David Nolen wrote:
>>>
>>> Which

compile: produce a java class with minimum linkage to other clojrue code

2012-05-22 Thread Philip Aston
Hello,

I'm aot compiling a namespace with lein2 to produce a Java class that is 

  (:gen-class
   :name blah.Bootstrap
   :implements [some.java.Interface]
:prefix bootstrap-
  ))


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

aot compilation: minimise the scope of the resulting classes

2012-05-22 Thread Philip Aston
I'm using lein2 to aot compile a namespace than generates a Java
"Bootstrap" class. Bootstrap implements an interface and delegates
calls to other namespaces.

For some reason, the resulting jar file includes compiled classes for
the delegate namespaces, and many of their transitive dependencies.

I tried to use jar-exclusions to remove the extra class files from the
jar, but the graph of generated Java class appears to link to them as
it fails at runtime with NoClassDefFoundExceptions.

I'd like to compile the bare minimum, even if this means some sort of
thunk in Bootstrap. How can I do this? 

Thanks for any pointers.

- 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

Can't start clojurescript browser-connected repl

2012-05-22 Thread D.Bushenko
Hi all,

I'm trying to run clojurescript repl connected to browser and have failed 
in all my attempts. I'm running the "clojurescript/samples/repl" project 
provided with the clojurescript distribution. I'm following the README.md 
step by step and doing the following:

dim@tarantoga:~/clojure/clojurescript/samples/repl$ ../../script/repl
Clojure 1.4.0
user=> (use 'cljs.closure)
nil
user=> user=> (def opts {:output-to "main.js" :output-dir "out"})
#'user/opts
user=> (build "src" opts)
nil
user=> (require '[cljs.repl :as repl])
nil
user=> (require '[cljs.repl.browser :as browser])
nil
user=> (def env (browser/repl-env))
#'user/env
user=> (repl/repl env)
"Type: " :cljs/quit " to quit"
ClojureScript:cljs.user> (+ 1 1)

Then I open the file clojurescript/samples/repl/index.html in my Firefox 12 
and waiting for the result of evaluation of the last expression "(+ 1 1)". 
Nothing happens, the repl just hangs.

If I navigate to localhost:9000 everything goes OK, the repl works. 

What I'm doing wrong and how to connect the repl to the web page?

P.S. Using java version "1.6.0_32"
Java(TM) SE Runtime Environment (build 1.6.0_32-b05)

Dmitry

-- 
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: defrecord with "inheritance"

2012-05-22 Thread nicolas.o...@gmail.com
> Everyone just reiterates the mantra “It's slower! It's slower! It's
> slower!”, but no one talks about the trade-offs. And I bet only a very
> small fraction ever checked what “slower” means in their specific use
> case.

I think the whole thread is about the trade-off: some people complains
that deftype lacks features.
Another problem with extend is that you can't access your instance
variables with
it. And so you end up creating fake Protocols for that, which is even
worse than a big deftype.

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