Coder Social home page Coder Social logo

cyclist's Introduction

Cyclist, a Cyclic Dependencies Detection Library

Cyclist is a tiny Clojure library that detects cyclic dependencies between named entities.

Project Maturity

Cyclist is not a young library.

Artifacts

Cyclist artifacts are released to Clojars. If you are using Maven, add the following repository definition to your pom.xml:

<repository>
  <id>clojars.org</id>
  <url>http://clojars.org/repo</url>
</repository>

The Most Recent Release

With Leiningen:

[clojurewerkz/cyclist "1.0.0"]

With Maven:

<dependency>
  <groupId>clojurewerkz</groupId>
  <artifactId>cyclist</artifactId>
  <version>1.0.0</version>
</dependency>

Documentation

Cyclist operates on maps with two keys: :name and :dependencies:

{:name :a :dependencies #{:b}}
{:name :b :dependencies #{:c}}
{:name :c :dependencies #{}}

clojurewerkz.cyclist.dependencies/has-cyclic-dependecies? takes node and a collection of all graph nodes and returns true if the graph has cyclic dependencies:

(let [a {:name 'a :dependencies #{'b}}
      b {:name 'b :dependencies #{'c}}
      c {:name 'c :dependencies #{}}
      xs [a b c]]
  (cy/has-cyclic-dependencies? x xs))
;= false

(let [a {:name 'a :dependencies #{'b}}
      b {:name 'b :dependencies #{'a}}
      c {:name 'c :dependencies #{}}
      xs [a b c]]
  (cy/has-cyclic-dependencies? x xs))
;= true

clojurewerkz.cyclist.dependencies/detect takes a collection of graph nodes and returns the first one that has cyclic dependencies:

(let [a {:name 'a :dependencies #{'b}}
      b {:name 'b :dependencies #{'c}}
      c {:name 'c :dependencies #{}}
      xs [a b c]]
  (cy/detect xs))
;= nil

(let [a {:name 'a :dependencies #{'b}}
      b {:name 'b :dependencies #{'a}}
      c {:name 'c :dependencies #{}}
      xs [a b c]]
  (cy/detect xs))
;= {:name 'a :dependencies #{'b}}

(let [a {:name 'a :dependencies #{'b}}
      b {:name 'b :dependencies #{'c}}
      c {:name 'c :dependencies #{'a}}
      xs [a b c]]
  (cy/detect xs))
;= {:name 'a :dependencies #{'b}}

Community

To subscribe for announcements of releases, important changes and so on, please follow @ClojureWerkz on Twitter.

Supported Clojure versions

Cyclic is built from the ground up for Clojure 1.4 and up.

Continuous Integration Status

Continuous Integration status

Cyclist Is a ClojureWerkz Project

Cyclist is part of the group of Clojure libraries known as ClojureWerkz, together with

Development

Cyclist uses Leiningen 2. Make sure you have it installed and then run tests against supported Clojure versions using

lein all test

Then create a branch and make your changes on it. Once you are done with your changes and all tests pass, submit a pull request on GitHub.

License

Copyright (C) 2013-2016 Michael S. Klishin, Alex Petrov, and the ClojureWerkz team.

Double licensed under the Eclipse Public License (the same as Clojure) or the Apache Public License 2.0.

cyclist's People

Contributors

bitdeli-chef avatar michaelklishin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.