Giter Club home page Giter Club logo

boon's Introduction

Boon

Sometimes your application might need to let users configure some basic boolean logic rules which then have to be stored in a database somewhere. Maybe you have logic that needs to be shared across multiple platforms, or edited by non-technical contributors.

Boon, the bolean expression language, is a useful tool for these situations. It looks like this:

# Check if your pulled pork has the correct BBQ sauce
isVinegarBased AND NOT (sugaryKetchup OR mustard)

Boon supports the following operators (in descending precedence):

  • NOT
  • XOR
  • AND
  • OR

Parentheses can be used to override precedence. Quotation marks can be used for data identifiers that need spaces or other special characters. Comments start with a #. There is a full specification if you need more detail, but here are some examples to get you started:

# Great Sci-Fi Authors
"Octavia Butler" AND "N.K. Jemisin"

ย 

# We need exactly three Hugos for best novel
NOT "Lois McMaster Bujold" # She won too many!
AND 
("N.K. Jemisin"          # The Broken Earth Trilogy - Three in a row!
  OR 
  ("Ann Leckie"          # Ancillary Justice
    AND "Arkady Martine" # A Memory Called Empire
    AND "Martha Wells"   # Network Effect
  )
)

Notes

If you need similar behavior in JS, try boon-js, which I believe is the origin of the Boon spec.

boon's People

Contributors

mattcheely avatar

Watchers

 avatar James Cloos 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.