Difference between revisions of "FuncRef"

From MiniScript Wiki
Jump to navigation Jump to search
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<c>funcRef</c> Returns a map that represents a function reference in
+
<c>funcRef</c> returns a map that represents a [[Function#Function_References|function reference]] in
MiniScript's core type system.  This can be used with `isa`
+
MiniScript's core type system.  This can be used with `[[Isa | isa]]`
 
to check whether a variable refers to a function (but be
 
to check whether a variable refers to a function (but be
 
sure to use @ to avoid invoking the function and testing
 
sure to use @ to avoid invoking the function and testing
 
the result).
 
the result).
  
See also: [[number]]; [[string]]; [[list]]; [[map]]
+
See also: [[number type|number]]; [[string type|string]]; [[list type|list]]; [[map type|map]]
  
 
=== Usage Notes ===
 
=== Usage Notes ===
Line 15: Line 15:
  
 
<ms>@floor isa funcRef   // returns 1</ms>
 
<ms>@floor isa funcRef   // returns 1</ms>
[[Category:Intrinsic Functions]]
+
 
 +
== See also ==
 +
 
 +
* The [[Isa | isa ("is a") operator]]
 +
* [[Function#Function_References|Function references]]
 +
 
 +
[[Category:Language]]
 +
[[Category:Data Types]]

Latest revision as of 21:20, 15 February 2024

funcRef returns a map that represents a function reference in MiniScript's core type system. This can be used with ` isa` to check whether a variable refers to a function (but be sure to use @ to avoid invoking the function and testing the result).

See also: number; string; list; map

Usage Notes

funcRef Be sure to use @ to avoid invoking the function and testing the result.

Example

@floor isa funcRef	  // returns 1

See also