Дополнительные действия
Это страница документации Модуль:Logic.
API[править код]
-
Программное имя: Logic
Returns the first non-empty value.
{{#iccupdb_datapoint:API_Logic/doc_emptyOr
|type=api
|name=emptyOr
|information=
|image=
|date=
|extradata={{#iccupdb_create_json:
|description=Returns the first non-empty value.
|params=val1: value, val2: value, default: value
|returns=value
|module=Module:Logic
}}
}}
Checks if a value or table is empty.
{{#iccupdb_datapoint:API_Logic/doc_isEmpty
|type=api
|name=isEmpty
|information=
|image=
|date=
|extradata={{#iccupdb_create_json:
|description=Checks if a value or table is empty.
|params=val: any
|returns=boolean
|module=Module:Logic
}}
}}
Checks if a value is numeric.
{{#iccupdb_datapoint:API_Logic/doc_isNumeric
|type=api
|name=isNumeric
|information=
|image=
|date=
|extradata={{#iccupdb_create_json:
|description=Checks if a value is numeric.
|params=val: value
|returns=boolean
|module=Module:Logic
}}
}}
Checks if a value or table is not empty.
{{#iccupdb_datapoint:API_Logic/doc_isNotEmpty
|type=api
|name=isNotEmpty
|information=
|image=
|date=
|extradata={{#iccupdb_create_json:
|description=Checks if a value or table is not empty.
|params=val: any
|returns=boolean
|module=Module:Logic
}}
}}
Returns the first non-nil value. Function arguments are lazily evaluated, providing a way to short-circuit checks.
{{#iccupdb_datapoint:API_Logic/doc_nilOr
|type=api
|name=nilOr
|information=
|image=
|date=
|extradata={{#iccupdb_create_json:
|description=Returns the first non-nil value. Function arguments are lazily evaluated, providing a way to short-circuit checks.
|params=...
|returns=value
|module=Module:Logic
}}
}}
Throws an error if val is nil.
{{#iccupdb_datapoint:API_Logic/doc_nilThrows
|type=api
|name=nilThrows
|information=
|image=
|date=
|extradata={{#iccupdb_create_json:
|description=Throws an error if val is nil.
|params=val: any
|returns=value or error
|module=Module:Logic
}}
}}
Interprets the input as a boolean value (true/false).
{{#iccupdb_datapoint:API_Logic/doc_readBool
|type=api
|name=readBool
|information=
|image=
|date=
|extradata={{#iccupdb_create_json:
|description=Interprets the input as a boolean value (true/false).
|params=val: value
|returns=boolean
|module=Module:Logic
}}
}}
Converts a boolean from its representations (true/false, 1/0, or their string equivalents), or returns nil if not a recognized representation.
{{#iccupdb_datapoint:API_Logic/doc_readBoolOrNil
|type=api
|name=readBoolOrNil
|information=
|image=
|date=
|extradata={{#iccupdb_create_json:
|description=Converts a boolean from its representations (true/false, 1/0, or their string equivalents), or returns nil if not a recognized representation.
|params=val: value
|returns=boolean?
|module=Module:Logic
}}
}}
Attempts to execute the "try" function. If it fails, the "catch" function is executed.
{{#iccupdb_datapoint:API_Logic/doc_tryCatch
|type=api
|name=tryCatch
|information=
|image=
|date=
|extradata={{#iccupdb_create_json:
|description=Attempts to execute the "try" function. If it fails, the "catch" function is executed.
|params=try: function, catch: function
|returns=result or catch result
|module=Module:Logic
}}
}}
Executes the function and captures its result or any error in a ResultOrError instance.
{{#iccupdb_datapoint:API_Logic/doc_try
|type=api
|name=try
|information=
|image=
|date=
|extradata={{#iccupdb_create_json:
|description=Executes the function and captures its result or any error in a ResultOrError instance.
|params=f: function
|returns=ResultOrError
|module=Module:Logic
}}
}}
Посмотрите всю нашу документацию iCCup здесь.