Merge
This commit is contained in:
commit
02e7a5b098
1 changed files with 51 additions and 2 deletions
53
std.isbpl
53
std.isbpl
|
@ -35,6 +35,14 @@ native isfloat
|
||||||
native islong
|
native islong
|
||||||
native isdouble
|
native isdouble
|
||||||
|
|
||||||
|
# "call a dynamically computed function" pop
|
||||||
|
# "Please keep in mind that this will throw a native error if" pop
|
||||||
|
# "called incorrectly - this means wrong layer parameter will" pop
|
||||||
|
# "instantly crash the program." pop
|
||||||
|
native _layer_call
|
||||||
|
func call {
|
||||||
|
0 _layer_call
|
||||||
|
}
|
||||||
native include
|
native include
|
||||||
native putchar
|
native putchar
|
||||||
native read
|
native read
|
||||||
|
@ -42,8 +50,6 @@ native flength
|
||||||
native write
|
native write
|
||||||
native type
|
native type
|
||||||
native mktype
|
native mktype
|
||||||
# "call a dynamically computed function" pop
|
|
||||||
native call
|
|
||||||
native typename
|
native typename
|
||||||
native istype
|
native istype
|
||||||
native settype
|
native settype
|
||||||
|
@ -244,3 +250,46 @@ func puts {
|
||||||
str i aget putchar
|
str i aget putchar
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func anewput {
|
||||||
|
def size =size
|
||||||
|
def arr size anew =arr
|
||||||
|
|
||||||
|
def i 0 =i
|
||||||
|
while i size lt {
|
||||||
|
arr swap i swap aput
|
||||||
|
i 1 + =i
|
||||||
|
}
|
||||||
|
|
||||||
|
arr areverse
|
||||||
|
}
|
||||||
|
|
||||||
|
func areverse {
|
||||||
|
def arr =arr
|
||||||
|
def new arr alen anew =new
|
||||||
|
|
||||||
|
def i arr alen 1 - =i
|
||||||
|
def j 0 =j
|
||||||
|
while i 0 lt not {
|
||||||
|
new j arr i aget aput
|
||||||
|
j 1 + =j
|
||||||
|
i 1 - =i
|
||||||
|
}
|
||||||
|
|
||||||
|
new
|
||||||
|
}
|
||||||
|
|
||||||
|
func inc {
|
||||||
|
def varname =varname
|
||||||
|
( varname 1 _layer_call ) # "Get var" pop
|
||||||
|
1 + # "Increment" pop
|
||||||
|
( "=" varname strconcat 1 _layer_call ) # "Store var" pop
|
||||||
|
}
|
||||||
|
|
||||||
|
func dec {
|
||||||
|
def varname =varname
|
||||||
|
( varname 1 _layer_call ) # "Get var" pop
|
||||||
|
1 - # "Decrement" pop
|
||||||
|
( "=" varname strconcat 1 _layer_call ) # "Store var" pop
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue