Additional features are listed. Also, I`ve discovered a really easy way of
automating TDD using karma, which quickens the compilation/testing
dramatically and the jasmin macros where built for that:
functions
When f.n and def.n are used for function definitions, there is no need to
write ?, ?> and !> within the form as it is handled automatically.
Actually, the short hand is avaliable Within any of the macro forms.
Typing:
- a.b.c is the same as typing (? a.b.c):
- (inc a.b.c 1) is the same as typing (?> inc a.b.c 1):
- (a.call arg1 arg2) is the same as typing (!> a.call arg1 arg2):
- Only the setter function (! a.b.c (new value)) remains the same.
Example:
(def.n set-static-breadcrumbs [app v]
(js/console.log "Setting breadcrumbs")
(! app.layout.breadcrumbs
(let [arr (array)]
(doseq [i v.trail] ;; Dot notation
(arr.push app.static.|i|)) ;; Note the javascript-ish accessor
(arr.push v) ;; Dot function call
arr)))
<https://github.com/zcaudate/purnam#other-libraries>Other
Libraries<https://github.com/zcaudate/purnam#angularjs>
angularjs
Angularjs macros help alleviate the amount of callback functions that one
has to write
(def.module app [ui ui.bootstrap ui.compat])
(def.config app [$locationProvider]
(doto $locationProvider (.hashPrefix "!")))
(def.config app [$routeProvider]
(doto $routeProvider
(.when "" (obj :redirectTo "/home"))))
(def.controller app.MainCtrl [$scope $state App AppFn]
(! $scope.app App)
(! $scope.fn AppFn)
(! $scope.state $state)
($state.transitionTo "home"))
jasmin
Jasmin macros for clearer tests. The .cljs tests are defined using jasmin
macros (which are really kinda cool)
(describe
"objs contain js arrays"
[o1 (obj :array [1 2 3 4])]
(*do.n*
(it "describes something"
(is o1.array.0 1)
(is o1.array.1 2)
(is o1.array.2 3)
(is o1.array.3 4)
(is o1.array.4 js/undefined))))
<https://github.com/zcaudate/purnam#jasmin>
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.