102 lines
2.7 KiB
Text
102 lines
2.7 KiB
Text
|
|
{builtins ->
|
||
|
|
if := builtins.if
|
||
|
|
== := builtins.==
|
||
|
|
> := builtins.>
|
||
|
|
< := builtins.<
|
||
|
|
>= := builtins.>=
|
||
|
|
<= := builtins.<=
|
||
|
|
+ := builtins.+
|
||
|
|
- := builtins.-
|
||
|
|
* := builtins.*
|
||
|
|
/ := builtins./
|
||
|
|
join := builtins.join
|
||
|
|
print := builtins.print
|
||
|
|
dump := builtins.dump
|
||
|
|
disasm := builtins.disasm
|
||
|
|
tostring := builtins.tostring
|
||
|
|
not := builtins.not
|
||
|
|
len := builtins.len
|
||
|
|
type := builtins.type
|
||
|
|
while := builtins.while
|
||
|
|
gc := builtins.gc
|
||
|
|
backtrace := builtins.backtrace
|
||
|
|
fopen := builtins.fopen
|
||
|
|
fread := builtins.fread
|
||
|
|
fwrite := builtins.fwrite
|
||
|
|
fclose := builtins.fclose
|
||
|
|
loadfile := builtins.loadfile
|
||
|
|
loadstring := builtins.loadstring
|
||
|
|
-serialize-bytecode := builtins.-serialize-bytecode
|
||
|
|
-unserialize-bytecode := builtins.-unserialize-bytecode
|
||
|
|
|
||
|
|
-named := { name f ->
|
||
|
|
builtins.set-func-name f name
|
||
|
|
}
|
||
|
|
|
||
|
|
& := { ~strings ->
|
||
|
|
join "" strings
|
||
|
|
}
|
||
|
|
|
||
|
|
partial := { f ~a1 ->
|
||
|
|
{ ~a2 ->
|
||
|
|
f ~a1 ~a2
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
compose := {
|
||
|
|
f -> f
|
||
|
|
f ~fs ->
|
||
|
|
fs-composed := compose ~fs
|
||
|
|
{ ~args ->
|
||
|
|
f (fs-composed ~args)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
!= := -named '!= (compose not ==)
|
||
|
|
!> := -named '!> (compose not >)
|
||
|
|
!< := -named '!< (compose not <)
|
||
|
|
!>= := -named '!>= (compose not >=)
|
||
|
|
!<= := -named '!<= (compose not <=)
|
||
|
|
|
||
|
|
# Dictionary of exported functions
|
||
|
|
[
|
||
|
|
'if -> if
|
||
|
|
'== -> ==
|
||
|
|
'> -> >
|
||
|
|
'< -> <
|
||
|
|
'>= -> >=
|
||
|
|
'<= -> <=
|
||
|
|
'+ -> +
|
||
|
|
'- -> -
|
||
|
|
'* -> *
|
||
|
|
'/ -> /
|
||
|
|
'join -> join
|
||
|
|
'print -> print
|
||
|
|
'dump -> dump
|
||
|
|
'disasm -> disasm
|
||
|
|
'tostring -> tostring
|
||
|
|
'not -> not
|
||
|
|
'len -> len
|
||
|
|
'type -> type
|
||
|
|
'while -> while
|
||
|
|
'gc -> gc
|
||
|
|
'backtrace -> backtrace
|
||
|
|
'fopen -> fopen
|
||
|
|
'fread -> fread
|
||
|
|
'fwrite -> fwrite
|
||
|
|
'fclose -> fclose
|
||
|
|
'loadfile -> loadfile
|
||
|
|
'loadstring -> loadstring
|
||
|
|
'-serialize-bytecode -> -serialize-bytecode
|
||
|
|
'-unserialize-bytecode -> -unserialize-bytecode
|
||
|
|
'& -> &
|
||
|
|
'partial -> partial
|
||
|
|
'compose -> compose
|
||
|
|
'!= -> !=
|
||
|
|
'!> -> !>
|
||
|
|
'!< -> !<
|
||
|
|
'!>= -> !>=
|
||
|
|
'!<= -> !<=
|
||
|
|
]
|
||
|
|
}
|