On Fri, Dec 16, 2011 at 05:48, jayvandal wrote:
> I was looking at the installation in "Learning clojure" and the batch
> file had this statement:
>
> java -server -cp .;%CLOJURE_JAR% clojure.main
>
> why is the "server" in the line and what is it referencing???
> Thanks for any help
The Ja
I was looking at the installation in "Learning clojure" and the batch
file had this statement:
java -server -cp .;%CLOJURE_JAR% clojure.main
why is the "server" in the line and what is it referencing???
Thanks for any help
--
You received this message because you are subscribed to the Go
It means to use the server version of JVM
On Dec 15, 2011, at 11:48 PM, jayvandal wrote:
> I was looking at the installation in "Learning clojure" and the batch
> file had this statement:
>
> java -server -cp .;%CLOJURE_JAR% clojure.main
>
> why is the "server" in the line and what is it
I was looking at the installation in "Learning clojure" and the batch
file had this statement:
java -server -cp .;%CLOJURE_JAR% clojure.main
why is the "server" in the line and what is it referencing???
Thanks for any help
--
You received this message because you are subscribed to the Go
On Dec 15, 10:03 pm, Cedric Greevey wrote:
> So, I can wait until either larger numbers of primitive arguments are
> supported, or primitive vectors are supported.
We already have persistent vectors that store their contents as
primitives with gvec. If you take a look at IFn.java, you'll see that
On Thu, Dec 15, 2011 at 11:03 PM, Cedric Greevey wrote:
> For instance, if I want to optimize (distance x1 y1 z1 x2 y2 z2), I
> can't. If I declare anything primitive, the compiler complains as
> there are more than four arguments. If I change the input format to
> (distance [x1 y1 z1] [x2 y2 z2]
On Thu, Dec 15, 2011 at 10:13 PM, David Nolen wrote:
> Nobody wants map-longs. We have lovely abstractions like map / filter /
> reduce, we have primitive fns, we have collections which can hold
> primitives, we have type hints.
>
> What I'd like to see is that by adding one single annotation to t
On Thu, Dec 15, 2011 at 9:47 PM, Cedric Greevey wrote:
> ...
Nobody wants map-longs. We have lovely abstractions like map / filter /
reduce, we have primitive fns, we have collections which can hold
primitives, we have type hints.
What I'd like to see is that by adding one single annotation to
On Thu, Dec 15, 2011 at 9:31 PM, David Nolen wrote:
> On Thu, Dec 15, 2011 at 9:23 PM, Cedric Greevey wrote:
>> There is no possibility of "high performance higher order usage",
>> because primitives are boxed inside of collections. Unless you
>> proliferate int-vectors, double-vectors, long-seqs
On Thu, Dec 15, 2011 at 9:23 PM, Cedric Greevey wrote:
> On Thu, Dec 15, 2011 at 8:56 PM, David Nolen
> wrote:
> > On Thu, Dec 15, 2011 at 8:16 PM, Cedric Greevey
> wrote:
> >>
> >> public class MangledName implements IFn {
> >>public Object invoke () { // unoptimized zero-arg version or ar
On Thu, Dec 15, 2011 at 8:56 PM, David Nolen wrote:
> On Thu, Dec 15, 2011 at 8:16 PM, Cedric Greevey wrote:
>>
>> public class MangledName implements IFn {
>> public Object invoke () { // unoptimized zero-arg version or arity
>> throw goes here }
>> public Object invoke (Object x) { // uno
On Thu, Dec 15, 2011 at 8:16 PM, Cedric Greevey wrote:
> public class MangledName implements IFn {
>public Object invoke () { // unoptimized zero-arg version or arity
> throw goes here }
>public Object invoke (Object x) { // unoptimized one-arg version ... }
>...
>public static lo
On Thu, Dec 15, 2011 at 8:47 PM, Softaddicts
wrote:
> Your approach requires some lifting both in the runtime and the compiler.
I beg your pardon?
> Why not sign a CA, implement it and submit a patch and supporting runtime
> data ?
Sounds like a lot of hoops to jump through. The
direct-primiti
Your approach requires some lifting both in the runtime and the compiler.
Why not sign a CA, implement it and submit a patch and supporting runtime data ?
However there a plans to rewrite Clojure in Clojure on the JVM,
some lessons have been learned while writing the ClojureScript compiler.
This m
On Thu, Dec 15, 2011 at 8:32 PM, Softaddicts
wrote:
> It's not "silly", it's the fastest way to dispatch fn calls...
Only calls with more than 20 arguments (or via "apply") would need to
be dispatched specially.
--
You received this message because you are subscribed to the Google
Groups "Cloju
It's not "silly", it's the fastest way to dispatch fn calls...
> On Thu, Dec 15, 2011 at 8:05 PM, Softaddicts
> wrote:
> > From a JVM perspective, f(& arglist) is a one arg function.
> > Try defining a fn with more than 20 args and you will get the
> > "can't specify more than 20 arguments"
On Thu, Dec 15, 2011 at 8:05 PM, Softaddicts
wrote:
> From a JVM perspective, f(& arglist) is a one arg function.
> Try defining a fn with more than 20 args and you will get the
> "can't specify more than 20 arguments" error.
> This is the maximum supported by the Clojure runtime for "non-opti
>From a JVM perspective, f(& arglist) is a one arg function.
Try defining a fn with more than 20 args and you will get the
"can't specify more than 20 arguments" error.
This is the maximum supported by the Clojure runtime for "non-optimized" fns.
One can argue about the argument size limit of
On Thu, Dec 15, 2011 at 7:48 PM, David Nolen wrote:
> On Thu, Dec 15, 2011 at 7:43 PM, Cedric Greevey wrote:
>>
>> In that case, I don't see the need for the interface in the
>> non-higher-order case. It could just create a Java method of some
>> class that implements the primitive-ized version o
Joining the congrats, one of the must have tools for any Clojure
project
Ronen
On Dec 14, 8:01 am, Denis Labaye wrote:
> Midje is getting better and better.
>
> Congrats!
>
>
>
>
>
>
>
> On Mon, Dec 12, 2011 at 5:41 PM, Brian Marick wrote:
> > Midje 1.3's most important feature is compatibility
On Thu, Dec 15, 2011 at 7:43 PM, Cedric Greevey wrote:
> In that case, I don't see the need for the interface in the
> non-higher-order case. It could just create a Java method of some
> class that implements the primitive-ized version of the fn, and
>
This is what already happens, every fn is a
On Thu, Dec 15, 2011 at 7:29 PM, David Nolen wrote:
> On Thu, Dec 15, 2011 at 7:14 PM, Cedric Greevey wrote:
>>
>> For helper fns, it's unlikely to be necessary to use the function
>> widely in generic contexts, i.e. in a first-class manner, right?
>
> fns with prim args/return support already do
On Thu, Dec 15, 2011 at 7:14 PM, Cedric Greevey wrote:
> For helper fns, it's unlikely to be necessary to use the function
> widely in generic contexts, i.e. in a first-class manner, right?
>
fns with prim args/return support already do this. When not used higher
order if the compiler can infer
On Thu, Dec 15, 2011 at 6:51 PM, Softaddicts
wrote:
> Hi Cedric,
>
> Your statement " A limitation on primitive arguments simply cannot be
> applicable to a function with no primitive arguments" does not stand
It is true by axiom. Either the limitation is not actually a
limitation "on primitive a
On Thu, Dec 15, 2011 at 6:33 PM, David Nolen wrote:
> On Thu, Dec 15, 2011 at 6:19 PM, Cedric Greevey wrote:
>>
>> I don't see any logical reason why a function taking only
>> non-primitive arguments cannot have a primitive return value.
>
>
> You need a JVM method signature for every n number of
Hi Cedric,
Your statement " A limitation on primitive arguments simply cannot be
applicable to a function with no primitive arguments" does not stand given all
the previous discussions about numeric optimizations and comparing
optimizations found in
other compiler. Look at any C compiler optimiza
On Dec 15, 1:09 pm, Cedric Greevey wrote:
> On Thu, Dec 15, 2011 at 1:54 PM, Alan Malloy wrote:
> > This will print all the debug information at compile time, which is
> > usually not what you want. I have a little macro I use called ?, which
> > looks like:
>
> > (defmacro ? [x]
> > `(let [x# ~
On Thu, Dec 15, 2011 at 6:19 PM, Cedric Greevey wrote:
> I don't see any logical reason why a function taking only
> non-primitive arguments cannot have a primitive return value.
>
You need a JVM method signature for every n number of object arguments +
the supported primitive return type. So mo
On Thu, Dec 15, 2011 at 6:05 PM, David Nolen wrote:
> On Thu, Dec 15, 2011 at 6:01 PM, Cedric Greevey wrote:
>>
>> On Thu, Dec 15, 2011 at 5:59 PM, David Nolen
>> wrote:
>> > On Thu, Dec 15, 2011 at 5:53 PM, Cedric Greevey
>> > wrote:
>> >> #> >> primitives support only 4 or fewer args,
>> >>
>
Hello, I'm interested in this kind of thing too. Do you have any progress?
--
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
On Thu, Dec 15, 2011 at 6:01 PM, Cedric Greevey wrote:
> On Thu, Dec 15, 2011 at 5:59 PM, David Nolen
> wrote:
> > On Thu, Dec 15, 2011 at 5:53 PM, Cedric Greevey
> wrote:
> >> # >> primitives support only 4 or fewer args,
> >>
> >> But the function isn't *taking* primitives. It's only *returni
On Thu, Dec 15, 2011 at 5:59 PM, David Nolen wrote:
> On Thu, Dec 15, 2011 at 5:53 PM, Cedric Greevey wrote:
>> #> primitives support only 4 or fewer args,
>>
>> But the function isn't *taking* primitives. It's only *returning* a
>> primitive, after taking Objects. So it obviously shouldn't produ
And a related bug/quirk: I had had
(defn- remm
"Remainder of a modulo b; unlike (rem a b) result is in [0,b) even if a is
negative."
([a b]
(let [r (rem a b)]
(if (< r 0)
(+ r b)
r
and evaluated
(defn- remm
"Remainder of a modulo b; unlike (rem a b) result
On Thu, Dec 15, 2011 at 5:53 PM, Cedric Greevey wrote:
> (defn dist
> "Shortest distance between x,y and x2,y2 in toroidal space of dimensions
> w,h.
> Input coordinates should be in range (0,0)-(w,h). For instance, will give
> 1.414... if x,y = (0,0) and x2,y2 = (w-1,h-1), as these are diag
(defn dist
"Shortest distance between x,y and x2,y2 in toroidal space of dimensions w,h.
Input coordinates should be in range (0,0)-(w,h). For instance, will give
1.414... if x,y = (0,0) and x2,y2 = (w-1,h-1), as these are diagonally
adjacent."
([x y x2 y2 w h]
(let [x2s [(- x2 w)
>>
>> Is clojurescript ready for wide water?
>
>
> It's getting there.
+1
>
>>
>> How far i can only see obscure compilation env and low level ops on
>> html elemnts.
>
>
> I find the compilation environment is quite nice, if there's something you
> find confusing you should discuss it. I don't t
On Thu, Dec 15, 2011 at 5:11 PM, Michael Jaaka wrote:
> Hi!
>
> Is clojurescript ready for wide water?
>
It's getting there.
> How far i can only see obscure compilation env and low level ops on
> html elemnts.
>
I find the compilation environment is quite nice, if there's something you
find
Hi!
Is clojurescript ready for wide water?
How far i can only see obscure compilation env and low level ops on
html elemnts.
Are there any plans to start building second gwt? Swing 2.0?
Google started darts as general purpose language with web browser's VM
aka javascript.
They want even to repla
Nothing is wrong with do
I just missed the point how the macro works
Thanks!
On 15 Gru, 13:37, Meikel Brandmeyer wrote:
> Hi,
>
> macros can only return one value. So multiple forms have to be wrapped into a
> do.
>
> The do never hurts. Why do you want to get rid of it?
>
> Sincerely
> Meikel
On Thu, Dec 15, 2011 at 2:16 PM, Alan Malloy wrote:
> FWIW, much safer is
>
> (defmacro dc
> [sql-cmd]
> `(sql/with-connection db
> ~sql-cmd))
>
> If you use the version with (list) and plain-quoting of the first two
> items, then the namespace resolution is very fragile: it will only
> work
On Thu, Dec 15, 2011 at 1:54 PM, Alan Malloy wrote:
> This will print all the debug information at compile time, which is
> usually not what you want. I have a little macro I use called ?, which
> looks like:
>
> (defmacro ? [x]
> `(let [x# ~x]
> (prn '~x '~'is x#)
> x#))
>
> You could ad
I have created an output stream, which appears to work fine, however
I get an error when trying to convert the output stream into an input
stream for use in ring:
('use [clojure.java.io :only [input-stream]])
=> (with-out-str (ofn var))
"it works!"
Now when I use ring:
{:body (input-stream (ofn
FWIW, much safer is
(defmacro dc
[sql-cmd]
`(sql/with-connection db
~sql-cmd))
If you use the version with (list) and plain-quoting of the first two
items, then the namespace resolution is very fragile: it will only
work if the caller has referred to the sql library with the prefix
sql/,
Hi,
if you always follow the let structure you outlined the following might work.
Untested, though. Note, that things work recursively with this approach.
(def ours? #{#'button #'label ...})
(defmacro panel
[{:keys [id]} & components]
(let [[bindings body]
(reduce (fn [[bindings bod
This will print all the debug information at compile time, which is
usually not what you want. I have a little macro I use called ?, which
looks like:
(defmacro ? [x]
`(let [x# ~x]
(prn '~x '~'is x#)
x#))
You could add file and line information to this fairly simply:
(defmacro ? [x]
On Wed, Dec 14, 2011 at 11:47 PM, Simone Mosciatti wrote:
> Ok thank you so much, i got it.
>
> Thanks again ;-)
You're welcome.
--
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
On Thu, Dec 15, 2011 at 1:14 PM, Peter Buckley wrote:
> TL;DR I have an extra clojure.core/fn wrapped around the form I want
> returned from my macro. This is my first macro and I'm not sure what's
> wrong, even though the macro "works."
...
> (defmacro dc
> [sql-cmd]
> (list 'sql/with-connect
On Wed, Dec 14, 2011 at 8:21 PM, Baishampayan Ghose wrote:
> Every video has an RSS feed which can be mechanically constructed given the
> URL.
>
> So for http://blip.tv/clojure/rich-hickey-unveils-clojurescript-5399498,
> the RSS feed is at http://blip.tv/rss/flash/5399498
>
> IIRC, the RSS feed
TL;DR I have an extra clojure.core/fn wrapped around the form I want
returned from my macro. This is my first macro and I'm not sure what's
wrong, even though the macro "works."
I'm trying my first attempt at a macro by trying to save myself from
having to type "sql/with-connection db" for every t
in java i would throw an exception and parse its stack trace. don't know
how to do that in clojure, but probably similar
Am 15.12.2011 06:48, schrieb jaime:
> Hello there,
>
> I want to write a function named "debug" which will print out "date-
> time msg + current source-line + etc. info", but I
You'll probably want to google around a bit. I wrote a blog entry at
one point: http://blog.jayfields.com/2011/02/clojure-and.html - but
it's not meant to cover everything in depth.
2011/12/15 jaime :
> Great! that's exactly what I want. Thank you!
> This is the first time I meet "&form", is there
Hi,
you'll probably have to rewrite your panel macro, so that it recognizes the
button (and label, etc) macros ((= #'button (resolve &env sym)) in 1.3) and
extracts the ids from the subform. Then you construct a global let which
contains all the individual id namings. Then you group all '...' p
Great! that's exactly what I want. Thank you!
This is the first time I meet "&form", is there any document about
this 'form' or relevant things?
On 12月15日, 下午9时19分, Jay Fields wrote:
> This should get you started:
>
> (defmacro debug [x]
> (println x)
> (println (pr-str &form))
> (println *
Hi,
to implement letrec in a language with eager evaluation strategy some
kind of mutability is probably needed. Consider for example a self-
referential definition such as
(let [fibo (lazy-cat [1 1] (map + fibo (rest fibo)))]
(take 10 fibo))
This will not work since fibo is not in scope when
'declare' wouldn't be good because of the scope of vars. There's no sense
using global (albeit namespaced) variables for what probably only need to
be local identifiers.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send em
you are mixing up the format for ns. If you want to use an alias for
your library, use require, like this:
(ns examples.core
(:require [clarity.component :as c]))
;; you can call the function/macro make, by using the alias.
(c/make :button "The Button")
but if you don't want to use an alias and
Is 'declare' possibly the missing component here?
On Dec 14, 3:37 pm, Razvan Rotaru wrote:
> Yes. Assuming I have following macros:
>
> (button :id b1 :listener #(...)) => (let [b1 (new JButton)] ...)
> (panel [:id p1] (button :id b1 ...) (button :id b2 ...)) => (let [p1
> (new JPanel) b1 (button
Tassilo Horn writes:
>> I think I understand namespace and then I don't!
>> I try to run this example
>>
>> (ns examples.core
>> (use [clarity.component :as c]))
>
> The syntax of ns is
>
> (ns examples.core
> (:use [clarity.component :as c]))
>
> Notice the colon preceeding the "use."
O
You can just say:
(ns examples.core
(:use clarity.component))
This will intern all the symbols in the clarity.component namespace
into examples.core, so you can use them as if they were defined in
examples.core in the first place: (make :button "the button")
This has the disadvantage of potent
This should get you started:
(defmacro debug [x]
(println x)
(println (pr-str &form))
(println *file*)
(println (meta &form)))
On Thu, Dec 15, 2011 at 12:48 AM, jaime wrote:
> Hello there,
>
> I want to write a function named "debug" which will print out "date-
> time msg + current sourc
Hi,
macros can only return one value. So multiple forms have to be wrapped into a
do.
The do never hurts. Why do you want to get rid of it?
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to cloju
Hi!
I have something like this:
(defmacro testme[ & ops ]
`(do ~@(for[ op ops ]
`(println ~op
(macroexpand '(testme 1 2 3))
(testme 1 2 3)
How can I change the macro so "do" wouldn't be required?
When I do doseq instead of for the resulting value is nill.
(defmacr
Thanks.
On Dec 14, 8:30 pm, Alan Malloy wrote:
> Correct, just like closures and reifies.
>
> On Dec 14, 7:33 am, Tom Faulhaber wrote:
>
>
>
>
>
>
>
> > Razvan,
>
> > I believe that proxy actually only creates a new class per call site,
> > not per instance. However, I can't completely swear to
Hello, Jay,
Your email is not precise enough. What did you place in which files,
how were the files named, how were they stored relatively to some
"root" folder, and how did you start a REPL ?
2011/12/13 jayvandal :
> I think I understand namespace and then I don't!
> I try to run this example
>
64 matches
Mail list logo