Documentation ¶
Overview ¶
Package scope provides functionality to handele variable scopes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var GetCounter <-chan int
GetCounter returns a strictly increasing sequence of int values.
var Random *rand.Rand
Random is the source for all randomness used in packe scope.
var ResetCounter chan<- int
ResetCounter resets the stream generated by GetCounter to the sent value.
Functions ¶
func RandomIntn ¶
RandomIntn returns a random int in the rnage [0,n) read from Random. It is safe for concurrent use.
Types ¶
type Variables ¶
Variables represents a set of (variable-name, variable-value)-pairs.
func New ¶
New merges outer and inner variables into a new scope. Variables defined in the outer scope will be copied to the new scope: Variables from the inner scope may not overwrite variables from the outer scope. Worded differently: The inner scope provides some kind of default which gets overwriten from the outside.
Variable values in the inner scope may reference values from the outer scope.
If auto variables are requested the new scope will contain the COUNTER and RANDOM variable.