utils.go: added IsBool() and IsFract()
This commit is contained in:
parent
c3198e4c79
commit
9c2eca40d7
10
utils.go
10
utils.go
@ -24,6 +24,11 @@ func IsFloat(v any) (ok bool) {
|
||||
return ok
|
||||
}
|
||||
|
||||
func IsBool(v any) (ok bool) {
|
||||
_, ok = v.(bool)
|
||||
return ok
|
||||
}
|
||||
|
||||
func IsList(v any) (ok bool) {
|
||||
_, ok = v.(*ListType)
|
||||
return ok
|
||||
@ -34,6 +39,11 @@ func IsDict(v any) (ok bool) {
|
||||
return ok
|
||||
}
|
||||
|
||||
func IsFract(v any) (ok bool) {
|
||||
_, ok = v.(*fraction)
|
||||
return ok
|
||||
}
|
||||
|
||||
func IsNumber(v any) (ok bool) {
|
||||
return IsFloat(v) || IsInteger(v)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user