We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 771afb1 commit 03aad2aCopy full SHA for 03aad2a
tests/struct
@@ -3,6 +3,14 @@ include std.cn
3
unpack struct Vector2
4
int x
5
int y
6
+ static
7
+ proc from_array [2] int -> Vector2:
8
+ bind arr:
9
+ 0 arr []
10
+ 1 arr []
11
+ Vector2
12
+ end
13
14
end
15
16
struct (Vector2) AutoVector2
@@ -49,6 +57,13 @@ bind vec:
49
57
50
58
51
59
AutoVector2 .y print
60
+
61
+var arr [2] int
62
+45 0 arr *[] !
63
+123 1 arr *[] !
64
+arr Vector2.from_array
65
+dup .x print
66
+.y print
52
67
:
53
68
69
54
42
@@ -59,3 +74,5 @@ AutoVector2 .y print
74
75
Side effect
76
77
+45
78
+123
0 commit comments