0

Is struct or create-struct deprecated?. I´ve read here that I should use defrecord instead: https://clojuredocs.org/clojure.core/struct

Thanks R.

ibercode
  • 1,264
  • 3
  • 17
  • 29
  • 2
    This doesn’t seem like a useful question and answer. If you’re just interested in whether `struct` etc. are deprecated in Clojure, anyone can answer that by looking at the documentation. More informative answers https://stackoverflow.com/a/23148768 and https://stackoverflow.com/a/4576143 – glts Oct 14 '17 at 19:41

2 Answers2

2

According to "Why have both deftype and defrecord?", ...

Overall, records will be better than structmaps for all information-bearing purposes, and you should move such structmaps to defrecord. It is unlikely much code was trying to use structmaps for programming constructs, but if so, you will find deftype much more suitable.

Thumbnail
  • 13,293
  • 2
  • 29
  • 37
  • [Alex Miller's thorough answer](https://stackoverflow.com/a/4576143), referred to in a comment on the question, is much better than this. It starts *I consider structs to be effectively deprecated so I don't use them at all*. – Thumbnail Oct 20 '17 at 18:21
0

According to the Clojure v1.8 API documenatation the struct and create-struct are not deprecated.

ibercode
  • 1,264
  • 3
  • 17
  • 29