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 s...@ida.net:
I think I understand namespace and then I don't!
I try to run this
Thanks.
On Dec 14, 8:30 pm, Alan Malloy a...@malloys.org wrote:
Correct, just like closures and reifies.
On Dec 14, 7:33 am, Tom Faulhaber tomfaulha...@gmail.com wrote:
Razvan,
I believe that proxy actually only creates a new class per call site,
not per instance. However, I
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.
(defmacro
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
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 xiejianm...@gmail.com wrote:
Hello there,
I want to write a function named debug which will print out date-
time msg +
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
Tassilo Horn tass...@member.fsf.org 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
Is 'declare' possibly the missing component here?
On Dec 14, 3:37 pm, Razvan Rotaru razvan.rot...@gmail.com 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
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
'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
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
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 j...@jayfields.com wrote:
This should get you started:
(defmacro debug [x]
(println x)
(println (pr-str form))
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 '...'
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 xiejianm...@gmail.com:
Great! that's exactly what I want. Thank you!
This is the first time I
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 don't
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 time
On Wed, Dec 14, 2011 at 8:21 PM, Baishampayan Ghose b.gh...@gmail.com 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,
On Thu, Dec 15, 2011 at 1:14 PM, Peter Buckley buckmeist...@gmail.com 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
On Wed, Dec 14, 2011 at 11:47 PM, Simone Mosciatti mweb@gmail.com 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
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]
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
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
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
On Thu, Dec 15, 2011 at 1:54 PM, Alan Malloy a...@malloys.org 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
On Thu, Dec 15, 2011 at 2:16 PM, Alan Malloy a...@malloys.org 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
Nothing is wrong with do
I just missed the point how the macro works
Thanks!
On 15 Gru, 13:37, Meikel Brandmeyer m...@kotka.de 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
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
On Thu, Dec 15, 2011 at 5:11 PM, Michael Jaaka michael.ja...@googlemail.com
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
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 think that
(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)
On Thu, Dec 15, 2011 at 5:53 PM, Cedric Greevey cgree...@gmail.com 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
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 is
On Thu, Dec 15, 2011 at 5:59 PM, David Nolen dnolen.li...@gmail.com wrote:
On Thu, Dec 15, 2011 at 5:53 PM, Cedric Greevey cgree...@gmail.com wrote:
#CompilerException java.lang.IllegalArgumentException: fns taking
primitives support only 4 or fewer args,
But the function isn't *taking*
On Thu, Dec 15, 2011 at 6:01 PM, Cedric Greevey cgree...@gmail.com wrote:
On Thu, Dec 15, 2011 at 5:59 PM, David Nolen dnolen.li...@gmail.com
wrote:
On Thu, Dec 15, 2011 at 5:53 PM, Cedric Greevey cgree...@gmail.com
wrote:
#CompilerException java.lang.IllegalArgumentException: fns taking
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:05 PM, David Nolen dnolen.li...@gmail.com wrote:
On Thu, Dec 15, 2011 at 6:01 PM, Cedric Greevey cgree...@gmail.com wrote:
On Thu, Dec 15, 2011 at 5:59 PM, David Nolen dnolen.li...@gmail.com
wrote:
On Thu, Dec 15, 2011 at 5:53 PM, Cedric Greevey cgree...@gmail.com
On Thu, Dec 15, 2011 at 6:19 PM, Cedric Greevey cgree...@gmail.com 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
On Dec 15, 1:09 pm, Cedric Greevey cgree...@gmail.com wrote:
On Thu, Dec 15, 2011 at 1:54 PM, Alan Malloy a...@malloys.org 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:
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
On Thu, Dec 15, 2011 at 6:33 PM, David Nolen dnolen.li...@gmail.com wrote:
On Thu, Dec 15, 2011 at 6:19 PM, Cedric Greevey cgree...@gmail.com 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
On Thu, Dec 15, 2011 at 6:51 PM, Softaddicts
lprefonta...@softaddicts.ca 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
On Thu, Dec 15, 2011 at 7:14 PM, Cedric Greevey cgree...@gmail.com 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
On Thu, Dec 15, 2011 at 7:29 PM, David Nolen dnolen.li...@gmail.com wrote:
On Thu, Dec 15, 2011 at 7:14 PM, Cedric Greevey cgree...@gmail.com 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
On Thu, Dec 15, 2011 at 7:43 PM, Cedric Greevey cgree...@gmail.com 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
Joining the congrats, one of the must have tools for any Clojure
project
Ronen
On Dec 14, 8:01 am, Denis Labaye denis.lab...@gmail.com wrote:
Midje is getting better and better.
Congrats!
On Mon, Dec 12, 2011 at 5:41 PM, Brian Marick mar...@exampler.com wrote:
Midje 1.3's most
On Thu, Dec 15, 2011 at 7:48 PM, David Nolen dnolen.li...@gmail.com wrote:
On Thu, Dec 15, 2011 at 7:43 PM, Cedric Greevey cgree...@gmail.com 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
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 8:05 PM, Softaddicts
lprefonta...@softaddicts.ca 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
It's not silly, it's the fastest way to dispatch fn calls...
On Thu, Dec 15, 2011 at 8:05 PM, Softaddicts
lprefonta...@softaddicts.ca 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
On Thu, Dec 15, 2011 at 8:32 PM, Softaddicts
lprefonta...@softaddicts.ca 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
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
On Thu, Dec 15, 2011 at 8:47 PM, Softaddicts
lprefonta...@softaddicts.ca 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
On Thu, Dec 15, 2011 at 8:16 PM, Cedric Greevey cgree...@gmail.com 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 ... }
...
On Thu, Dec 15, 2011 at 8:56 PM, David Nolen dnolen.li...@gmail.com wrote:
On Thu, Dec 15, 2011 at 8:16 PM, Cedric Greevey cgree...@gmail.com wrote:
public class MangledName implements IFn {
public Object invoke () { // unoptimized zero-arg version or arity
throw goes here }
public
On Thu, Dec 15, 2011 at 9:23 PM, Cedric Greevey cgree...@gmail.com wrote:
On Thu, Dec 15, 2011 at 8:56 PM, David Nolen dnolen.li...@gmail.com
wrote:
On Thu, Dec 15, 2011 at 8:16 PM, Cedric Greevey cgree...@gmail.com
wrote:
public class MangledName implements IFn {
public Object
On Thu, Dec 15, 2011 at 9:31 PM, David Nolen dnolen.li...@gmail.com wrote:
On Thu, Dec 15, 2011 at 9:23 PM, Cedric Greevey cgree...@gmail.com wrote:
There is no possibility of high performance higher order usage,
because primitives are boxed inside of collections. Unless you
proliferate
On Thu, Dec 15, 2011 at 9:47 PM, Cedric Greevey cgree...@gmail.com 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
On Thu, Dec 15, 2011 at 10:13 PM, David Nolen dnolen.li...@gmail.com 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
On Thu, Dec 15, 2011 at 11:03 PM, Cedric Greevey cgree...@gmail.com 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
On Dec 15, 10:03 pm, Cedric Greevey cgree...@gmail.com 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,
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
It means to use the server version of JVM
On Dec 15, 2011, at 11:48 PM, jayvandal s...@ida.net 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
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
On Fri, Dec 16, 2011 at 05:48, jayvandal s...@ida.net 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
64 matches
Mail list logo