Standard terminology for function calling in languages that have named parameters (i.e., almost all of them). If you have a function f(int $a, string $b) and you call it with f(10,"gzarp!"), then it is said that the parameter $a is bound to the argument 10, and the parameter $b is bound to the argument "gzarp!". (Or vice versa -- "gzarp!" is bound to $b, but binding is reflexive so it doesn't matter all that much. Though you could have multiple arguments bound to the same parameter in a language like Perl6.)
Regex matching is really an operator, not a function call, but the terminology is the same. Well, except you'd probably call them operands instead of parameters.
Or at least, this is the way I think about it. The terminology always made sense to me because for a long time when I started writing perl, I just used /.../ and therefore left the match string bound to the default $_. (I didn't even know there was a $_ for a while; it just all somehow magically worked out when I did a while(<>) loop.) At some point, I had a string in my own $variable that I wanted to match, and "binding" seemed as good a word as any to describe how to set the string that I was applying the match to.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|