Skip to content

ikoloki/ltpl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brief Intro:

Introduction

What Is This Exactly ?

ltpl is a delaritive text processing dsl. A utility that just happends to have a language inside of it.

Who Is This For ?

This language primarily aims at people who want to do easy formated text output or parsing of information from files in the terminal. this would be a nifty tool to use in shell scripts as well for the sorts of things that awk sed or shell would make it annoying to do.

Examples

Fizzbuzz

$ echo "10 20 30 50 55" > file.txt
$ ltpl file.txt "--@$CF[?:=:\3:0]fizz[p][?:=:\5:0]buzz[p]."

hello world

$ ltpl dummy.txt "--@hello_world[p]"
hello world

word count

declaritive approach

$ echo "this is a test here not to mention that this is great too" > file.txt
$ ltpl "--@$NF[p]."
13

iterative approach

$ echo "another test here" > file.txt
$ ltpl file.txt "--@i[0]$0!$i[+:$i:1]$i[p]."
3
$ echo "1 2 3 4" > file.txt
$ ltpl file.txt "--[pwr]"
1 
2
3
4

Installation

Comming soon to theatres near you!

Why The Cryptic Syntax

ltpl’s syntax and grammar is very simple aiming and being simple to use in a terminal enviroment. With this consideration taken a APL or Regular expression like syntax was considerd appropriate for a speedy interactive usage that I wanted.

About

A text processing utility in lisp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published