mirror of
https://github.com/Open-Argon/argon-v3.git
synced 2025-12-06 08:56:07 +00:00
Merge branch 'Open-Argon:master' into master
This commit is contained in:
@@ -11,9 +11,12 @@ func ArThread(args ...any) (any, ArErr) {
|
||||
}
|
||||
var tocall any
|
||||
switch x := args[0].(type) {
|
||||
case Callable:
|
||||
tocall = x
|
||||
case builtinFunc:
|
||||
case anymap:
|
||||
if _, ok := x["__call__"]; !ok {
|
||||
return nil, ArErr{TYPE: "TypeError", message: "Cannot call thread with a '" + typeof(args[0]) + "'", EXISTS: true}
|
||||
}
|
||||
tocall = x["__call__"]
|
||||
case builtinFunc, Callable:
|
||||
tocall = x
|
||||
default:
|
||||
return nil, ArErr{TYPE: "TypeError", message: "Cannot call thread with a '" + typeof(args[0]) + "'", EXISTS: true}
|
||||
|
||||
@@ -12,6 +12,8 @@ func typeof(val any) string {
|
||||
return "string"
|
||||
case []any:
|
||||
return "array"
|
||||
case anymap:
|
||||
return "map"
|
||||
case Callable:
|
||||
return "function"
|
||||
case builtinFunc:
|
||||
|
||||
Reference in New Issue
Block a user