Skip to content

Commit 341059b

Browse files
committed
std: A module for working with types
1 parent 1aa38e8 commit 341059b

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

std/type/types.pics

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
2+
// Module: Type
3+
// Provides functions for type checking at runtime
4+
module Type {
5+
6+
7+
// Function: isNumber
8+
// Checks is the value is a Number
9+
//
10+
// Parameters:
11+
// value - The value to check
12+
//
13+
// Returns:
14+
// true when it is a number, false if not
15+
function isNumber(value) = pic_nat_isnumber(value)
16+
17+
18+
19+
20+
// Function: isString
21+
// Checks is the value is a String
22+
//
23+
// Parameters:
24+
// value - The value to check
25+
//
26+
// Returns:
27+
// true when it is a string, false if not
28+
function isString(value) = pic_nat_isstring(value)
29+
30+
31+
32+
// Function: isObject
33+
// Checks is the value is a Object
34+
//
35+
// Parameters:
36+
// value - The value to check
37+
//
38+
// Returns:
39+
// true when it is a object, false if not
40+
function isObject(value) = pic_nat_isobject(value)
41+
42+
43+
44+
// Function: isArray
45+
// Checks is the value is a Array
46+
//
47+
// Parameters:
48+
// value - The value to check
49+
//
50+
// Returns:
51+
// true when it is a array, false if not
52+
function isArray(value) = pic_nat_isarray(value)
53+
54+
55+
56+
// Function: isTuple
57+
// Checks is the value is a Tuple
58+
//
59+
// Parameters:
60+
// value - The value to check
61+
//
62+
// Returns:
63+
// true when it is a tuple, false if not
64+
function isTuple(value) = pic_nat_istuple(value)
65+
66+
67+
68+
}
69+
70+

0 commit comments

Comments
 (0)