mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-27 09:08:48 +00:00
Better infixes
This commit is contained in:
parent
92f60665df
commit
25ec856fba
11 changed files with 56 additions and 34 deletions
|
|
@ -1,6 +1,6 @@
|
|||
local n;
|
||||
|
||||
infix "===" at "==" (v1, v2) {
|
||||
infix === at == (v1, v2) {
|
||||
local s1, s2, i;
|
||||
|
||||
s1 := v1.string;
|
||||
|
|
@ -17,14 +17,14 @@ infix "===" at "==" (v1, v2) {
|
|||
fi
|
||||
}
|
||||
|
||||
infix "?" before "+" (v, l) {
|
||||
infix ? before + (v, l) {
|
||||
case l of
|
||||
{} -> 0
|
||||
| h : tl -> if h === v then 1 else (v ? tl) fi
|
||||
esac
|
||||
}
|
||||
|
||||
infix "+++" at "+" (l1, l2) {
|
||||
infix +++ at + (l1, l2) {
|
||||
case l1 of
|
||||
{} -> l2
|
||||
| h : tl -> (h : tl +++ l2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue