Skip to main content

Crate pipa

Crate pipa 

Source
Expand description

Pipa is a tiny, pipe-y template language, made for the wonderfully whimsical world of humans-typing-text. Almost everything is optional and almost nothing is type-safe. It’s do-what-i-mean all-the-way-down, at least in theory.

For now, you’ll find very few docs beyond this point. Many items of questionable general utility are simply hidden. Still more a ballpit of curios than, you know, serious software. However, let me know if you find anything useful that should be exposed or explained. It’s mostly just a time thing.

// Values can be Bytes, Lists, or Maps.
// List and Map punctuation is optional.

{set my-bytes "beep"}
{set my-list [1 2 3]}
{set my-map {a 4 b 5}}
{set my-stuff [{ x: ['y', 10] }]}

// No true/false/nil, just empty-or-not.
// Use "&&" and "||" and ";" to stop-or-go.

{"" && "hello?"} // => ""
{[] || "list is empty"} // => "list is empty"
{{} && "ternary" || "goodness"} // => "goodness"

// Pipes insert their input at the end.
// Use _ to insert the input somewhere else.
// Concats by default, and <tags> are bytes.

{capitalize my-bytes} // => "Beep"
{my-bytes | capitalize} // => "Beep"
{my-map | first | add _ _} // => 8
{my-list | map :(add 1)} // => [2 3 4]
{1 2 3 | <i>_</i>} // => "<i>123</i>"

Modules§

lang
Evaluate templates, expressions, and keychains.
value
The core value type and its supporting cast.