Difference between revisions of "Number type"

From MiniScript Wiki
Jump to navigation Jump to search
(Created page with "<c>funcname</c> Returns a map that represents the number datatype in miniScript's core type system. See also: string; list; map; funcRef === Usage Notes ==...")
 
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<c>funcname</c> Returns a map that represents the number datatype in
+
<c>number</c> returns a map that represents the number datatype in
miniScript's core type system.   
+
MiniScript's core type system.   
  
See also: [[string]]; [[list]]; [[map]]; [[funcRef]]
+
See also: [[string type|string]]; [[list type|list]]; [[map type|map]]; [[funcRef]]
  
 
=== Usage Notes ===
 
=== Usage Notes ===
<c>number type</c> can be used with [[isa]]to check whether a variable refers to a number.  You can also assign new methods here to make them available to all maps(though because of a limitation in MiniScript's parser, such methods do not work on numeric literals).
+
<c>number</c> can be used with [[isa]] to check whether a variable refers to a number.  You can also assign new methods here to make them available to all maps(though because of a limitation in MiniScript's parser, such methods do not work on numeric literals).
  
 
== Example ==
 
== Example ==

Latest revision as of 22:12, 1 November 2020

number returns a map that represents the number datatype in MiniScript's core type system.

See also: string; list; map; funcRef

Usage Notes

number can be used with isa to check whether a variable refers to a number. You can also assign new methods here to make them available to all maps(though because of a limitation in MiniScript's parser, such methods do not work on numeric literals).

Example

42 isa number		// returns 1