Code Monkey home page Code Monkey logo

lsq's Introduction

Lisp Query

Like json query but for Lisp.

Table of Contents

Installation

git clone https://github.com/Ecoral360/lsq.git
cargo install --path ./lsq
lsq --version  # will display the version if the installation was successful

How to use

lsq 'query' file-name.scm
# OR
some-op | lsq 'query'

The lsq language

The lsq language is a query language made to access and traverse s-expression with ease.

A lsq query is made up of filters separated by the | symbol. The list of

While the number of builtin filters and builtin functions provided by lsp is low at the moment, it is rapidly expanding. If the language doesn't support something you need, feel free to open an Issue!

Examples

You have a people.scm file:

((name "Mathis" info (age 20))
 (name "Jean" info (age 28))
 (name "Alice" info (age 12))
 (name "Enric" info (age 20))
 (name "Claudia" info (age 18))
 (name "Amelie" info (age 21))
 (name "Matteo" info (age 16)))

and you want to get the name of everyone who is major (18+). You could write this query:

cat people.scm | lsq ';() | select >=? ;(;info;age) 18'

Outputs:

(name "Mathis" info (age 20))
(name "Jean" info (age 28))
(name "Enric" info (age 20))
(name "Claudia" info (age 18))
(name "Amelie" info (age 21))

License

lsq is distributed under the terms of the MIT license.

TODO

  • Add good error handling

lsq's People

Contributors

ecoral360 avatar

Stargazers

 avatar

Watchers

 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.