Results for: explicit macro
Explicit Macro
2009-02-15 - extension: rar - size: 102 MB
Explicit Macro
Hosted on: rapidshare.com
Gal - Explicit Macro
2009-05-18 - extension: rar - size: 102 MB
Gal - Explicit Macro
Hosted on: rapidshare.com
Video results for: explicit macroMore results from video
p6apclps #93 Perl 6 Apocalypse http://www.perlfoundation.org/perl6 - - to &block that is not compatible. We're leaving (More) http://www.perlfoundation.org/perl6 - - to &block that is not compatible. We're leaving "compatible" undefined for the moment, other than to point out that the signature doesn't have to be identical to be compatible. If the actual subroutine accepted one required parameter and one optional, it would work perfectly fine, for instance. The signature in "mygrep" is merely specifying what it requires of the subroutine, namely one positional argument named "$foo". (Conceivably it could even be named something different in the actual routine, provided the compiler turns that call into a positional one because it thinks it already knows the signature.) Calling subroutines The typical subroutine or method is called a lot more often than it is declared. So while the declaration syntax is rather ornate, we strive for a call syntax that is rather simple. Typically it just looks like a comma-separated list. Parentheses are optional on predeclared subroutine calls, but mandatory otherwise. Parentheses are mandatory on method calls with arguments, but may be omitted for argumentless calls to methods such as attribute accessors. Parentheses are optional on multimethod and macro calls because they always parse like list operators. A rule may be called like a method but is normally invoked within a regex via the "[rule]" syntax. [Update: Parentheses are optional on "postdeclared" subroutines as well, provided the post-declaration is consistent with listop syntax.] As in Perl 5, within the list there may be an implicit transition from scalar to list context. For example, the declaration of the standard "push" built-in in Perl 6 probably looks like this: multi *push (@array, *@list) {...} but you still generally call it as you would in Perl 5: push(@foo, 1, 2, 3); This call has two of the three kinds of call arguments. It has one positional argument, followed by a variadic list. We could imagine adding options to "push" sometime in the future. We *could* define it like this: multi *push (@array, ?$how, *@list) {...} That's just an optional positional parameter, so you'd call it like this: push(@foo, "rapidly", 1,2,3) But that won't do, actually, since we used to allow the list to start at the end of the positional parameters, and any pre-existing "push(@foo,1,2,3)" call to the new declaration would end up mapping the "1" onto the new optional parameter. Oops... If instead we force new parameters to be in named notation, like this: multi *push (@array, *@list, +$how) {...} then we can say: push(@foo, how =] "rapidly", 1,2,3) and it's no longer ambiguous. Since $how is in the named-only zone, it can never be set positionally, and the old calls to: push(@foo, 1,2,3); still work fine, because *@list is still at the end of the positional parameter zone. If we instead declare that: multi *push (@array, +$how, *@list) {...} we could still say: push(@foo, how =] "rapidly", 1,2,3) but this becomes illegal: push(@foo, 1,2,3); [Update: Actually, it's still legal now.] because the slurpy array is in the named-only zone. We'll need an explicit way to indicate the start of the list in this case. I can think of lots of (mostly bad) ways. You probably can too. We'll come back to this... Actual arguments So the actual arguments to a Perl function are of three kinds: positional, named, and list. Any or all of these parts may be omitted, but whenever they are there, they *must* occur in that order. It's more efficient for the compiler (and less confusing to the programmer) if all the positional arguments come before all the non-positional arguments in the list. Likewise, the named arguments are constrained to occur before the list arguments for efficiency--otherwise the implementation would have to scan the entire list for named arguments, and some lists are monstrous huge. [Update: These are now viewed as suggestions rather than hard rules.] We'd call these three parts "zones" as well, but then people would get them confused with our six declarative zones. In fact, extending the zoning metaphor a bit, our three parts are more like houses, stores, and factories (real ones, not OO ones, sheesh). These are the kinds of things you actually *find* in residential, commercial, and industrial zones. Similarly, you can think of the three different kinds of argument as the things you're allowed to *bind* in the different parameter zones. A house is generally a scalar item that is known for its position; after all, "there's no *place* like home". Um, yeah. Anyway, we usually number (Less)
CF803B10122K6P
2009-02-15 - extension: rar - size: 8 MB
CF803B10122K6P
Hosted on: rapidshare.com
CuteFTP 8 1 0
2009-02-15 - extension: rar - size: 8 MB
CuteFTP 8 1 0
Hosted on: rapidshare.com
Bookmark FilesTube
Link to FilesTube
Show your support by placing a link to filestube.com on your website and favorite forums.