I was developing this project of mine, which has an intricate business
logic, and I wrote a macro that makes programming this kind of stuff
more comfortable. It's called "ilet", which stands for "implicit let".
The name is probably no longer appropriate, since I added more
features to it, but I can
Thank you for your insights.
You guys seem to think I'm doing something wrong, and you may be
right.
I'll see if I can come up with an alternative solution.
Damn bone-head of mine.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group
I'm writing a macro that defines a symbol through let, but I also
needs to unbind (unlet?) it, so that further uses of that symbol throw
an exception.
I hoped I could use symbol-macrolet, but local symbols are protected
from expansion
Thanks!
--
You received this message because you are subscri
> It looks like you're trying to group together different functionality
> in one place. Idiomatic Clojure tends to encourage separating
> functionality out into independent components.
Thanks for the tip. My system doesn't provide validation, it just
differentiates between "nil" and "undefined but
Hi clojure developers!
I recently wrote an alternative datatype system for a project of mine,
because requirements were a little odd and I couldn't find anything
appropriate.
My questions are:
1) Was this necessary at all? Can my requirements be fulfilled with
off-the-shelf clojure libraries or c
I digged a little and I have a patch. I modified the case* parser in
Compiler.java, so the patch shouldn't affect anything else: I prefer
keeping safe since my knowledge of Clojure internals is limited, but a
more radical solution might be desirable.
The problem seems caused by the way case* gets
I found a workaround:
(use 'clojure.contrib.macro-utils)
(defsymbolmacro one 1)
(defn bug1 []
(with-symbol-macros
(bug2)))
(defn bug2
(case 0
0 one)))
The "one" symbol macro is there just to show that everything works as
expected.
--
You received this message because you are sub
I wrote a test case:
(use 'clojure.contrib.macro-utils)
(defn bug? []
(with-symbol-macros
(case 0
0 1)))
The REPL prints:
java.lang.ClassCastException: clojure.lang.PersistentVector cannot be
cast to clojure.lang.MapEntry (NO_SOURCE_FILE:4)
Can anyone confirm this, please?
--
You
Yes, Kent's solution is spot on! Thank you all for your insights, I
believe we have a winner.
--
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
Hi Btsai, thank you for your offer for help.
As I said before I *could* use literals but it wouldn't be convenient.
I have a big structure which contains information about "types" (they
are types of domain-specific objects). I would like to extract the
"methods" I need from this structure and defi
You are mostly right in your assumptions: I could dump the keywords in
the clj as literals but it would be tedious and not elegant at all.
Eval's not pretty but it works; plus it's there for a reason, like
working around the shortcomings of the language (and of my brain).
I was about to post my so
Yes, I think I'll have to pass the keywords as literals. I don't think
there's a way around that (other than using eval, as per Alan's
solution).
I was too excited about Hubert's hint and I found myself in the exact
same problem with the second macro.
--
You received this message because you are
I agree: eval never looks pretty.
--
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
Yeah, I guess I could use a macro to generate the "call" to the other
macro in a way similar to how you used it. Thank you, that should
definitely work. I'll try it right now.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send
Alan, thank you for your reply.
Unfortunately your solution is very similar to mine and it suffers
from the same problem (maybe I'm using it incorrectly, I don't know).
If I write:
(doseq [x '(:a :b)]
(make-fn x))
it defines a single function "synthetic-x". Is there a way to make
this work?
Hi, I'm developing a small DSL with Clojure and I need to define many
similar functions. I'd like to do that programmatically, of course.
My solution (involving a simple macro) doesn't work, so I won't bother
you with it. I'll post it if anyone asks.
Basically what I need is: given a list of keyw
I wrote a Kate script to make lisp development on Kate a little more
pleasant.
It was written primarily with Clojure in mind, so it should work best
with this language, but it's pretty generic.
If you use Kate, please try it and feel free to add a comment to the
kde bug report (see below).
You c
@Christophe: thanks, your hint helped.
@B Smith-Mannschott:
> Questions about how best to optimize clojure code to approach java
> performance have come up with fair regularity in the past. You might
> find some good ideas if you search through the archives a bit.
I see.
As I said before (OP),
Nicholas,
thank you for your reply. I applied the change you suggested.
Unfortunately it skimmed only about 50ms from each exectuion.
Even though I'm using aset, java.lang.reflect.Array.setByte *still*
uses ~25% of execution time. This means two things: A) Reflection is
still used for this code.
Hello!
First of all, let me congratulate with the devs for their great work:
I've been using Clojure for just a couple of weeks and I had a lot of
fun learning it and experimenting with it.
I'm starting a concurrency-heavy project and I feel Clojure is gonna
be a great choice!
I'm thinking about
On Aug 25, 5:51 pm, tmountain wrote:
> Clojure 1.1.0-alpha-SNAPSHOT
Maybe it was a bug and they fixed it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@
Hey, this works! Thanks!!
I was wondering... why doesn't casting work? i.e.
(.open (cast SourceDataLine sdl) fmt (* 48000 2 2))
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, s
On Aug 25, 4:50 pm, tmountain wrote:
> I'm pretty sure your issue is that format is a function inside
> clojure.core, so it's causing a conflict. I renamed it, and the code
> seems to work on my machine.
Using another name, unfortunately, doesn't fix the problem here. But
the fact the my program
Hi,
I've been struggling with this problem for some time and I don't
understand why this doesn't work. I'm trying to call the "open" method
of a javax.sound.sampled class but it throws the following exception:
No matching method found: open for class
com.sun.media.sound.DirectAudioDevice$Direc
24 matches
Mail list logo