> user=> (defstruct s1 :a :b)
> #'user/s1
> user=> (s1 1 2)
(struct s1 1 2) or (struct-map s1 :a 1 :b 2)
--> {:a 1, :b 2}
or:
(struct s1 1)
--> {:a 1, :b nil}
(struct-map s1 :b 2)
--> {:a nil, :b 2}
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
That's not how you create a new struct instance.
http://clojure.org/data_structures#toc19
On Nov 23, 6:29 am, cearl wrote:
> Hi,
> I'm getting a cast exception on trying to create a simple structure
> and wondered if there was something obvious that I'm not doing. The
> transcript below shows
Hi,
I'm getting a cast exception on trying to create a simple structure
and wondered if there was something obvious that I'm not doing. The
transcript below shows my version of java. Running on Mac Book Pro,
Snow Leopard 5.6.1
bash-3.2$ java -version
java version "1.6.0_15"
Java(TM) SE Runtime En