utils.go: added IsBool() and IsFract()
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user