Hi,
I read that deftype is often a better replacement for gen-class and
defstruct. Indeed, it would fit for my purposes very well, except the
following problem: deftype does not (yet?) use all the information
from type hints.
Simple example:
(:gen-class
:methods [[getText [] String]] ...
comp
> as I said, structs are an optimization on maps, that optimization
> doesn't work for empty structs, so empty structs "of course" don't
> make sense
For me structs are more than just optimizations. They add documentary
information to the map, which is a great feature for readability.
Optimization
> I think your use of "workaround" is pejorative. And can it even be
> called a work around if it is a best practice even when there is
> nothing to work around?
I just can't understand why throwing an exception should be more
useful than returning some object you can actually work with.
I wouldn'
> Just another option to consider:
> {:type :person, :name "Bill", :age 20}
Why then use defstruct at all? I think defstruct is useful, but it
would be even
more useful if I had nothing to fear if it "runs empty" sometime
because of
little design changes. It might be only experimental and later I
> how is that not an argument? I'm pretty sure I just used it as one.
What I wanted to say is that you are completely right, if you say that
it is easy to create a workaround.
But although doing this is easy, this does not mean that we should not
fix this inconsistency (or do you see none?) anyway
> > And documentary style is lost. Would be ok though, but not optimal.
>
> On the contrary, I think
>
> {:name "Bill" :age 23 :friends 20}
>
> is better than
>
> (struct-map person "Bill" 23 20)
Please review the definition of struct-map...
Actually we seem to have the same opinion! Even be
> I fail to see how it requires changing a lot of code. it just means
> you need to change the place where you create your maps. which if you
> are also type tagging them is a lot of repetitive code, so it should
> already be factored out into a function, so then you just switch out
> one function.
> I think Andreas's point is that there's a discontinuity:
>
> 0 required keys: map
> 1 required key: struct-map
> 2 required keys: struct-map
> ...
That's exactly the point! If I change only a little detail in my
program, this can have impact on a huge part of my program.
I can not see any reaso
On 20 Jan., 00:56, Kevin Downey wrote:
> clojure structs are an optimized version of maps for a set of shared
> keys. if you don't have a defined set of shared keys you just have a
> map. so by all means, use a map
You're talking about the implementation in the background, but I am
talking about
Hi,
I would like to know why defstruct without providing any keys (like
"(defstruct s)") is not allowed (exception: "Must supply keys").
Let me shortly describe why I think that this would be useful: Imagine
you have a defstruct like in Rich's Ants demo:
(defstruct cell :food :pher) ;may also ha
Im running counterclockwise too, without this problem.
I'm sure the people at the counterclockwise users group can help you,
since this here is a more general Clojure discussion group.
http://groups.google.com/group/clojuredev-users
--
You received this message because you are subscribed to the
Hi,
for seminar talk at my university I have to prepare a demo program
showing Clojure's concurrency features. I stumbled upon the ants demo
presented in Rich Hickey's "Clojure Concurrency" talk (
http://blip.tv/file/812787
) which I like very much. I began to port the program to Java to
demonstr
In the last paragraph, I mean:
But perhaps it is at least possible to distinguish between "guaranteed
side-effect FREE functions" (if we ignore the "binding" macro which
can
destroy this, as far as I understand) and "possible side-effect
containing functions"?
--~--~-~--~~
In January, there was a discussion about automatic parallelization
( http://groups.google.com/group/clojure/browse_thread/thread/a053fac1235d3820/
- Google doesn't allow me to continue this thread, so I have to open a
new one).
I'm interested if anybody has made some progress in this topic?
The
At the Technische Universität München (Germany), I know of two courses
where Clojure was at least mentioned.
This year there was an "advanced Java" seminar with one talk about
Clojure ( http://www2.in.tum.de/hp/Main?nid=59 ).
Next year there is a "programming models and code generation" seminar
w
*push*
Can please anybody verify this bug? Should take only 3 minutes or so.
--~--~-~--~~~---~--~~
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
When writing an applet with Clojure I discovered the following bug:
Whenever a class with a -main function is loaded (e.g. by :use), the
applet is broken (Java 6 with new plugin technology):
java.lang.NullPointerException
at sun.plugin2.applet.Plugin2Manager.findAppletJDKLevel
(Plugin2Mana
Hi Jon,
"Applet net.n01se.Tree" ist just an example I found on the web. My new
demo code can be found here:
http://www.xenoage.com/extern/clojurebook/applet2/cljapp.html
But as already said, Java 5 doesn't like it (see error message two
posts above) and tells me that the bytecode generated by the
However, compatibility with Java 5 is lost again.
Java 5 plugin shows the following error message when loading the
applet (even when Clojure compiler was started with Java 5, but I
guess, this does not matter anyway):
Java Plug-in 1.5.0_19
Verwendung der JRE-Version 1.5.0_19 Java HotSpot(TM) Clie
Fantastic news:
- Clojure applets do not have to be signed, when reflection can be
avoided (by type hints and so on)
- Java code is indeed not needed (thanks @ rob)
I've updated the tutorial accordingly.
Here is another Clojure applet which works without Java code and
without signing: http://cho
> You might want to try clojure-slim.jar, which gets built
> alongside clojure.jar, and is about 500KB.
Good idea, thanks. I'll add it.
Another idea:
Since the applet itself needs not to be signed, it would be great if
there is an "official" precompiled clojure.jar which is certified from
a ce
21 matches
Mail list logo