Protocol IWriter is not loaded at creation time Le dimanche 14 octobre 2012 09:29:40 UTC+2, Shantanu Kumar a écrit : > > Hi, > > I noticed every instance of using `defrecord` with CLJS > 0.0.1503/lein-cljsbuild 0.2.8 is emitting the following warning during > compilation: > > WARNING: Protocol IPrintable is deprecated at line ## <filename> > > What is the recommended way to use `defrecord` as of the new CLJS version? > When I try to use `defrecord` at repl-rhino, I get the following error: > > ClojureScript:cljs.user> (defrecord Foo [bar]) > WARNING: cljs.core/pr-sequential is deprecated. at line 1 > WARNING: cljs.core/pr-sequential is deprecated. at line 1 > WARNING: cljs.core/pr-sequential is deprecated. at line 1 > WARNING: cljs.core/pr-sequential is deprecated. at line 1 > "Error evaluating:" (defrecord Foo [bar]) :as "\n/**\n* @constructor\n* > @param {*} bar\n* @param {*} __meta\n* @param {*} __extmap\n* @param {*=} > __meta \n* @param {*=} __extmap\n*/\ncljs.user.Foo = (function > (bar,__meta,__extmap){\nthis.bar = bar;\nthis.__meta = > __meta;\nthis.__extmap = > __extmap;\nthis.cljs$lang$protocol_mask$partition1$ = > 0;\nthis.cljs$lang$protocol_mask$partition0$ = > 2766538506;\nif(arguments.length>1){\nthis.__meta = __meta;\nthis.__extmap > = __extmap;\n} else > {\nthis.__meta=null;\nthis.__extmap=null;\n}\n})\ncljs.user.Foo.prototype.cljs$core$IHash$_hash$arity$1 > > = (function (this__2224__auto__){\nvar this__10305 = this;\nvar > h__2094__auto____10306 = this__10305.__hash;\nif(!((h__2094__auto____10306 > == null)))\n{return h__2094__auto____10306;\n} else\n{var > h__2094__auto____10307 = > cljs.core.hash_imap.call(null,this__2224__auto__);\nthis__10305.__hash = > h__2094__auto____10307;\nreturn > h__2094__auto____10307;\n}\n});\ncljs.user.Foo.prototype.cljs$core$ILookup$_lookup$arity$2 > > = (function (this__2229__auto__,k__2230__auto__){\nvar this__10308 = > this;\nreturn > this__2229__auto__.cljs$core$ILookup$_lookup$arity$3(this__2229__auto__,k__2230__auto__,null);\n});\ncljs.user.Foo.prototype.cljs$core$ILookup$_lookup$arity$3 > > = (function (this__2231__auto__,k10303,else__2232__auto__){\nvar > this__10309 = this;\nif((k10303 === \"\\uFDD0'bar\"))\n{return > this__10309.bar;\n} else\n{if(\"\\uFDD0'else\")\n{return > cljs.core._lookup.call(null,this__10309.__extmap,k10303,else__2232__auto__);\n} > > else\n{return > null;\n}\n}\n});\ncljs.user.Foo.prototype.cljs$core$IAssociative$_assoc$arity$3 > > = (function (this__2236__auto__,k__2237__auto__,G__10302){\nvar this__10310 > = this;\nvar pred__10311__10314 = cljs.core.identical_QMARK_;\nvar > expr__10312__10315 = > k__2237__auto__;\nif(pred__10311__10314.call(null,\"\\uFDD0'bar\",expr__10312__10315))\n{return > > (new > cljs.user.Foo(G__10302,this__10310.__meta,this__10310.__extmap,null));\n} > else\n{return (new > cljs.user.Foo(this__10310.bar,this__10310.__meta,cljs.core.assoc.call(null,this__10310.__extmap,k__2237__auto__,G__10302),null));\n}\n});\ncljs.user.Foo.prototype.cljs$core$IPrintWithWriter$_pr_writer$arity$3 > > = (function > (this__2248__auto__,writer__2249__auto__,opts__2250__auto__){\nvar > this__10316 = this;\nvar pr_pair__2251__auto____10317 = (function > (keyval__2252__auto__){\nreturn > cljs.core.pr_sequential_writer.call(null,writer__2249__auto__,cljs.core.pr_writer,\"\",\" > > \",\"\",opts__2250__auto__,keyval__2252__auto__);\n});\nreturn > cljs.core.pr_sequential_writer.call(null,writer__2249__auto__,pr_pair__2251__auto____10317,[cljs.core.str(\"#\"),cljs.core.str(\"Foo\"),cljs.core.str(\"{\")].join(''),\", > > \",\"}\",opts__2250__auto__,cljs.core.concat.call(null,cljs.core.PersistentVector.fromArray([cljs.core.vector.call(null,\"\\uFDD0'bar\",this__10316.bar)], > > true),this__10316.__extmap));\n});\ncljs.user.Foo.prototype.cljs$core$ICollection$_conj$arity$2 > > = (function (this__2234__auto__,entry__2235__auto__){\nvar this__10318 = > this;\nif(cljs.core.vector_QMARK_.call(null,entry__2235__auto__))\n{return > this__2234__auto__.cljs$core$IAssociative$_assoc$arity$3(this__2234__auto__,cljs.core._nth.call(null,entry__2235__auto__,0),cljs.core._nth.call(null,entry__2235__auto__,1));\n} > > else\n{return > cljs.core.reduce.call(null,cljs.core._conj,this__2234__auto__,entry__2235__auto__);\n}\n});\ncljs.user.Foo.prototype.cljs$core$ISeqable$_seq$arity$1 > > = (function (this__2241__auto__){\nvar this__10319 = this;\nreturn > cljs.core.seq.call(null,cljs.core.concat.call(null,cljs.core.PersistentVector.fromArray([cljs.core.vector.call(null,\"\\uFDD0'bar\",this__10319.bar)], > > true),this__10319.__extmap));\n});\ncljs.user.Foo.prototype.cljs$core$IPrintable$_pr_seq$arity$2 > > = (function (this__2243__auto__,opts__2244__auto__){\nvar this__10320 = > this;\nvar pr_pair__2245__auto____10321 = (function > (keyval__2246__auto__){\nreturn > cljs.core.pr_sequential.call(null,cljs.core.pr_seq,\"\",\" > \",\"\",opts__2244__auto__,keyval__2246__auto__);\n});\nreturn > cljs.core.pr_sequential.call(null,pr_pair__2245__auto____10321,[cljs.core.str(\"#\"),cljs.core.str(\"cljs.user.Foo\"),cljs.core.str(\"{\")].join(''),\", > > \",\"}\",opts__2244__auto__,cljs.core.concat.call(null,cljs.core.PersistentVector.fromArray([cljs.core.vector.call(null,\"\\uFDD0'bar\",this__10320.bar)], > > true),this__10320.__extmap));\n});\ncljs.user.Foo.prototype.cljs$core$ICounted$_count$arity$1 > > = (function (this__2233__auto__){\nvar this__10322 = this;\nreturn (1 + > cljs.core.count.call(null,this__10322.__extmap));\n});\ncljs.user.Foo.prototype.cljs$core$IEquiv$_equiv$arity$2 > > = (function (this__2225__auto__,other__2226__auto__){\nvar this__10323 = > this;\nif(cljs.core.truth_((function (){var and__3822__auto____10324 = > other__2226__auto__;\nif(cljs.core.truth_(and__3822__auto____10324))\n{var > and__3822__auto____10325 = (this__2225__auto__.constructor === > other__2226__auto__.constructor);\nif(and__3822__auto____10325)\n{return > cljs.core.equiv_map.call(null,this__2225__auto__,other__2226__auto__);\n} > else\n{return and__3822__auto____10325;\n}\n} else\n{return > and__3822__auto____10324;\n}\n})()))\n{return true;\n} else\n{return > false;\n}\n});\ncljs.user.Foo.prototype.cljs$core$IWithMeta$_with_meta$arity$2 > > = (function (this__2228__auto__,G__10302){\nvar this__10326 = this;\nreturn > (new > cljs.user.Foo(this__10326.bar,G__10302,this__10326.__extmap,this__10326.__hash));\n});\ncljs.user.Foo.prototype.cljs$core$IMeta$_meta$arity$1 > > = (function (this__2227__auto__){\nvar this__10327 = this;\nreturn > this__10327.__meta;\n});\ncljs.user.Foo.prototype.cljs$core$IMap$_dissoc$arity$2 > > = (function (this__2238__auto__,k__2239__auto__){\nvar this__10328 = > this;\nif(cljs.core.contains_QMARK_.call(null,cljs.core.PersistentHashSet.fromArray([\"\\uFDD0'bar\"]),k__2239__auto__))\n{return > > cljs.core.dissoc.call(null,cljs.core.with_meta.call(null,cljs.core.into.call(null,cljs.core.ObjMap.EMPTY,this__2238__auto__),this__10328.__meta),k__2239__auto__);\n} > > else\n{return (new > cljs.user.Foo(this__10328.bar,this__10328.__meta,cljs.core.not_empty.call(null,cljs.core.dissoc.call(null,this__10328.__extmap,k__2239__auto__)),null));\n}\n});\ncljs.user.Foo.cljs$lang$type > > = true;\ncljs.user.Foo.cljs$lang$ctorPrSeq = (function > (this__2271__auto__){\nreturn > cljs.core.list.call(null,\"cljs.user/Foo\");\n});\ncljs.user.Foo.cljs$lang$ctorPrWriter > > = (function (this__2271__auto__,writer__2272__auto__){\nreturn > cljs.core._write.call(null,writer__2272__auto__,\"cljs.user/Foo\");\n});\ncljs.user.__GT_Foo > > = (function __GT_Foo(bar){\nreturn (new > cljs.user.Foo(bar));\n});\ncljs.user.map__GT_Foo = (function > map__GT_Foo(G__10304){\nreturn (new cljs.user.Foo((new > cljs.core.Keyword(\"\\uFDD0'bar\")).call(null,G__10304),null,cljs.core.dissoc.call(null,G__10304,\"\\uFDD0'bar\")));\n});\ncljs.user.Foo;\n" > org.mozilla.javascript.JavaScriptException: Error: No protocol method > IWriter.-write defined for type object: {:meta false, :readably true, > :flush-on-newline true, :dup false} (cljs/core.cljs#276) > at cljs/core.cljs:276 (anonymous) > at cljs/core.cljs:268 (_write) > at <cljs repl>:131 (anonymous) > at cljs/core.cljs:6271 (pr_writer) > at cljs/core.cljs:6248 (pr_seq_writer) > at cljs/core.cljs:6256 (pr_sb_with_opts) > at cljs/core.cljs:6268 (pr_str_with_opts) > at cljs/core.cljs:6305 (anonymous) > at cljs/core.cljs:6312 (anonymous) > at <cljs repl>:1 > > nil > > Shantanu >
-- 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 from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en