1 个不稳定版本
0.1.0 | 2019年6月2日 |
---|
#1365 in 数学
5KB
92 代码行
lambash
一个使用λ演算及其衍生品编写的POSIX-like外壳。
# This is a comment.
# Abstraction (function)
λx.x
λx.x
# Application
λx.x 1
1
\x.x 2
2
# Definition (syntactic)
id := \x.x
# Assignment (semantic)
ipi = \x.x 3.1415
# Equality
1 ≡ 1
λx.x ≡ λx.x
ipi ≡ id 3.1415
ipi ≢ 3.1415
# Primitives
### Boolean
true = true
true ≠ false
### Number
0
1.0
3.1415
271e-2
### Character
'f'
‘β’
### String
"foo"
“Γον”
### Void / Null
null = void
### None () / Tuple
()
(1, 2)
### Array
[]
[1, 2]
# POSIX
### Path (all unbound variables will be treated as a path)
foo.rb
./folder/file.ext
/somewhere/else
https://nixpulvis.com
### Operations
write foo.rb 3.1415
()
read foo.rb
3.1415
execp cat foo.rb
3.1415