mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-27 16:49:31 +00:00
Prefix type checkers with "is", stdlib cleanup
This commit is contained in:
parent
98917c2ca4
commit
7f71569e07
25 changed files with 163 additions and 160 deletions
|
|
@ -1,7 +1,7 @@
|
|||
:$ a - b
|
||||
return("generic minus")
|
||||
|
||||
:$ a::string - b::string
|
||||
:$ a::is string - b::is string
|
||||
return(a + " minus " + b)
|
||||
|
||||
| {2-5}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|v={v}
|
||||
a = v
|
||||
|
||||
:$ f(p) = v::string
|
||||
:$ f(p) = v::is string
|
||||
|v2={v}
|
||||
a = p
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
:$ a(x::number)
|
||||
:$ a(x::is number)
|
||||
return(x + 2)
|
||||
|
||||
:$ x
|
||||
:$ a(x::string)
|
||||
:$ a(x::is string)
|
||||
return(x + "heh")
|
||||
|
||||
|{a("plop")}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
:$ fn(x::number)
|
||||
:$ fn(x::is number)
|
||||
|x
|
||||
|
||||
:$ fn(a::number)
|
||||
:$ fn(a::is number)
|
||||
|a
|
||||
|
||||
fn(5)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
:$ fn(x::number)
|
||||
:$ fn(x::is number)
|
||||
|x
|
||||
|
||||
:$ fn(a::string="o")
|
||||
:$ fn(a::is string="o")
|
||||
|a
|
||||
|
||||
fn("s")
|
||||
|
|
@ -10,10 +10,10 @@ fn(5)
|
|||
|
||||
fn()
|
||||
|
||||
:$ g(n="s", a::number=5)
|
||||
:$ g(n="s", a::is number=5)
|
||||
return("gn")
|
||||
|
||||
:$ g(n="s", a::string="lol")
|
||||
:$ g(n="s", a::is string="lol")
|
||||
return("gs")
|
||||
|
||||
|{g(n="k", a="l")}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
:$ fn(x::number)
|
||||
:$ fn(x::is number)
|
||||
|x
|
||||
|
||||
:$ fn(a::string)
|
||||
:$ fn(a::is string)
|
||||
|a
|
||||
|
||||
fn("s")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
:f = ()
|
||||
_
|
||||
:$_+_(a::string, b)
|
||||
:$_+_(a::is string, b)
|
||||
"{a}{b}"
|
||||
|
||||
:a=1
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
:$ -f
|
||||
return("generic minus")
|
||||
|
||||
:$ -f::string
|
||||
:$ -f::is string
|
||||
return("minus "+f)
|
||||
|
||||
|{-5}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue