Luke Palmer asked:

what's compile-time binding?

A normal binding:


$name := expr;

is a run-time operation that installs its RHS operand as a new implementation for the LHS symbol. That is, it means:

$CurrentPackage::{'$name'} = \(expr)

(with some special magic that only enreferences C<expr> if it's not already a reference to a scalar).

A compile-time binding:

$name ::= expr;

*pre*-installs its RHS operand as an implementation for the LHS symbol. That is, it means:

BEGIN { $CurrentPackage::{'$name'} = \(expr) }

(with the same special enreferencing magic).

In other words, C<::=> is to C<:=> as a macro call is to a subroutine call.

Damian

Reply via email to