Ticket #72: book.patch
| File book.patch, 5.2 KB (added by jimmy, 4 years ago) |
|---|
-
docs/book/ch02_getting_started.pod
226 226 and why. 227 227 228 228 It's important that you create your patches from a checked-out subversion 229 repository, not from a tarball or orsnapshot. This way, you can ensure229 repository, not from a tarball or a snapshot. This way, you can ensure 230 230 that your diff is made against the latest version of the files. If you patch 231 231 an old version, the problem may have already been resolved! Make sure 232 232 the paths listed in the patch match those in the repository. There are two -
docs/book/ch03_pir_basics.pod
25 25 X<PIR (Parrot intermediate representation);documentation> 26 26 PIR is well documented, both in traditional documentation and in 27 27 instructional code examples. The documentation for the PIR compiler IMCC 28 in F< imcc/docs/> or the project documentation in F<docs/> are good28 in F<docs/imcc/> or the project documentation in F<docs/> are good 29 29 sources for information about the current syntax, semantics, and 30 30 implementation. The other PIR compiler, PIRC, has it's own documentation 31 31 that is slowly maturing. This is a useful source of information too. The 32 test suite in F< imcc/t> shows examples of proper working code. In fact,32 test suite in F<t/compilers/imcc/> shows examples of proper working code. In fact, 33 33 the test suite is the definitive PIR resource, because it shows how PIR 34 34 I<actually works>, even when the documentation may be out of date. 35 35 … … 99 99 100 100 Parrot registers are allocated in a linear array, and register numbers 101 101 are indices into this array. Having more registers means Parrot must 102 allocate more storage space for them, which can decrease memory effic ency102 allocate more storage space for them, which can decrease memory efficiency 103 103 and register allocation/fetch performance. In general, it's better to 104 104 keep the number of registers small. However, the number of the register 105 105 does not necessarily correspond to the actual storage location where the … … 373 373 provide these structures would work well for some languages but would 374 374 require all sorts of messy translation in others. The only way to make 375 375 sure all languages and their control structures can be equally 376 accom odated is to simply give them the most simple and fundamental376 accommodated is to simply give them the most simple and fundamental 377 377 building blocks to work with. Language agnosticism is an important 378 378 design goal in Parrot, and creates a very flexible and powerful 379 379 development environment for our language developers. -
docs/book/ch04_pir_subroutines.pod
18 18 in that all code in PIR must exist in a subroutine. Execution starts, 19 19 as we have seen, in the C<:main> subroutine, and others can be called 20 20 to perform the tasks of a program. From subroutines we can construct 21 more elaborate chunks of code reusability :methods and objects. In21 more elaborate chunks of code reusability methods and objects. In 22 22 this chapter we will talk about how subroutines work in PIR, and how 23 23 they can be used by developers to create programs for Parrot. 24 24 … … 564 564 .local pmc obj 565 565 newclass class, "Foo" # create a new Foo class 566 566 new obj, "Foo" # instantiate a Foo object 567 obj."meth"() # call obj." _meth" which is actually568 print "done\n" # "_meth"in the "Foo" namespace567 obj."meth"() # call obj."meth" which is actually 568 print "done\n" # in the "Foo" namespace 569 569 end 570 570 .end 571 571 572 572 .namespace [ "Foo" ] # start namespace "Foo" 573 573 574 .sub meth :method # define Foo:: _meth global574 .sub meth :method # define Foo::meth global 575 575 print "in meth\n" 576 576 $S0 = "other_meth" # method names can be in a register too 577 577 self.$S0() # self is the invocant -
docs/book/ch11_pmcs.pod
107 107 code to access the PMC using integer indices. C<provides hash> means 108 108 that we can use string and PMC keys to access values in the PMC. These 109 109 C<provides> each correspond to a series of VTABLE interfaces that the 110 PMC must provide, or must inherit. Without the necessary V ABLE110 PMC must provide, or must inherit. Without the necessary VTABLE 111 111 interfaces available, Parrot may try to perform illegal operations and 112 112 things will go badly. We'll talk about all the available C<provides> 113 113 interfaces and the VTABLE interfaces that they must define. … … 314 314 # Local variables: 315 315 # c-file-style: "parrot" 316 316 # End: 317 # vim: expandtab shiftwidth=4: 318 No newline at end of file 317 # vim: expandtab shiftwidth=4:
