dt

duct tape for your unix pipes


dt 0.11.1 standard library

doexecute a command or quote
pushmove an item into a quote
versionprint the version of the interpreter
statusstatus
deqremove an item from the first position of a quote
%modulo two numeric values
charschars
pipe-thru-argspipe-thru-args
repl-preluderepl-prelude
dupduplicate the top value
*multiply two numeric values
swapswap the top two values
lenthe length of a string or quote or 1 for single values
quotequote a value
gte?consume two numbers and return true if the most recent is greater
readfread a file as a string
joinconsume a quote of strings and a delimiter, and produce a string with the delimiter interspersed
epprint a value to stderr
to-floatcoerce value to floating-point number
run-argsrun-args
doinexecute a command or quote in a previous quote
even?even?
neq?neq?
divisor?divisor?
firstfirst
do?consume a boolean and either do or drop a command or quote
enlprint a newline to stderr
parse-csvparse-csv
.sprint the stack
dropdrop the top value
+add two numeric values
to-boolcoerce value to boolean
inspireget inspired
plpl
printlnprintln
assert-trueassert-true
def!define a new command. If nested, any commands or variables defined will be available in the calling scope
mapapply a command to all values in a quote
upcaseconvert a string to uppercase
undef?undef?
eacheach
lte?consume two numbers and return true if the most recent is less
lastlast
->->
cwdcurrent working directory
writefwrite a string as a file
def?return true if a name is defined
to-quotecoerce value to quote
whilewhile
absconsume a number and produce its absolute value
defsproduce a quote of all definition names
notconsume a booleans and produce its logical not
read-linesget lines from standard input (until EOF)
rotrotate the top three values
redmake stdout/stderr red
argsget command-line args
interactive?determine if the input mode is interactive (a TTY) or not
do!execute a command or quote. If nested, any commands or variables defined will be available in the calling scope
concatconcatenate two quotes. Values are coerced into quotes. (For String concatenation, see join)
unwordsunwords
to-stringcoerce value to string
nandnand
main-replmain-repl
do!?consume a boolean and either do or drop a command or quote. If nested, any commands or variables defined will be available in the calling scope
randproduces a random integer
read-lineget a line from standard input (until newline)
quote-allquote all current context
print-versionprint-version
to-errorcoerce value to an error
wordswords
eplsepls
--version--version
downcaseconvert a string to lowercase
lslist contents of current directory
orconsume two booleans and produce their logical or
unlinesunlines
exitexit with the specified exit code
pwdpwd
cdchange directory
to-defcoerce value to a deferred command
evaleval
eq?consume two values and return true if they are equal
any?return true if any value in a quote passes a predicate
defdef
gt?consume two numbers and return true if the most recent is greater
unquoteunquote
repl-greetrepl-greet
plspls
:bind variables
lt?consume two numbers and return true if the most recent is less
ends-with?consume a string and a suffix, and return true if the string has the suffix
execexecute a child process. When successful, returns stdout as a string. When unsuccessful, prints the child's stderr to stderr, and returns boolean false
to-cmdcoerce value to a command
shebang-argsshebang-args
starts-with?consume a string and a prefix, and return true if the string has the prefix
normreset stdout/stderr colors
eprintlneprintln
popmove the last item of a quote to top of stack
odd?odd?
printprint
procnameget name of current process
splitconsume a string and a delimiter, and produce a quote of the string split on all occurrences of the substring
greenmake stdout/stderr green and bold (for the colorblind)
revreverse a quote or string
eplepl
timestimes
handle-flagshandle-flags
.qquit, printing a warning if there are any values left on stack
to-intcoerce value to integer
handle-flaghandle-flag
/divide two numeric values
lineslines
-subtract two numeric values
contains?consume a string and a substring, and return true if the string contains the substring
eprinteprint
...expand a quote
print-helpprint-help
usageprint the usage notes of a given command
andconsume two booleans and produce their logical and
nornor
filteronly keep values in that pass a predicate in a quote
--help--help
replrepl
pprint a value to stdout
nlprint a newline to stdout
enqmove an item into the first position of a quote