
var.ops - Variable Opcodes

These operations deal with both lexical and global variables, as well as the symbol tables that contain them.
When making changes to any ops file,
run make bootstrap-ops to regenerate all generated ops files.
Operations to create, modify and delete lexical variables.
Store object $2 as lexical symbol $1. The opcode might succeed or throw an exception on unknown lexical names depending on the implementation of the LexPad PMC. Requires that the lexical is stored in a PMC register.
Parrot's LexPad throws an exception for unknown names.
Store object $2 as lexical symbol $1. The opcode might succeed or throw an exception on unknown lexical names depending on the implementation of the LexPad PMC. Requires that the lexical is stored in a STR register.
Parrot's LexPad throws an exception for unknown names.
Store object $2 as lexical symbol $1. The opcode might succeed or throw an exception on unknown lexical names depending on the implementation of the LexPad PMC. Requires that the lexical is stored in an INT register.
Parrot's LexPad throws an exception for unknown names.
Store object $2 as lexical symbol $1. The opcode might succeed or throw an exception on unknown lexical names depending on the implementation of the LexPad PMC. Requires that the lexical is stored in a NUM register.
Parrot's LexPad throws an exception for unknown names.
Search caller lexpads for lexical symbol $1 and store object $2 there.
Throws an exception if no caller lexpad claims the lexical symbol.
(To store a value in the current lexpad,
use store_lex above.)
Find the lexical variable named $2 and store it in $1. Return a Null PMC if the variable is not found. Requires that the lexical be in a PMC register.
Find the lexical variable named $2 and store it in $1. Requires that the lexical be in a STR register.
Find the lexical variable named $2 and store it in $1. Requires that the lexical be in a INT register.
Find the lexical variable named $2 and store it in $1. Requires that the lexical be in a NUM register.
Search through caller lexpads for a lexical variable named $2 and store it in $1.
Return a Null PMC if the lexical variable is not found.
(To search the current lexpad,
use find_lex above.)
Like find_dynamic_lex above, but also searches caller's outer scopes in addition to the lexpads.
Set $1 to the current namespace.
Set $1 to the namespace denoted by the key constant $2, relative to the current namespace. If the namespace doesn't exist, $1 is set to null.
Set $1 to the current HLL root namespace.
Set $1 to the namespace denoted by the key constant $2, relative to the current HLL root namespace. If the namespace doesn't exist, $1 is set to null.
Set $1 to the true root namespace.
Set $1 to the namespace denoted by the key constant $2, relative to the true root namespace. If the namespace doesn't exist, $1 is set to null.
Set $1 to the global named $2 in current namespace. If the global doesn't exist, $1 is set to null.
Set $1 to the global named $3 in the namespace denoted by the key constant $2, relative to the current namespace. If the namespace or the global doesn't exist, $1 is set to null.
Set $1 to the global named $2 in the current HLL root namespace. If the global doesn't exist, $1 is set to null.
Set $1 to the global named $3 in the namespace denoted by the key constant $2, relative to the current HLL root namespace. If the namespace or the global doesn't exist, $1 is set to null.
Set $1 to the global named $2 in the true root namespace. If the global doesn't exist, $1 is set to null.
Set $1 to the global named $3 in the namespace denoted by the key constant $2, relative to the true root namespace. If the namespace or the global doesn't exist, $1 is set to null.
Set the global named $1 in the current namespace to $2.
Set the global named $2 in the namespace denoted by the key constant $1, relative to the current namespace, to $3. If the namespace does not exist, it is created.
Set the global named $1 to $2 in the current HLL root namespace.
Set the global named $2 in the namespace denoted by the key constant $1 (relative to the current HLL namespace) to $3. If the namespace does not exist, it is created.
Set the global named $1 in the true root namespace to $2.
Set the global named $2 in the namespace denoted by the key constant $1 (relative to the true root namespace) to $3. If the namespace does not exist, it is created.
Operations to modify global variables
Find the name $2 in lexicals,
then the current namespace,
then the HLL root namespace,
and finally Parrot builtins.
These are checked in order and the first match is returned in $1.
If no matches are found,
either throws an exception or sets $1 to PMCNULL,
depending on current errors settings.
See errorson.
Do the same thing as find_name,
but throw an exception if the name isn't found.

Copyright (C) 2001-2011, Parrot Foundation.

This program is free software. It is subject to the same license as the Parrot interpreter itself.