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 tr
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 m
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, so
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, s
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 fr
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 25, 1:17 pm, Meikel Brandmeyer 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 it up-fro
On Dec 25, 12:01 pm, Alan Malloy 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 override"? Prob
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 [~'thi
Hi,
Is it possible to give the class as value at runtime to proxy?
(defn create-proxy [clazz]
(proxy [clazz] ))
I know this can be done with a macro, but my question is whether it
can be done as function.
Thanks,
Razvan
--
You received this message because you are subscribed to the G
On Dec 23, 5:08 am, Alan Malloy 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 with a differe
On Dec 14, 5:33 pm, 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 this.
>
> Anyone with more detailed knowledge than I have want to comment?
>
> Assuming I'm right,, you should be fi
kind of sequence, it does the splicing that I want.
Razvan
On Dec 17, 6:32 pm, Razvan Rotaru wrote:
> Great. Thanks.
>
> On Dec 17, 6:08 pm, Baishampayan Ghose wrote:
>
>
>
>
>
>
>
> > > This may sound a bit weird, but can I "unquote-splice" so
Great. Thanks.
On Dec 17, 6:08 pm, Baishampayan Ghose 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 "text/javascrip
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-h
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,, you should be fine to have lots of instances.
>
> > HTH,
>
> > Tom
>
> > On Dec 13, 1
an
On Dec 14, 11:09 pm, David Nolen 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 wrote:
>
>
>
>
>
>
>
> > letfn defines functions. I'm just defining some values. The values
> &g
2:53 PM, Razvan Rotaru wrote:
>
> > 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
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 wrote:
> lazy-seq and letfn should cover anything you would need letrec for
>
>
>
>
>
>
>
>
>
> On Wed, Dec 14, 2011 at 11:09 AM, Razv
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
Thanks. I don't know how this hashmap works, but at the first glance
there seems to be one problem: the two values don't get garbage
collected at the same time. I'll look more into it, thanks.
On Dec 13, 3:10 am, Stephen Compall wrote:
> On Mon, 2011-12-12 at 10:54 -0800, R
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 wrote:
> On 12 December 2011 18:54, Razvan Rotaru wrote:
>
>
/clojure/blob/1f11ca3ef9cd0585abfbe4a9e7609...
>
> The rest of that module 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 wrote:
>
>
>
>
>
>
>
&g
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 possibl
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 wrote:
> Not sure if it helps, but here's my example of using reflection in a macro:
>
> http://stuartsierra.com/2010/12/16/single-abstract-method-macro
>
> -S
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 java.lang.Illega
gt; Scheme style macros in Clojure:https://github.com/qbg/syntax-rules
>
> Scott
>
> On Sat, Dec 3, 2011 at 1:20 PM, Razvan Rotaru wrote:
>
>
>
>
>
>
>
> > Hi everyone,
>
> > I was searching the web these days trying to find out more about these
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 side,
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
you have integrated it with
> appengine-magic?
>
> - Mark
>
>
>
>
>
>
>
> On Sun, Nov 6, 2011 at 11:41 AM, Razvan Rotaru
> wrote:
> > I want integration of servlet in appengine-magic.
>
> > Documentation describes that you use a ring handler t
isting Java servlet 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 wrote:
> > Hi,
>
> > appengine-magic (https://github.com/gcv/appen
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://
dev.cloju
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
--
Y
Yeah, you are probably right. But I figured asking never hurts...
Thanks for the reply.
Razvan
On Oct 19, 10:50 pm, Alan Malloy 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) `(foo bar ,a1 ,a2)
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
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
cha
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")
(stu
manufacturer "Mercedes"})]
> ...)
>
> or if you must
>
> (let [foo #user.car{:year 1982 :manufacturer "Mercedes"}]
> ...)
>
> Cheers,
>
> Aaron Bedra
> --
> 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 manufacturer])
I want to do (new stuff 1982 "Mercedes"), but having the record type
kept in the variable "
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 hav
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
f
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
No
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->[ /appengine/d
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 clojure@googlegroups
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. 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 post
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 .
48 matches
Mail list logo