Hi,
I'm curious, why doesn't toString of clojure.lang.LazySeq return the entire
sequence as a String, and returns the Java pointer instead? I find it
annoying when I do this:
user (str (map + [1 2 3]))
clojure.lang.LazySeq@7861
What's the reason behind this decision? Shouldn't toString
Thanks,
This works, but there's a problem: the labeledtextfield is not a
textfield anymore, it's a label. Therefore it does not behave like a
textfield (which implements other protocols as well). I need multiple
inheritance, in one way or another. I've been trying to find a way to
implement with
Hi,
I found some posts about this topic, but they did not clarify things
in my head well enough, so I have to start my own... :)
I'm basically craving for multiple inheritance or mixins, at least
with my current way of thinking. I haven't really gone deep enough
with multimethods or protocols,
Hi,
What's the clojure way to filter out null values from a sequence?
I have following code:
(filter identity (map myfun myseq))
Is there a better/faster way?
Thanks,
Razvan
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group,
Yes, it's more clear now. 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 your
first post.
To unsubscribe
Hi,
Consider following code:
(defprotocol WithOptions
(getOptions [this] All options)
(getOption [this option] One option))
(defn- gen-proxy [klass opts]
`(proxy [~klass WithOptions] []
(getOptions [~'_] ~opts)
(getOption [~'this
On Dec 25, 12:01 pm, Alan Malloy a...@malloys.org wrote:
Presumably you just tried it and found it doesn't work, so I'm not
sure what more you're looking for here. How would you even fill in the
body of the proxy? I don't know what class this is, but I know
exactly what methods I need to
On Dec 25, 1:17 pm, Meikel Brandmeyer m...@kotka.de wrote:
Hi,
Wiring to classes happens in the bytecode and hence have to be known at
compile time. You either have to use eval or refrain from doing things at
runtime. Is the class transferred into your program at runtime without
knowing
Thanks. Razvan
--
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
On Dec 23, 5:08 am, Alan Malloy a...@malloys.org wrote:
It turns out even this is not true, becauseproxyuses some kind of
deep JVM magic called (appropriately)ProxyClasses. So every time you
write (proxy[Object] (...anything at all...)), you get an instance of
the same class, initialized
On Dec 14, 5:33 pm, 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 can't completely swear to this.
Anyone with more detailed knowledge than I have want to comment?
Assuming I'm right,,
Hi,
This may sound a bit weird, but can I unquote-splice something when
calling a macro. Here's an attempt to do this with hiccup:
(defn get-header
[[:link {:type text/css ...}]
[:script {:type text/javascript ...}]])
(html [:head (get-header) ...] [:body ...])
The result of get-header
Great. Thanks.
On Dec 17, 6:08 pm, Baishampayan Ghose b.gh...@gmail.com wrote:
This may sound a bit weird, but can I unquote-splice something when
calling a macro. Here's an attempt to do this with hiccup:
(defn get-header
[[:link {:type text/css ...}]
[:script {:type
, it does the splicing that I want.
Razvan
On Dec 17, 6:32 pm, Razvan Rotaru razvan.rot...@gmail.com wrote:
Great. Thanks.
On Dec 17, 6:08 pm, Baishampayan Ghose b.gh...@gmail.com wrote:
This may sound a bit weird, but can I unquote-splice something when
calling a macro. Here's an attempt
can't completely swear to this.
Anyone with more detailed knowledge than I have want to comment?
Assuming I'm right,, you should be fine to have lots of instances.
HTH,
Tom
On Dec 13, 10:47 am, Razvan Rotaru razvan.rot...@gmail.com wrote:
Thanks Tom. Using proxy like this could work
Hi,
Is there a reliable implementation of letrec in clojure? Anybody using
it?
I have found a post from 2008, with an implementation which I don't
understand (and it's said to be slow), and which I don't know whether
to trust.(It's also supposed to be slow).
Thanks,
Razvan
--
You received this
I don't quite understand why people are saying this. Anyway, It's not
enough for me.
On Dec 14, 9:13 pm, Kevin Downey redc...@gmail.com wrote:
lazy-seq and letfn should cover anything you would need letrec for
On Wed, Dec 14, 2011 at 11:09 AM, Razvan Rotaru razvan.rot...@gmail.com
14, 2011 at 2:53 PM, Razvan Rotaru razvan.rot...@gmail.comwrote:
I don't quite understand why people are saying this. Anyway, It's not
enough for me.
What can't you solve your problem with what was suggested?
David
--
You received this message because you are subscribed to the Google
14, 11:09 pm, David Nolen dnolen.li...@gmail.com wrote:
Do you have a minimal example of what you are trying to do?
On Wed, Dec 14, 2011 at 3:53 PM, Razvan Rotaru razvan.rot...@gmail.comwrote:
letfn defines functions. I'm just defining some values. The values
contain anonymous
is an abomination that was written when I was
still under the influence of CLOS O-O.
Hope that helps,
Tom
On Dec 12, 5:10 pm, Stephen Compall stephen.comp...@gmail.com wrote:
On Mon, 2011-12-12 at 10:54 -0800, Razvan Rotaru wrote:
- function returns a value which is a java instance
I don't want to change the interface i'm exposing to the outer world.
May be that I'm thinking too javaish, but what I miss here is a
possibility to extend the base class. :)
On Dec 12, 9:31 pm, James Reeves jree...@weavejester.com wrote:
On 12 December 2011 18:54, Razvan Rotaru razvan.rot
, Razvan Rotaru wrote:
- function returns a value which is a java instance (not possible to
change here, or at least not from what I see - it needs to be a java
instance)
- i need to be able to call some function which gets some values that
are not part of the java class
You should
Hi,
I read that there's no such thing as lisp-like multiple values return
in clojure. We can use vectors, and the destructuring feature helps
also.
However, for what I'm trying to do I need to emulate somehow the
following behavior:
- function returns a value which is a java instance (not
Thanks. I was missing the call to resolve.
(let [klass (resolve c)]
)
With it it works.
Razvan
On Dec 8, 11:39 pm, Stuart Sierra the.stuart.sie...@gmail.com wrote:
Not sure if it helps, but here's my example of using reflection in a macro:
Hi,
I'm trying to write some macros for java object instanciation. Here's
the code:
(defn- gen-object-method [my-class id option value]
(let [method (some (java-methods option) (map #(.getName %)
(.getMethods my-class)))]
(when (not method)
(throw (new
Hi everyone,
I was searching the web these days trying to find out more about these
two macro systems and understand their differences, and why one is
preferable over the other (or not). I'd like to share with you some
ideas, and hopefully get some opinions back as well. Coming from the
lisp
:
Scheme style macros in Clojure:https://github.com/qbg/syntax-rules
Scott
On Sat, Dec 3, 2011 at 1:20 PM, Razvan Rotaru razvan.rot...@gmail.comwrote:
Hi everyone,
I was searching the web these days trying to find out more about these
two macro systems and understand their differences
Hi,
This may be a question without hope, but I'm thinking that asking
never hurts. So here goes:
The closest thing to keyword arguments that I have found is
destructuring with a map:
(defn myfun [ {:keys [arg1 arg2 arg3]
:or {arg1 default-value} :as args}]
...)
When I
Yes, I tried that but did not work. appengine-magic/serve expects an
appengine-application, which is a map that among others contains the
ring handler. The serve function turns this handler into a servlet and
maps it to the root path / (or /*, I haven't figured that out
yet). Whatever i write in
Hi,
appengine-magic (https://github.com/gcv/appengine-magic) uses ring-
handlers to turn into servlets that are accepted by GAE. Does anybody
know how to use servlets directly with appengine-magic? I'm not using
ring, I have a servlet which I need to feed to appengine-magic.
Thanks,
Razvan
--
I remember having the same frustrations some time ago. Not that they
are gone now. :)
It obviously depends on the tool, and these code analysis you describe
you get only in IDEs. I don't know what tool you are using now, but
you have them all described in the Getting Started page (http://
that you want to handle some url
pattern, and you want to integrate that into your appengine-magic app?
On Sun, Nov 6, 2011 at 5:08 AM, Razvan Rotaru razvan.rot...@gmail.com wrote:
Hi,
appengine-magic (https://github.com/gcv/appengine-magic) uses ring-
handlers to turn into servlets
integrated it with
appengine-magic?
- Mark
On Sun, Nov 6, 2011 at 11:41 AM, Razvan Rotaru razvan.rot...@gmail.com
wrote:
I want integration of servlet in appengine-magic.
Documentation describes that you use a ring handler to call def-
appengine-app:
(appengine-magic.core/def
Yeah, you are probably right. But I figured asking never hurts...
Thanks for the reply.
Razvan
On Oct 19, 10:50 pm, Alan Malloy a...@malloys.org wrote:
Not really. In _Let Over Lambda_'s section on reader macros, he
creates a reader macro #`(foo bar a1 a2) that expands to (lambda (a1
a2)
Thanks for your suggestion. I finally decided to find a way around the
problem. :) This is cutting too deep for me to handle with my current
clojure knowledge.
I also talked to Constantine Vetoshev (the author of appengine-magic)
and he anknowledged it as an issue which could have a solution by
Hi,
I'm just wondering is there a nicer way to write this:
(defmacro my-macro [ body]
(map (fn[x] `(my-fun ~x)) body))
I'd like to use the anonymous function literall #(), but this won't
work:
(defmacro my-macro [ body]
(map #(`(my-fun ~%)) body))
So if you have some suggestion, I'd
Hi,
I want to instantiate a record, but having the record type as value at
runtime.
Example:
(defrecord car [year manufacturere])
(defrecord bike [year manufacturere])
(defrecord boat [year manufacturer])
I want to do (new stuff 1982 Mercedes), but having the record type
kept in the variable
--
Clojure/corehttp://clojure.com
On 10/06/2011 01:27 PM, Razvan Rotaru wrote:
Hi,
I want to instantiate a record, but having the record type as value at
runtime.
Example:
(defrecord car [year manufacturere])
(defrecord bike [year manufacturere])
(defrecord boat [year
This is what I'm looking for. Thanks. I have not seen this kind of
expression before: -foo. Is is created by defrecord or is it
implemented at reader level?
I realize now that I can also keep a generating function in the
variable stuff:
(let [stuff #(car. %1 %2)]
(stuff 1982 Mercedes)
(stuff
Ok, so I'm stuck. If any of you more seasoned clojurians have a hint
that could get me out, I will be forever gratefull to him/her:
I'm trying execute a query against google app engine datastore, using
appengine-magic, with the filter dynamically generated from a map.
Here's the closest code I
Hi,
Is there a way to attach metadata to defrecord ?
Razvan
--
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
Hi,
Assuming I have:
(defrecord myrecord [:a :b :c])
is there a way to get the list of keys from the record definition?
Thanks,
Razvan
--
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
Hi,
I'm trying to use r0man / appengine-clj, and when :use-ing the
datastore namespace I get a cyclic load dependency. Doesn't clojure
allow such cyclic references?
(use 'appengine.datastore)
Cyclic load dependency: [ /appengine/datastore/entities ]-/appengine/
datastore/query-[
Thanks. But still I don't get something. Shouldn't partition return a
sequence? Shouldn't every sequence end with nil?
Razvan
--
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
You may also want to have a look at slimv.
http://www.vim.org/scripts/script.php?script_id=2531
It performs quite nice (can't compare it with vimclojure though,
'cause I don't know vimclojure).
Razvan
--
You received this message because you are subscribed to the Google
Groups Clojure group.
Thanks for the hint. And don't worry about the meaning of this
function. :) Name parameter has no use. And the regex stuff's for the
url.
Razvan
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
Hi,
Not sure if this is a novice thing or a real bug. Here's what I
encountered: I'm calling a Java method which returns a String[], which
I then pass to partition to get a list of lists (I know, sequence, but
list is a shorter word). What happens then, is I loop over my list of
lists with (loop
47 matches
Mail list logo