-
Notifications
You must be signed in to change notification settings - Fork 426
/
Copy pathintents.doc.chpl
181 lines (121 loc) · 3.33 KB
/
intents.doc.chpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
module Inner {
/* This function has an argument with the in intent */
proc one (in val) {
}
/* This function has an argument with the out intent */
proc two (out val) {
}
/* This function has an argument with the inout intent */
proc three (inout val) {
}
/* This function has an argument with the param intent */
proc four (param val) {
}
/* This function has an argument with the type intent */
proc five (type val) {
}
/* This function has an argument with the const intent */
proc fiveA (const val) {
}
/* This function has an argument with the ref intent */
proc fiveB (ref val) {
}
/* This function has an argument with an intent and a type */
proc six (in val: int) {
}
/* This function has a return intent of ref */
proc seven () ref {
return "I suppose if I must have a return type here . . . ";
}
/* This function has a return intent of const */
proc eight () const {
}
/* This function has a return intent of param */
proc nine () param {
}
/* This function has a return intent of type */
proc ten () type {
}
/* This function has both an argument and a return intent */
proc twelve (val: int) param {
}
/* This function has both an argument intent and a return intent */
proc thirteen (inout val) ref {
}
/* This function has a return intent (other than ref) and a body */
proc fourteen () const {
return true;
}
}
/* This function has an argument with the in intent */
proc one (in val) {
}
/* This function has an argument with the out intent */
proc two (out val) {
}
/* This function has an argument with the inout intent */
proc three (inout val) {
}
/* This function has an argument with the param intent */
proc four (param val) {
}
/* This function has an argument with the type intent */
proc five (type val) {
}
/* This function has an argument with the const intent */
proc fiveA (const val) {
}
/* This function has an argument with the ref intent */
proc fiveB (ref val) {
}
/* This function has an argument with an intent and a type */
proc six (in val: int) {
}
/* This function has a return intent of ref */
proc seven () ref {
return "I suppose if I must have a return type here . . . ";
}
/* This function has a return intent of const */
proc eight () const {
}
/* This function has a return intent of param */
proc nine () param {
}
/* This function has a return intent of type */
proc ten () type {
}
/* This function has both an argument and a return intent */
proc twelve (val: int) param {
}
/* This function has both an argument intent and a return intent */
proc thirteen (inout val) ref {
}
/* This function has a return intent (other than ref) and a body */
proc fourteen () const {
return true;
}
record foo {
/* this method has a "const" "this" intent */
proc const contains(x: eltType): bool {
return true;
}
/*
This method has a "const ref" "this" intent
*/
proc const ref eighteen {
return false;
}
}
/* I am test fifteen, a test for return intent and type */
proc fifteen(type t) param : int {
return 1;
}
/* I am test sixteen, a test for return intent and type */
proc sixteen(v: int ) param : bool {
return true;
}
/* I am test seventeen, cousin of sixteen,
also a test for return intent and type */
proc seventeen(param q: bool) param : string {
return "yes";
}