Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 772 lines (491 sloc) 16.906 kB
2d9eff4 [cage] Updating copyright in whole repository to Parrot Foundation.
allison authored
1 # Copyright (C) 2001-2007, Parrot Foundation.
ef1f1b9 Start in on skeleton of compiler writer's FAQ
dan authored
2 # $Id$
3
4 =head1 NAME
5
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
6 docs/compiler_faq.pod - Parrot FAQ for compiler writers in PIR
ef1f1b9 Start in on skeleton of compiler writer's FAQ
dan authored
7
7ab7c26 Make the FAQ intentions clearer
dan authored
8 =head1 General Questions
9
10 =head2 Which C compilers can I use with Parrot?
11
12 Whoa, there--you're looking at the wrong FAQ. This document is for people
13 writing compilers that target Parrot.
14
15 To answer your question, though, Parrot should theoretically work with any
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
16 C89-compliant C compiler. See the F<README> files in the root directory for
17 more information about building Parrot.
7ab7c26 Make the FAQ intentions clearer
dan authored
18
644f3d9 Patch #30694, two questions and one answer from TOGoS.
chromatic authored
19 =head2 How can I implement a compiler to use as a compiler object from within
bf46ef8 #52720: [TODO] Update documentation of the compreg opcode
bernhard authored
20 Parrot?
bb002d0 Answer a FAQ about C<compile>
coke authored
21
bf46ef8 #52720: [TODO] Update documentation of the compreg opcode
bernhard authored
22 See L<http://www.parrotblog.org/2008/03/targeting-parrot-vm.html>.
764eff1 Update compiler_faq.pod
leo authored
23
28a78de cleanup
coke authored
24 =head2 How do I embed source locations in my code for debugging?
764eff1 Update compiler_faq.pod
leo authored
25
f2275a8 [docs] Update changed syntax for ".line" directive.
allison authored
26 Use C<.line 42 "file.pir"> for this.
644f3d9 Patch #30694, two questions and one answer from TOGoS.
chromatic authored
27
1569817 More questions for the FAQ
dan authored
28 =head1 Subroutines
ef1f1b9 Start in on skeleton of compiler writer's FAQ
dan authored
29
1569817 More questions for the FAQ
dan authored
30 =head2 How do I generate a sub call in PIR?
ef1f1b9 Start in on skeleton of compiler writer's FAQ
dan authored
31
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
32 This looks like a function call in many HLLs:
c4f6237 Lexical and function calling answers from TOGoS (bug #29674).
chromatic authored
33
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
34 =begin PIR_FRAGMENT
35
c4f6237 Lexical and function calling answers from TOGoS (bug #29674).
chromatic authored
36 $P0( $P1, $P2, $P3 )
37
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
38 =end PIR_FRAGMENT
39
524fe95 Update compiler_faq and pcc tests
leo authored
40 where $P0 is the function object, and $P1, $P2, and $P3 are its
1b34de4 remove reference to old syntax
coke authored
41 parameters. You can also use a function's name in place of the
42 object, as long as it's in the same namespace.
c4f6237 Lexical and function calling answers from TOGoS (bug #29674).
chromatic authored
43
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
44 =begin PIR_FRAGMENT
45
c4f6237 Lexical and function calling answers from TOGoS (bug #29674).
chromatic authored
46 somefunctionlabel( $P1, $P2, $P3 )
47
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
48 =end PIR_FRAGMENT
49
c4f6237 Lexical and function calling answers from TOGoS (bug #29674).
chromatic authored
50 You can also get return value(s):
51
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
52 =begin PIR_FRAGMENT
53
332ec4c update compiler_faq; bits of #29943
leo authored
54 ($P1,$P2) = $P0( $P1, $P2, $P3 )
c4f6237 Lexical and function calling answers from TOGoS (bug #29674).
chromatic authored
55
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
56 =end PIR_FRAGMENT
57
524fe95 Update compiler_faq and pcc tests
leo authored
58 If the function name might collide with a Parrot opcode, quote it:
59
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
60 =begin PIR_FRAGMENT
61
62 .local int i
28a78de cleanup
coke authored
63 i = 'new'(42)
524fe95 Update compiler_faq and pcc tests
leo authored
64
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
65 =end PIR_FRAGMENT
66
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
67 You can also use the full PCC for these calls. See
088256f #60364 [PATCH] pod fixes: L<draft/pdd19_pid.pod>, typos, syntax
bernhard authored
68 L<docs/pdd19_pir.pod/Parameter Passing and Getting Flags> and other
5134a74 [docs] Typos in docs/*.pod
Util authored
69 questions below for more information.
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
70
1569817 More questions for the FAQ
dan authored
71 =head2 How do I generate a method call in PIR?
72
28a78de cleanup
coke authored
73 Similar to function calls, just append C<.> and the method name to the object.
74 You should quote a literal method name to avoid confusion.
954038e more answers and questions
leo authored
75
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
76 =begin PIR_FRAGMENT
77
78 .local pmc ret_val, some_obj, arg
28a78de cleanup
coke authored
79 ret_val = some_obj.'some_meth'(arg)
954038e more answers and questions
leo authored
80
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
81 =end PIR_FRAGMENT
82
954038e more answers and questions
leo authored
83 The method name may also be a string variable representing a method name:
84
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
85 =begin PIR_FRAGMENT
86
954038e more answers and questions
leo authored
87 .local string m
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
88 .local pmc curses_obj
28a78de cleanup
coke authored
89 m = 'bold'
954038e more answers and questions
leo authored
90 curses_obj.m()
91
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
92 =end PIR_FRAGMENT
93
5b8e35b [Docs] Minor corrections.
chromatic authored
94 =head2 How do I locate or create a subroutine object?
524fe95 Update compiler_faq and pcc tests
leo authored
95
96 There are several ways to achieve this, depending on the location of
97 the subroutine.
98
cd0e6a2 [cage] More documentation updates to remove references to "compilatio…
allison authored
99 If the sub is in the same file use a Sub constant:
524fe95 Update compiler_faq and pcc tests
leo authored
100
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
101 =begin PIR_FRAGMENT
102
af5ddb5 [docs] change .Sub into 'Sub'
kjs authored
103 .const 'Sub' foo = 'foo'
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
104 # ...
524fe95 Update compiler_faq and pcc tests
leo authored
105 foo()
106
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
107 =end PIR_FRAGMENT
108
524fe95 Update compiler_faq and pcc tests
leo authored
109 A more dynamic way is:
110
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
111 =begin PIR_FRAGMENT
112
524fe95 Update compiler_faq and pcc tests
leo authored
113 .local pmc foo
28a78de cleanup
coke authored
114 foo = find_name 'foo'
524fe95 Update compiler_faq and pcc tests
leo authored
115
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
116 =end PIR_FRAGMENT
117
28a78de cleanup
coke authored
118 This searches for a subroutine 'foo' in the current lexical pad, in
524fe95 Update compiler_faq and pcc tests
leo authored
119 the current namespace, in the global, and in the builtin namespace in
120 that order. This opcode is generated, if I<foo()> is used, but the
121 compiler can't figure out, where the function is.
122
a9ce9b4 * docs/compiler_faq.pod:
rgrjr authored
123 If the subroutine is in a different namespace, use the
124 C<get_hll_global> or C<get_root_global> opcodes:
524fe95 Update compiler_faq and pcc tests
leo authored
125
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
126 =begin PIR_FRAGMENT
127
128 .local pmc foo
a9ce9b4 * docs/compiler_faq.pod:
rgrjr authored
129 foo = get_root_global ['Foo'], 'foo'
524fe95 Update compiler_faq and pcc tests
leo authored
130
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
131 =end PIR_FRAGMENT
132
a9ce9b4 * docs/compiler_faq.pod:
rgrjr authored
133 This fetches the sub C<foo> in the C<Foo> namespace.
524fe95 Update compiler_faq and pcc tests
leo authored
134
5b8e35b [Docs] Minor corrections.
chromatic authored
135 =head2 How do I create a Closure or Coroutine?
524fe95 Update compiler_faq and pcc tests
leo authored
136
6b7558b #42300: [PATCH] t/pmc/sub.t: test for creation of lex by clone op
bernhard authored
137 Closure and Coroutine carry both a dynamic state.
138 Therefore you need to perform two steps.
139 First use one of the above ways to locate the Sub object.
140 Then use the op C<newclosure> to capture the environment.
524fe95 Update compiler_faq and pcc tests
leo authored
141
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
142 =begin PIR_FRAGMENT
143
524fe95 Update compiler_faq and pcc tests
leo authored
144 .local pmc coro
28a78de cleanup
coke authored
145 coro = find_name 'my_coro'
6b7558b #42300: [PATCH] t/pmc/sub.t: test for creation of lex by clone op
bernhard authored
146 coro = newclosure coro
524fe95 Update compiler_faq and pcc tests
leo authored
147
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
148 =end PIR_FRAGMENT
149
524fe95 Update compiler_faq and pcc tests
leo authored
150 Any subroutine that contains a C<.yield> directive is automatically
151 created as a Coroutine PMC:
152
b2ca398 First pass at RT# 41765 - test examples in pod.
coke authored
153 =begin PIR
79c66e3 [book] fix POD format
fperrad authored
154
524fe95 Update compiler_faq and pcc tests
leo authored
155 .sub my_coro # automagically a Coroutine PMC
b2ca398 First pass at RT# 41765 - test examples in pod.
coke authored
156 .param pmc result
157 #...
524fe95 Update compiler_faq and pcc tests
leo authored
158 .yield (result)
b2ca398 First pass at RT# 41765 - test examples in pod.
coke authored
159 #...
524fe95 Update compiler_faq and pcc tests
leo authored
160 .end
79c66e3 [book] fix POD format
fperrad authored
161
b2ca398 First pass at RT# 41765 - test examples in pod.
coke authored
162 =end PIR
524fe95 Update compiler_faq and pcc tests
leo authored
163
5829e44 This patch is huge because of all the whitespace reformatting. This was
bernhard authored
164 =head2 How do I generate a tail call in PIR?
764eff1 Update compiler_faq.pod
leo authored
165
b2ca398 First pass at RT# 41765 - test examples in pod.
coke authored
166 =begin PIR
79c66e3 [book] fix POD format
fperrad authored
167
764eff1 Update compiler_faq.pod
leo authored
168 .sub foo
b2ca398 First pass at RT# 41765 - test examples in pod.
coke authored
169 # ...
415df65 [pod] fix usage of .tailcall
fperrad authored
170 .tailcall bar(42) # tail call sub bar
764eff1 Update compiler_faq.pod
leo authored
171 .end
172
173 .sub bar
b2ca398 First pass at RT# 41765 - test examples in pod.
coke authored
174 .param int answer
175 inc answer
176 .return(answer)
764eff1 Update compiler_faq.pod
leo authored
177 .end
79c66e3 [book] fix POD format
fperrad authored
178
b2ca398 First pass at RT# 41765 - test examples in pod.
coke authored
179 =end PIR
764eff1 Update compiler_faq.pod
leo authored
180
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
181 The sub C<bar> will return to the caller of C<foo>. (Warning! This fails
4d6eae7 avoid redundancy, don't use title when we mean number, and pick tag f…
coke authored
182 in some cases. XXX Find the Trac ticket and reference it here.)
764eff1 Update compiler_faq.pod
leo authored
183
4a6673a While discussion continues on p2, pod files should be at most
ambs authored
184 =head2 How do I generate a sub call with a variable-length parameter
185 list in PIR?
1569817 More questions for the FAQ
dan authored
186
524fe95 Update compiler_faq and pcc tests
leo authored
187 If you have a variable amounts of arguments in an array, you can
188 pass all items of that array with the C<:flat> directive.
332ec4c update compiler_faq; bits of #29943
leo authored
189
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
190 =begin PIR_FRAGMENT
191
192 .local pmc ar, foo
7bc13b5 [OO] Changed more PMC creation from constant syntax to string style.
chromatic authored
193 ar = new 'ResizablePMCArray'
332ec4c update compiler_faq; bits of #29943
leo authored
194 push ar, "arg 1\n"
195 push ar, "arg 2\n"
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
196 #...
524fe95 Update compiler_faq and pcc tests
leo authored
197 foo(ar :flat)
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
198 #...
199
200 =end PIR_FRAGMENT
954038e more answers and questions
leo authored
201
4a6673a While discussion continues on p2, pod files should be at most
ambs authored
202 =head2 How to I retrieve the contents of a variable-length parameter
203 list being passed to me?
1569817 More questions for the FAQ
dan authored
204
524fe95 Update compiler_faq and pcc tests
leo authored
205 Use a slurpy array:
332ec4c update compiler_faq; bits of #29943
leo authored
206
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
207 =begin PIR
208
524fe95 Update compiler_faq and pcc tests
leo authored
209 .sub mysub
210 .param pmc argv :slurpy
332ec4c update compiler_faq; bits of #29943
leo authored
211 .local int argc
212 argc = argv
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
213 #...
214 .end
215
216 =end PIR
332ec4c update compiler_faq; bits of #29943
leo authored
217
524fe95 Update compiler_faq and pcc tests
leo authored
218 If you have a few fixed parameters too, you can use a slurpy array
219 to get the rest of the arguments
332ec4c update compiler_faq; bits of #29943
leo authored
220
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
221 =begin PIR
222
524fe95 Update compiler_faq and pcc tests
leo authored
223 .sub mysub
332ec4c update compiler_faq; bits of #29943
leo authored
224 .param pmc arg0
225 .param pmc arg1
524fe95 Update compiler_faq and pcc tests
leo authored
226 .param pmc varargs :slurpy
332ec4c update compiler_faq; bits of #29943
leo authored
227 .local int num_varargs
228 num_varargs = varargs
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
229 # ...
230 .end
231
232 =end PIR
954038e more answers and questions
leo authored
233
5b8e35b [Docs] Minor corrections.
chromatic authored
234 =head2 How do I pass optional arguments?
524fe95 Update compiler_faq and pcc tests
leo authored
235
236 Use the C<:optional> and C<:opt_flag> pragmas:
237
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
238 =begin PIR
239
524fe95 Update compiler_faq and pcc tests
leo authored
240 .sub foo
241 .param pmc arg1 :optional
242 .param int has_arg1 :opt_flag
243 .param pmc arg2 :optional
244 .param int has_arg2 :opt_flag
245
246 if has_arg1 goto got_arg1
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
247 #...
248 .end
249
250 =end PIR
524fe95 Update compiler_faq and pcc tests
leo authored
251
954038e more answers and questions
leo authored
252 =head2 How do I create nested subroutines?
253
29a6220 [docs] .get_results for exception handling only receives the exceptio…
kjs authored
254 Please refer to
255 L<docs/pdds/pdd20_lexical_vars.pod/Nested Subroutines Have Outies; the ":outer" attribute>
088256f #60364 [PATCH] pod fixes: L<draft/pdd19_pid.pod>, typos, syntax
bernhard authored
256 for details.
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
257
1569817 More questions for the FAQ
dan authored
258 =head1 Variables
ef1f1b9 Start in on skeleton of compiler writer's FAQ
dan authored
259
260 =head2 How do I fetch a variable from the global namespace?
261
18d19c2 Remove reference to long-gone syntax.
coke authored
262 Use the C<get_root_global> or C<get_hll_global> op:
c4f6237 Lexical and function calling answers from TOGoS (bug #29674).
chromatic authored
263
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
264 =begin PIR_FRAGMENT
265
a9ce9b4 * docs/compiler_faq.pod:
rgrjr authored
266 get_hll_global $P0, ['name'; 'space'], 'name_of_the_global'
267 get_hll_global $P1, 'name_of_the_global'
954038e more answers and questions
leo authored
268
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
269 =end PIR_FRAGMENT
270
5b8e35b [Docs] Minor corrections.
chromatic authored
271 =head2 How can I delete a global?
764eff1 Update compiler_faq.pod
leo authored
272
3f8d71b Deprecate interpinfo .INTERPINFO_NAMESPACE_ROOT
mdiep authored
273 You can retrieve the namespace hash and use the C<delete> opcode.
764eff1 Update compiler_faq.pod
leo authored
274
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
275 =begin PIR
276
a9ce9b4 * docs/compiler_faq.pod:
rgrjr authored
277 .sub main :main
29a6220 [docs] .get_results for exception handling only receives the exceptio…
kjs authored
278 $P0 = new 'Integer'
279 $P0 = 42
280 set_hll_global 'foo', $P0
281 set_hll_global ['Bar'], 'baz', $P0
282 show_baz()
283 .local pmc ns, Bar_ns
284 ns = get_hll_namespace
285 delete ns['foo'] # delete from top level
286 Bar_ns = ns['Bar'] # get Bar namespace
287 delete Bar_ns['baz']
288 show_baz()
a9ce9b4 * docs/compiler_faq.pod:
rgrjr authored
289 .end
290 .sub show_baz
29a6220 [docs] .get_results for exception handling only receives the exceptio…
kjs authored
291 $P0 = get_hll_global ['Bar'], 'baz'
292 print "'baz' is "
293 if null $P0 goto is_null
294 print $P0
295 print ".\n"
296 .return ()
297 is_null:
298 print "null.\n"
a9ce9b4 * docs/compiler_faq.pod:
rgrjr authored
299 .end
764eff1 Update compiler_faq.pod
leo authored
300
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
301 =end PIR
764eff1 Update compiler_faq.pod
leo authored
302
4a6673a While discussion continues on p2, pod files should be at most
ambs authored
303 =head2 How do I use lexical pads to have both a function scope and a
304 global scope?
21596cd More questions for the FAQ
dan authored
305
70b600c more updates to compiler_faq.pod WRT lexicals
leo authored
306 Please refer to L<docs/pdds/pdd20_lexical_vars.pod> for details.
c4f6237 Lexical and function calling answers from TOGoS (bug #29674).
chromatic authored
307
2e6effb * remove the actively obsoleted part in compiler_faq about
autrijus authored
308 =head2 How can I delete a lexical variable?
c4f6237 Lexical and function calling answers from TOGoS (bug #29674).
chromatic authored
309
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
310 You can't. You can store a PMCNULL as the value though, which will catch all
311 further access to that variable and throw an exception. (You can create
312 a PMCNULL with the C<null> opcode.)
764eff1 Update compiler_faq.pod
leo authored
313
1404b5a * add find_name and "new_pad -1" to compiler_faq.pod
autrijus authored
314 =head2 How do I resolve a variable name?
315
316 Use C<find_name>:
317
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
318 =begin PIR_FRAGMENT
319
28a78de cleanup
coke authored
320 $P0 = find_name '$x'
321 find_name $P0, 'foo' # same thing
1404b5a * add find_name and "new_pad -1" to compiler_faq.pod
autrijus authored
322
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
323 =end PIR_FRAGMENT
324
79d74ba Fixed a few typos and formatting errors.
chromatic authored
325 This will find the name C<foo> in the lexical, global, or builtin namespace, in
326 that order, and store it in C<$P0>.
1404b5a * add find_name and "new_pad -1" to compiler_faq.pod
autrijus authored
327
ef1f1b9 Start in on skeleton of compiler writer's FAQ
dan authored
328 =head2 How do I fetch a variable from the current lexical pad?
329
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
330 =begin PIR_FRAGMENT
331
28a78de cleanup
coke authored
332 find_lex $P0, 'foo'
c4f6237 Lexical and function calling answers from TOGoS (bug #29674).
chromatic authored
333
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
334 =end PIR_FRAGMENT
335
70b600c more updates to compiler_faq.pod WRT lexicals
leo authored
336 or much better, if possible just use the variable defined along with
28a78de cleanup
coke authored
337 the C<.lex> definition of C<foo>.
c4f6237 Lexical and function calling answers from TOGoS (bug #29674).
chromatic authored
338
954038e more answers and questions
leo authored
339 =head2 How do I fetch a variable from any nesting depth?
340
70b600c more updates to compiler_faq.pod WRT lexicals
leo authored
341 That is still the same:
954038e more answers and questions
leo authored
342
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
343 =begin PIR_FRAGMENT
344
28a78de cleanup
coke authored
345 find_lex $P0, 'foo'
954038e more answers and questions
leo authored
346
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
347 =end PIR_FRAGMENT
348
70b600c more updates to compiler_faq.pod WRT lexicals
leo authored
349 This finds a C<foo> variable at any B<outer> depth starting from the top.
954038e more answers and questions
leo authored
350
79d74ba Fixed a few typos and formatting errors.
chromatic authored
351 If your language looks up variables differently, you have to walk the
042d33a [perl #38235] Rename (dyn)?classes to (dyn)?pmc
bernhard authored
352 'caller' chain. See also F<t/dynpmc/dynlexpad.t>.
954038e more answers and questions
leo authored
353
70b600c more updates to compiler_faq.pod WRT lexicals
leo authored
354 =head2 How can I produce more efficient code for lexicals?
954038e more answers and questions
leo authored
355
70b600c more updates to compiler_faq.pod WRT lexicals
leo authored
356 Don't emit C<store_lex> at all. Use C<find_lex> only if the compiler
357 doesn't know the variable. You can always just use the register that was
c8c8de8 Typo fix
gregor authored
358 defined in the C<.lex> directive as an alias to that lexical, if you are in
70b600c more updates to compiler_faq.pod WRT lexicals
leo authored
359 the same scope.
954038e more answers and questions
leo authored
360
c4f6237 Lexical and function calling answers from TOGoS (bug #29674).
chromatic authored
361 =head1 Modules, Classes, and Objects
1569817 More questions for the FAQ
dan authored
362
363 =head2 How do I create a module?
364
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
365 XXX
90e09bd Fixed some POD formatting errors.
chromatic authored
366
1569817 More questions for the FAQ
dan authored
367 =head2 How do I create a class?
368
f4b2c21 answered some questions
jrieks authored
369 With the C<newclass> op:
370
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
371 =begin PIR_FRAGMENT
372
28a78de cleanup
coke authored
373 newclass $P0, 'Animal'
f4b2c21 answered some questions
jrieks authored
374
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
375 =end PIR_FRAGMENT
376
764eff1 Update compiler_faq.pod
leo authored
377 =head2 How do I add instance variables/attributes?
378
79d74ba Fixed a few typos and formatting errors.
chromatic authored
379 Each class knows which attributes its objects can have. You can add attributes
380 to a class (not to individual objects) like so:
764eff1 Update compiler_faq.pod
leo authored
381
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
382 =begin PIR_FRAGMENT
383
28a78de cleanup
coke authored
384 addattribute $P0, 'legs'
764eff1 Update compiler_faq.pod
leo authored
385
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
386 =end PIR_FRAGMENT
387
c4f6237 Lexical and function calling answers from TOGoS (bug #29674).
chromatic authored
388 =head2 How do I add instance methods to a class?
389
5b8e35b [Docs] Minor corrections.
chromatic authored
390 Methods are declared as functions in the class namespace with the C<:method>
5829e44 This patch is huge because of all the whitespace reformatting. This was
bernhard authored
391 keyword appended to the function declaration:
954038e more answers and questions
leo authored
392
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
393 =begin PIR
394
28a78de cleanup
coke authored
395 .namespace [ 'Animal' ]
954038e more answers and questions
leo authored
396
5b8e35b [Docs] Minor corrections.
chromatic authored
397 .sub run :method
28a78de cleanup
coke authored
398 print "slow and steady\n"
399 .end
400
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
401 =end PIR
402
28a78de cleanup
coke authored
403 =head2 How do I override a vtable on a class?
404
405 As with methods, but note the new keyword. The vtable name specified B<must>
406 be an existing vtable slot.
407
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
408 =begin PIR
409
28a78de cleanup
coke authored
410 .namespace [ 'NearlyPi' ]
411
412 .sub get_string :vtable
413 .return ('three and a half')
954038e more answers and questions
leo authored
414 .end
415
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
416 =end PIR
417
28a78de cleanup
coke authored
418 Now, given an instance of NearlyPi in $P0
419
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
420 =begin PIR_FRAGMENT
421
28a78de cleanup
coke authored
422 $S0 = $P0
423 say $S0 # prints 'three and a half'
424
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
425 =end PIR_FRAGMENT
426
764eff1 Update compiler_faq.pod
leo authored
427 =head2 How do I access attributes?
c4f6237 Lexical and function calling answers from TOGoS (bug #29674).
chromatic authored
428
28a78de cleanup
coke authored
429 You can access attributes by a short name:
c4f6237 Lexical and function calling answers from TOGoS (bug #29674).
chromatic authored
430
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
431 =begin PIR_FRAGMENT_INVALID
432
28a78de cleanup
coke authored
433 $P0 = getattribute self, 'legs'
764eff1 Update compiler_faq.pod
leo authored
434 assign $P0, 4 # set attribute's value
c4f6237 Lexical and function calling answers from TOGoS (bug #29674).
chromatic authored
435
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
436 =end PIR_FRAGMENT_INVALID
954038e more answers and questions
leo authored
437
c4f6237 Lexical and function calling answers from TOGoS (bug #29674).
chromatic authored
438 =head2 When should I use properties vs. attributes?
439
524fe95 Update compiler_faq and pcc tests
leo authored
440 Properties aren't inherited. If you have some additional data that
79d74ba Fixed a few typos and formatting errors.
chromatic authored
441 don't fit into the class's hierarchy, you could use properties.
954038e more answers and questions
leo authored
442
f4b2c21 answered some questions
jrieks authored
443 =head2 How do I create a class that is a subclass of another class?
444
524fe95 Update compiler_faq and pcc tests
leo authored
445 You first have to get the class PMC of the class you want to subclass.
446 Either you use the PMC returned by the C<newclass> op if you created
f24fa74 Replaced getclass with get_class except where it falls afoul of the P…
chromatic authored
447 the class, or use the C<get_class> op:
f4b2c21 answered some questions
jrieks authored
448
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
449 =begin PIR_FRAGMENT
450
f24fa74 Replaced getclass with get_class except where it falls afoul of the P…
chromatic authored
451 get_class $P0, 'Animal'
954038e more answers and questions
leo authored
452
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
453 =end PIR_FRAGMENT
454
524fe95 Update compiler_faq and pcc tests
leo authored
455 Then you can use the C<subclass> op to create a new class that is a
456 subclass of this class:
f4b2c21 answered some questions
jrieks authored
457
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
458 =begin PIR_FRAGMENT
459
28a78de cleanup
coke authored
460 subclass $P1, $P0, 'Dog'
f4b2c21 answered some questions
jrieks authored
461
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
462 =end PIR_FRAGMENT
463
954038e more answers and questions
leo authored
464 This stores the newly created class PMC in $P1.
f4b2c21 answered some questions
jrieks authored
465
466 =head2 How do I create a class that has more than one parent class?
467
524fe95 Update compiler_faq and pcc tests
leo authored
468 First, create a class without a parent class using C<newclass> (or
469 with only one subclass, see previous question). Then add the other
470 parent classes to it. Please refer to the next question for an
471 example.
f4b2c21 answered some questions
jrieks authored
472
473 =head2 How do I add another parent class to my class?
474
524fe95 Update compiler_faq and pcc tests
leo authored
475 If you have a class PMC (created with C<newclass> or by C<subclass>),
476 you can add more parent classes to it with the C<addparent> op:
f4b2c21 answered some questions
jrieks authored
477
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
478 =begin PIR_FRAGMENT
479
f24fa74 Replaced getclass with get_class except where it falls afoul of the P…
chromatic authored
480 get_class $P1, 'Dog'
28a78de cleanup
coke authored
481 subclass $P2, $P1, 'SmallDog'
f24fa74 Replaced getclass with get_class except where it falls afoul of the P…
chromatic authored
482 get_class $P3, 'Pet'
954038e more answers and questions
leo authored
483 addparent $P2, $P3 # make "SmallDog" also a "Pet"
f4b2c21 answered some questions
jrieks authored
484
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
485 =end PIR_FRAGMENT
486
f4b2c21 answered some questions
jrieks authored
487 =head2 How can I specify the constructor of a class?
488
28a78de cleanup
coke authored
489 Just override the init vtable for that class.
764eff1 Update compiler_faq.pod
leo authored
490
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
491 =begin PIR
492
493 .sub _ :main
494 newclass $P0, 'Dog' # create a class named Dog
495 .end
764eff1 Update compiler_faq.pod
leo authored
496
28a78de cleanup
coke authored
497 .namespace ['Dog']
764eff1 Update compiler_faq.pod
leo authored
498
28a78de cleanup
coke authored
499 .sub init :vtable
764eff1 Update compiler_faq.pod
leo authored
500 # ...
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
501 .end
502
503 =end PIR
764eff1 Update compiler_faq.pod
leo authored
504
524fe95 Update compiler_faq and pcc tests
leo authored
505 Or you can specify the constructor method by setting the BUILD
506 property of the class PMC:
f4b2c21 answered some questions
jrieks authored
507
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
508 =begin PIR_FRAGMENT
509
28a78de cleanup
coke authored
510 newclass $P0, 'Dog' # create a class named Dog
7bc13b5 [OO] Changed more PMC creation from constant syntax to string style.
chromatic authored
511 new $P1, 'String' # create a string
28a78de cleanup
coke authored
512 set $P1, 'initialise' # set it to the name of the constructor method
513 setprop $P0, 'BUILD', $P1 # set the BUILD property
f4b2c21 answered some questions
jrieks authored
514
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
515 =end PIR_FRAGMENT
516
954038e more answers and questions
leo authored
517 =head2 How do I instantiate a class?
518
a4ae02a [pdd15oo] Merging the pdd15oo branch at r22176 back into trunk.
allison authored
519 You can do so either with the class name:
954038e more answers and questions
leo authored
520
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
521 =begin PIR_FRAGMENT
522
a4ae02a [pdd15oo] Merging the pdd15oo branch at r22176 back into trunk.
allison authored
523 new $P0, 'Dog'
954038e more answers and questions
leo authored
524
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
525 =end PIR_FRAGMENT
526
a4ae02a [pdd15oo] Merging the pdd15oo branch at r22176 back into trunk.
allison authored
527 or with the class object:
764eff1 Update compiler_faq.pod
leo authored
528
67aa36c merge ops_massacre
plobsing authored
529 =begin PIR_FRAGMENT_INVALID
530
531 .loadlib 'io_ops'
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
532
93911ce add NCI stuff to compiler faq.
kjs authored
533 $P1 = get_class 'Dog' # find the 'Dog' class
a4ae02a [pdd15oo] Merging the pdd15oo branch at r22176 back into trunk.
allison authored
534 unless null $P1 goto have_dog_class
535 printerr "Oops; can't find the 'Dog' class.\n"
536 .return ()
537 have_dog_class:
538 new $P0, $P1 # creates a Dog object and stores it in register $P0
539
67aa36c merge ops_massacre
plobsing authored
540 =end PIR_FRAGMENT_INVALID
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
541
a4ae02a [pdd15oo] Merging the pdd15oo branch at r22176 back into trunk.
allison authored
542 The chief difference is that using a string constant will produce the
543 specific error "Class 'Dog' not found" if that happens to be the case;
544 the other code has to check explicitly.
764eff1 Update compiler_faq.pod
leo authored
545
954038e more answers and questions
leo authored
546 During the C<new> opcode the constructor is called.
547
5b8e35b [Docs] Minor corrections.
chromatic authored
548 =head2 How can I pass arguments to a constructor?
f4b2c21 answered some questions
jrieks authored
549
524fe95 Update compiler_faq and pcc tests
leo authored
550 You can pass only a single argument to a constructor. By convention,
551 a hash PMC is passed to the constructor that contains the arguments as
552 key/value pairs:
f4b2c21 answered some questions
jrieks authored
553
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
554 =begin PIR_FRAGMENT
555
7bc13b5 [OO] Changed more PMC creation from constant syntax to string style.
chromatic authored
556 new $P0, 'Hash'
28a78de cleanup
coke authored
557 set $P0['greeting'], 'hello'
558 set $P0['size'], 1.23
954038e more answers and questions
leo authored
559
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
560 new $P1, 'Alien', $P0 # create an Alien object and pass
f4b2c21 answered some questions
jrieks authored
561 # the hash to the constructor
562
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
563 =end PIR_FRAGMENT
564
c4f6237 Lexical and function calling answers from TOGoS (bug #29674).
chromatic authored
565 =head2 How do I add module/class methods?
566
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
567 XXX
90e09bd Fixed some POD formatting errors.
chromatic authored
568
1569817 More questions for the FAQ
dan authored
569 =head2 How do I access module/class variables?
570
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
571 XXX
90e09bd Fixed some POD formatting errors.
chromatic authored
572
c580dc0 Add some docs for exceptions.
mdiep authored
573 =head1 Exceptions
574
575 =head2 How do I throw an exception in PIR?
576
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
577 The easiest way is the perl-like
c580dc0 Add some docs for exceptions.
mdiep authored
578
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
579 =begin PIR_FRAGMENT
580
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
581 die 'Eeeek!'
c580dc0 Add some docs for exceptions.
mdiep authored
582
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
583 =end PIR_FRAGMENT
584
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
585 You can also explicitly create an exception object and throw it:
c580dc0 Add some docs for exceptions.
mdiep authored
586
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
587 =begin PIR_FRAGMENT
588
7bc13b5 [OO] Changed more PMC creation from constant syntax to string style.
chromatic authored
589 $P0 = new 'Exception'
ec6e798 [pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.
allison authored
590 $P0 = 'something happened'
591 throw $P0
c580dc0 Add some docs for exceptions.
mdiep authored
592
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
593 =end PIR_FRAGMENT
594
c580dc0 Add some docs for exceptions.
mdiep authored
595 =head2 How do I catch an exception in PIR?
596
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
597 Use C<push_eh> to push an exception handler onto the stack. End the set of
5134a74 [docs] Typos in docs/*.pod
Util authored
598 instructions that might throw the exception you're interested in with
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
599 C<pop_eh>.
c580dc0 Add some docs for exceptions.
mdiep authored
600
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
601 =begin PIR_FRAGMENT
602
c580dc0 Add some docs for exceptions.
mdiep authored
603 push_eh handler
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
604 die 'whoops' # or any other code that might throw an exception...
5ebf40f [exceptions] Adds pop_eh and push_eh_p
tewk authored
605 pop_eh
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
606 # ok
607
608 =end PIR_FRAGMENT
764eff1 Update compiler_faq.pod
leo authored
609
29a6220 [docs] .get_results for exception handling only receives the exceptio…
kjs authored
610 An exception handler is called with one argument, which is the exception object.
611 The message of the exception can be easily extracted, as follows:
9b289e4 update compiler_faq.pod WRT get_results in exception handlers
leo authored
612
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
613 =begin PIR_FRAGMENT
614
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
615 handler: # exception
29a6220 [docs] .get_results for exception handling only receives the exceptio…
kjs authored
616 .get_results ($P0)
28a78de cleanup
coke authored
617 print 'Exception caught:'
29a6220 [docs] .get_results for exception handling only receives the exceptio…
kjs authored
618 $S0 = $P0['message']
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
619 say $S0
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
620
621 =end PIR_FRAGMENT
c580dc0 Add some docs for exceptions.
mdiep authored
622
a66828b Resolve ticket #41764 ([PATCH] teach differentiation of C<exit 1> in …
coke authored
623 =head2 How do I let exceptions from C<exit> pass through my handler?
624
625 Rethrow the exception if it has a severity of C<EXCEPT_EXIT>.
626
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
627 =begin PIR_FRAGMENT
628
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
629 .include 'except_severity.pasm'
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
630 # ...
a66828b Resolve ticket #41764 ([PATCH] teach differentiation of C<exit 1> in …
coke authored
631 handler:
29a6220 [docs] .get_results for exception handling only receives the exceptio…
kjs authored
632 .get_results ($P0)
ec6e798 [pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.
allison authored
633 $I0 = $P0['severity']
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
634 if $I0 == .EXCEPT_EXIT goto handle_exit
635 say 'Exception caught!'
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
636 # ...
764eff1 Update compiler_faq.pod
leo authored
637
ec6e798 [pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.
allison authored
638 handle_exit:
ed64c49 [DOCS] remove reference to chip-as-architect; assume our developers k…
coke authored
639 rethrow $P0 # let the next handler deal with it.
c580dc0 Add some docs for exceptions.
mdiep authored
640
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
641 =end PIR_FRAGMENT
642
ec6e798 [pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.
allison authored
643 Exception example:
644
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
645 =begin PIR_FRAGMENT
646
ec6e798 [pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.
allison authored
647 push_eh handler
648 $P0 = new 'Exception'
649 $P0 = 'something happened'
650 throw $P0
651 pop_eh
652 exit 0
653
654 handler:
de0efc9 Revert my previous exceptions commit. It was wrong.
tene authored
655 .local pmc exception
ec6e798 [pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.
allison authored
656 .local string message
29a6220 [docs] .get_results for exception handling only receives the exceptio…
kjs authored
657 .get_results (exception)
ec6e798 [pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.
allison authored
658 print 'Exception: '
29a6220 [docs] .get_results for exception handling only receives the exceptio…
kjs authored
659 message = exception['message']
ec6e798 [pdd17pmc] Merging the pdd25cx branch into trunk for r26555 to r29949.
allison authored
660 print message
661 print "\n"
662 exit 1
663
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
664 =end PIR_FRAGMENT
665
ed16fa0 Add a little info about dynamic PMCs and ops to the compiler writer's…
jonathan authored
666 =head1 C Extensions
667
668 =head2 How do I create PMCs for my compiler?
669
670 Parrot supports dynamic PMCs, loadable at runtime, to allow compiler writers
671 to extend Parrot with additional types. For more information about writing
672 PMCs, see L<tools/build/pmc2c.pl> and L<docs/pmc.pod>.
673
da84039 Remove tools/build/dynpmc.pl, resolve TT#338
coke authored
674 See L<src/dynpmc/Makefile> for an example of how to build your dynamic
675 PMCS.
ed16fa0 Add a little info about dynamic PMCs and ops to the compiler writer's…
jonathan authored
676
677 =head2 How do I add another op to Parrot?
678
679 Parrot supports dynamic op libraries. These allow for ops specific to one
680 language to be used without having to place them into the Parrot core itself.
28a78de cleanup
coke authored
681 For examples of dynamic op libraries, see L<src/dynoplibs>.
ed16fa0 Add a little info about dynamic PMCs and ops to the compiler writer's…
jonathan authored
682
93911ce add NCI stuff to compiler faq.
kjs authored
683 =head2 How do I use the Native Calling Interface (NCI)?
684
685 Using the NCI you can invoke functions written in C from a Parrot script.
686 To every NCI invocation, there are two parts: the native function to be invoked,
687 and the PIR code to do the invocation.
688
689 First the native function, to be written in C. On Windows, it is necessary
690 to do a DLL export specification of the NCI function:
691
692 /* foo.c */
693
694 /* specify the function prototype */
695 #ifdef __WIN32
696 __declspec(dllexport) void foo(void);
697 #else
698 void foo(void);
699 #endif
700
701 void foo(void) {
702 printf("Hello Parrot!\n");
703 }
704
705 Then, after having compiled the file as a shared library, the PIR code looks
706 like this:
707
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
708 =begin PIR
709
93911ce add NCI stuff to compiler faq.
kjs authored
710 .sub main :main
711 .local pmc lib, func
712
713 # load the shared library
714 lib = loadlib "hello" # no extension, .so or .dll is assumed
715
716 # get a reference to the function from the library just
717 # loaded, called "foo", and signature "void" (and no arguments)
718 func = dlfunc lib, "foo", "v"
719
720 # invoke
721 func()
722
723 .end
724
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
725 =end PIR
726
93911ce add NCI stuff to compiler faq.
kjs authored
727 If you embedded a Parrot in your C file and you want to invoke another function
728 in that same C file, you should pass a null string to loadlib. Do that as follows:
729
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
730 =begin PIR_FRAGMENT
731
93911ce add NCI stuff to compiler faq.
kjs authored
732 .local pmc lib
733 .local string libname
734 null libname
735
736 lib = loadlib libname
737
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
738 =end PIR_FRAGMENT
739
93911ce add NCI stuff to compiler faq.
kjs authored
740 Under Linux, the .c file must then be linked with the -export-dynamic option.
741
764eff1 Update compiler_faq.pod
leo authored
742 =head1 Misc
743
90e09bd Fixed some POD formatting errors.
chromatic authored
744 =head2 How can I access a program's environment?
764eff1 Update compiler_faq.pod
leo authored
745
746 Create a new C<Env> PMC and access it like a hash.
747
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
748 =begin PIR_FRAGMENT
749
764eff1 Update compiler_faq.pod
leo authored
750 .local pmc e
7bc13b5 [OO] Changed more PMC creation from constant syntax to string style.
chromatic authored
751 e = new 'Env'
764eff1 Update compiler_faq.pod
leo authored
752 $P0 = e['USER'] # lt
753
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
754 =end PIR_FRAGMENT
755
90e09bd Fixed some POD formatting errors.
chromatic authored
756 =head2 How can I access Parrot's configuration?
764eff1 Update compiler_faq.pod
leo authored
757
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
758 =begin PIR_FRAGMENT
759
28a78de cleanup
coke authored
760 .include 'iglobals.pasm'
764eff1 Update compiler_faq.pod
leo authored
761 .local pmc interp, cfg
762 interp = getinterp
763 cfg = interp[.IGLOBALS_CONFIG_HASH]
28a78de cleanup
coke authored
764 $S0 = cfg['VERSION'] # "0.3.0"
764eff1 Update compiler_faq.pod
leo authored
765
12ff37a [docs] mark & test more PIR/PASM samples
coke authored
766 =end PIR_FRAGMENT
767
5829e44 This patch is huge because of all the whitespace reformatting. This was
bernhard authored
768 See F<config_lib.pasm> for all the keys in the config hash - or iterate over
769 the config hash.
764eff1 Update compiler_faq.pod
leo authored
770
cf442d6 Languages don't live in the repo for some time now.
coke authored
771 =cut
Something went wrong with that request. Please try again.