Loom is a programming language for playing around with sets and strings, focusing on the implementations of set and string operations with regards to formal language theory.
The following example is available under examples
:
# Define language of 0 and 1 (binary string alphabet)
bits := {0, 1}
# Define ascii character language
ascii := bits × bits × bits × bits × bits × bits × bits × bits
# Get binary input from user conforming to the set of
# sequences of ascii characters
input ∈ ascii* ?
# Define L, o, and m ascii characters
L := 01001100 ∈ ascii
o := 01101111 ∈ ascii
m := 01101101 ∈ ascii
# Concatenate ascii characters to make binary string
# representing "Loom"
Loom := L + o + o + m ∈ ascii × ascii × ascii × ascii
colon := 00111010 ∈ ascii
# Print "loom:<input>" in binary
Loom + colon + input !
Branch | Status |
---|---|
master | |
develop |