THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng | |
---|---|
Số trang | 338 |
Dung lượng | 4,41 MB |
Nội dung
Ngày đăng: 12/05/2017, 13:49
Nguồn tham khảo
Tài liệu tham khảo | Loại | Chi tiết | ||
---|---|---|---|---|
125–126 reify macro 126 checking installation 302 compiling Clojure code tobytecodecalculator example 126–129 creating Java classes andinterfaces using gen-class and gen-interface 129–131example generating Java classes 131–132 using Leiningen 132–133 dot and new operators 12–13 exceptions in 60–62primitive types 59–60 static fields 119–120 static methods 119threads and concurrency 13 type hints 58–59types, classes, and objects 11–12java.lang package 11 JavaScript 2Jetty 12JIT (just-in-time) compiler 6Joda Time library 12, 249 JSP (JavaServer Pages) 172 just-in-time compiler. See JIT JVM (Java Virtual Machine)Clojure on 6–7, 10–11 dot and new operators 12–13 Java types, classes, andobjects 11–12threads and concurrency 13 K:keys key 94keywords 26–27, 77–80 Llazy-seq macro 189 Leiningen 127, 132–133adding dependencies to project 305–306 lein repl task 305 lein tasks 304–305 overview 303–304 lein-localrepo plugin 221 let formoverview 35–36 scope and 85–86 lexical closures 86–87 lexically scoped variable 80 Lisp 301Clojure and 2–3 syntax 7–9 lists 27–29 livelock 138:load-impl-ns option 132 loadResourceScript method 134 locks 137–138logical functions 41–43 loop macro 44–45 loop/recur construct 67 M:macro key 58macroexpand function 171 macroexpand-1 function 171 macroexpand-all function 171 macrosadvantages of 176–177 anaphoricif macro 270–273 overview 270thread-it macro 273–276 and macro 178–179comment macro 177 declare macro 177–178 defonce macro 178 examples of customassert-true macro 184 defnn macro 183 defwebmethod macro | Sách, tạp chí |
|
||
196–197 overview 192–193 partial function 72, 195pattern matching. See destructur- ingpeek function 30 persistencedefined 144persistent data structures 144 principles of persistent data 4 phantom reads 137polish notation 21 polymorphismad hoc 99–101function overloading as 100 general discussion 98–99 multimethodsad hoc polymorphism using 103–104building and querying type hierarchies 109–110 creating functionalitywithout 103defmethod macro 105–106 defmulti macro 104–105 multiple-dispatch 106–108 resolving methodambiguities 111–112 subtype polymorphismusing 108–109 subtypes and multiple-dispatch 110–111 user-definedhierarchies 112 parametric 99 subtype 101–103 pop function 30 :post key 65 :postinit option 132 :pre key 64predicate functions 70 prefer-method function 112 prefix notation 8, 21–22 :prefix option 131–132 primitive types, Java 59–60 private functions 88 profilers 12 | Sách, tạp chí |
|
||
144–145 mutation 159–160 mutation, watchingfor 160–161 overview 143 persistent datastructures 144 references 159 transactions 160 futures 162–163 identities and valuesimmutable values 140, 142 objects over time 140–141 understanding identity vs.state 139–140 in Java 13promises 163 refsalter function 146–147 commute function 147–148 creating 145ref-set function 146 state issuesdirty reads 136locking solution 137–138lost updates 136 overview 136 phantom reads 137 STMACI (atomic, consistent, iso- lated) properties 149 MVCC (multiversion con-currency control) 150 overview 148–149 side effects from 155 transactions 149 varsbindings for 158–159 creating 157–158 cond macro 40cond-> (conditional threading macro) 53conditionals cond 40 if 39–40 if-not 40 when 40–41 when-not 41 conj function 28 cons function 34 constantly function 71 :constructors option 131 create-ns function 90 cube-all function 188 Ddash prefix 131 data structurescharacters 24 keywords 26–27 lists 27–29 maps 31–33 nil 24numbers 25–26 sequences 33–34 strings 24 symbols 26–27 vectors 29–30 deadlock 138 decimal numbers 25 declare macro 177–178 decomposition of DSLs 287 def form 80:default case 111 defclass function 202 defmethod macro 105–106 defmulti macro 104–105 defn macro 35, 63, 81 defnn macro 183 | Khác | |||
191–192 overview 187 reducing lists ofthings 189–191 keywords 77–80 logical 41–43 multiple arity 65 mutually recursive 67–69 overloading 100partial application ofadapting functions 193–196 defining newfunctions 196–197 overview 192–193private vs. public 88 recursive 66–67 symbols 78–80 unary 46variable arity of 35 variadic 66 futures 162–163 G:gen-class directive 127 gen-class macro 129–131 generics 99gen-interface macro 129–131 -getCurrentStatus function 131 Hhash maps 79:hierarchy keyword option 113 higher-order functionscollecting results of functions 187–189 comp 72complement 71 constantly 71 creating 73–75 every? 70filtering lists of things 191–192 memoize 73 overview 70, 187 partial 72reducing lists of things 189–191 some 70hosted languages 6 Iidentitiesimmutable values 140, 142 objects over time 140–141 state vs. 139–140if macro 39–40, 270–273 if-not macro 40if-then-else 223 immutable valuesidentities and 140, 142 via copying 143–144 :implements option 131 :impl-ns option 132 :import key 89 import macro 118 :import option 118infix macro 180 infix notation 8 :init option 131 –initialize function 131 in-ns function 90 installationchecking Java installation 302 Clojure.jar 303Leiningenadding dependencies to project 305–306 lein repl task 305 lein tasks 304–305 overview 303–304 Try Clojure site 302–303 instance? function 110 integers 25interfaces, defined 11 internal DSLs 291 interopcalling Clojure from Java 133–134calling Java from Clojure .. (dot-dot) macro 121–122 accessing methods andfields 119–120 array functions 124–125 bean function 124 creating instances 118–119 dot special form 120–121 doto macro 122importing Java classes 117–118memfn macro 123–124 MouseAdapter class | Khác | |||
181–183 infix macro 180randomly macro 180–181 macro-generating macrosdefined 281–282 example template 282 make-synonym macroimplementation 282–285purpose of 285–286 overview 167rotation cipher example 276–279shifting computation to compile time 276–281 templatesgenerating names 174–176 splicing 173–174 unquote splice readermacro (~@) 174 unquoting 172–173 using backquote (`)macro 172 textual substitutionexample 167–168 time macro 179–180 unless formas function 169–170 as macro 170–171 overview 168–169 magic variables 19–20 :main option 132make-hierarchy function 113 make-synonym macro 282–285 managed references 144–145,161map bindings 93–95 maps 31–33, 46–47 mathematical functions 22 Maven repository 305 memfn macro 123–124 memoize function 73 :meta option 154 metadataJava primitive types 59–60 Java type hints 58–59 overview 56–58 | Khác | |||
290–291 user namespace 17 UUIDs (universally uniqueidentifiers) 96V:validator option 154 values, in functionalprogramming 3 variable arity 8 variable capture 175,272variadic functions 21, 66 varsatoms vs. 161 binding of 80–81 bindings for 158–159 creating 157–158 defined 144dynamic scope 81–83 laziness and 84–85 thread-local state 84 vector bindingsnested vectors 92–93 overview 91–92 using & and 92 vectors 29–30 Wwhen macro 40–41 when-not macro 41 while macro 44 whitespace 22–23 wrappers 222–223 XXP (extremeprogramming) 255 | Khác |
Xem thêm
TỪ KHÓA LIÊN QUAN
TRÍCH ĐOẠN
TÀI LIỆU CÙNG NGƯỜI DÙNG
TÀI LIỆU LIÊN QUAN