Giter VIP home page Giter VIP logo

the-sequence-is-key's People

Contributors

maersdal avatar

Watchers

 avatar  avatar

the-sequence-is-key's Issues

Custom interceptor support

The error catching mechanism is conj'ing onto a list of errors

What about custom interceptor support, so that any user can inject whatever mechanism is nessecary?

Infinite streams

For now, the error catching mechanism is conj'ing onto a list of errors, then this list of errors is displayed in the final output.

To be able to use the verification with infinite streams, it should probably subscribe to a stream somehow, and have an atom of errors

machine reducing functions are overly complex

(defn rule-reduce
([active-rules clause k]
(rule-reduce active-rules clause k false))
([active-rules clause k immediate]
(reduce (fn [arules kvp]
(let [[rule value] kvp
;_ (println arules kvp)
]
(case rule
::not-eventually (if (and (= value k) (not immediate))
(update arules ::problem conj {:rule [::not-eventually value]
:broken-by k
::position (active-rules ::position)})
arules)
::is-after (if-not (contains? active-rules value)
(update arules ::problem conj {:rule [::is-after value]
:broken-by k
::position (active-rules ::position)})
arules)
::relax (apply dissoc arules value)
::next (assoc arules ::next value)
::free arules
:default (update arules ::problem conj
{:rule [::not-implemented rule value]
::position (active-rules ::position)}))))
active-rules clause)))
(defn rule-reduce-immediate [rules clause k]
(rule-reduce rules clause k true))
(defn inc-or-zero [x]
(if-not (nil? x)
(inc x)
0))
(def rule-parsing-default {::position 0})
(defn rule-parsing [all-rules active-rules k]
(when debugprint
(println active-rules k))
;; next is priority rule!
(if-let [target (active-rules ::next)]
(if-not (= k (active-rules ::next))
(update active-rules ::problem conj {:rule [::next target]
:broken-by k
::position (active-rules ::position)})
(rule-parsing all-rules (dissoc active-rules ::next) k))
;;
(if (contains? active-rules k)
(let [clause (active-rules k)]
(update (rule-reduce active-rules clause k)
::position inc-or-zero))
(let [clause (all-rules k)]
(-> (rule-reduce-immediate active-rules clause k)
(assoc k clause)
(update ::position inc-or-zero))))))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.