feat: add and, or and not (#31)

This commit is contained in:
Aleksey Proshutisnkiy 2022-11-18 16:42:48 +04:00 committed by GitHub
parent c48bf22d0d
commit 9870e454a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 1 deletions

25
binary.aqua Normal file
View File

@ -0,0 +1,25 @@
-- TODO: add aqua tests
func and(l: bool, r: bool) -> bool:
res: ?bool
if l:
res <<- r
else:
res <<- false
<- res!
func or(l: bool, r: bool) -> bool:
res: ?bool
if l:
res <<- true
else:
res <<- r
<- res!
func not(u: bool) -> bool:
res: ?bool
if u:
res <<- false
else:
res <<- true
<- res!

View File

@ -4,7 +4,8 @@
"description": "Aqua standard library", "description": "Aqua standard library",
"files": [ "files": [
"builtin.aqua", "builtin.aqua",
"math.aqua" "math.aqua",
"binary.aqua"
], ],
"scripts": {}, "scripts": {},
"repository": { "repository": {