#Front End Resources
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defrecord Fragment [t p1 p2]) | |
(defprotocol FragmentProtocol | |
(t [fragment] "Return the type.") | |
(switch-type [fragment] "Switch type.")) | |
(deftype TypeFragment [f-type p1 p2] | |
FragmentProtocol | |
(t [this] f-type) | |
(switch-type [this] (TypeFragment. (if (= f-type :type-a) :type-a :type-b) p1 p2))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn one [] 1) | |
(defn div [v1 v2] | |
(float (/ v1 v2))) | |
(defparallelagg count | |
:init-var #'one | |
:combine-var #'+) | |
(defparallelagg sum-parallel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns fj | |
(:import [java.util.concurrent RecursiveTask | |
ForkJoinPool])) | |
(set! *warn-on-reflection* true) | |
;; ----------------------------------------------- | |
;; Helpers to provide an idiomatic interface to FJ | |
(defprotocol IFJTask |