deftype
What's a good toString method for a deftype'd object in clojure
(deftype Bag [state] Object (toString [bag] (str \"Bag???\" state))) I want the toString to look something like[详细]
2023-01-15 22:35 分类:问答Using Clojure deftype as a parameterized function
I am trying to use clojure in a compiler and thus need to parameterize calls to deftype; however, I am having difficulty making the type hints carry through.Consider the following code:[详细]
2023-01-09 00:20 分类:问答Overriding equals, hashCode and toString in a Clojure deftype
I\'m trying to create a new type in Clojure using deftype to implement a two dimensional (x,y) coordinate, which implements a \"Location\" protocol.[详细]
2023-01-03 05:53 分类:问答How can I define a clojure type that implements the servlet interface?
I\'m attempting to use deftype (from the bleeding-edge clojure 1.2 branch) to create a java class that implements the java Servlet interface.I would expect the code below to compile (even though it\'s[详细]
2022-12-31 04:39 分类:问答Can I add fields to clojure types?
Clojure structs can be arbitrarily extended, adding new fields. Is it possible to extend types (created using deftype) in a similar way?[详细]
2022-12-23 04:53 分类:问答Nested types in clojure?
In clojure, how do I type type hint a type that I have created?(I want to nest the types.) e.g.I had thought that this would work:[详细]
2022-12-14 21:29 分类:问答