You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//This is scope, the SerialX representation of ugp.org.SerialX.Scope!
6
+
//Each scope can have its own variables with values and independant values!
7
+
8
+
//Every scope can read and write parent scopes variables however by changing them, it will only affect local one and not parents one!
9
+
$name; //"app" ($ obtains value "app")
10
+
$name = "no longer app lol!";
11
+
12
+
composition-api = "^1.0.0-beta.21", //This is one of the variables of this scope...
13
+
bootstrap = "^4.5.3",
14
+
time-ago = "^2.3.4",
15
+
something =
16
+
{
17
+
dataStorage =
18
+
{
19
+
//This is "dataStorage" (stored by variable "dataStorage") sub-scope aka nested skope of its parent scope "something" which is subscope of "dependencies",
20
+
xml =
21
+
{
22
+
version = "^2.8.0"
23
+
},
24
+
yaml =
25
+
{
26
+
version = "^1.10.5"
27
+
},
28
+
josn =
29
+
{
30
+
version = "^4.0.0"
31
+
},
32
+
serialx =
33
+
{
34
+
version = "Is the best!"
35
+
}
36
+
},
37
+
ppl =
38
+
{
39
+
//This is "ppl" (stored by variable "ppl") sub-scope aka nested skope of its parent scope "something" which is subscope of "dependencies".
40
+
//All of these scopes are sub-scopes of "ppl", there can be infinite number of variables and independent values together in one Scope!
41
+
vladimir =
42
+
{
43
+
age = 37;
44
+
residence = "russia";
45
+
},
46
+
ivan =
47
+
{
48
+
age = 19;
49
+
residence = "russia";
50
+
},
51
+
filip =
52
+
{
53
+
age = 17;
54
+
residence = "slovak";
55
+
},
56
+
peter =
57
+
{
58
+
age = 17;
59
+
residence = "slovak";
60
+
},
61
+
lukas =
62
+
{
63
+
age = 17;
64
+
residence = "slovak";
65
+
},
66
+
hans =
67
+
{
68
+
age = 51;
69
+
residence = "germany";
70
+
},
71
+
pierre =
72
+
{
73
+
age = 44;
74
+
residence = "france";
75
+
}
76
+
}
77
+
},
78
+
"lololoolollool"; //This is independent value of this scope.
79
+
},
80
+
$dependencies.something.dataStorage.serialx.version; //Obtaining value of "serialx" variable in "dependencies" sub-scopes!
81
+
82
+
devDependencies =
83
+
{
84
+
//Variables in this scope have nothing to do with variables from "dependencies" because they are in diffrent scope!
85
+
$name = "absolutely not app!";
86
+
87
+
composition-api = "^1.0.0-alpha",
88
+
bootstrap = "^2.2.3",
89
+
time-ago = "^1.2.3",
90
+
something =
91
+
{
92
+
dataStorage = {},
93
+
ppl = {}
94
+
}
95
+
};
96
+
97
+
//Variable "bullshit" cant be accessed here yet!
98
+
bullshit =
99
+
{
100
+
//This scope cant access variable that is stored by (bullshit), because variables are always created after its value (Scope in this case) is constructed!
101
+
server = "service server",
102
+
build = "service build",
103
+
lint = "service lint";
104
+
},
105
+
$bullshit; //Now we can access variable "bullshit"
106
+
107
+
$name; //"name" is still "app" in this scope!
108
+
109
+
arr = {1, 2, 3, 4, 5}; //This is scope with only values! So lets call it... array I guess!
110
+
superArr = {$arr, $arr, $arr, $arr::new /*creates clone of arr*/, {1, 2, 3, 4, 5}}; //Yes... this is completely normal and possible in SerialX but keep in mind that first, second and third element will refere to same instance in this case!
0 commit comments