Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@stevan
Created April 10, 2013 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevan/15aebbbb36ffc014d952 to your computer and use it in GitHub Desktop.
Save stevan/15aebbbb36ffc014d952 to your computer and use it in GitHub Desktop.
[info] Running org.moe.Moe -u
moe> my ($x, $y);
{
"CompilationUnitNode" : {
"ScopeNode" : {
"StatementsNode" : [
{
"StatementsNode" : [
{
"VariableDeclarationNode" : {
"name" : "$x",
"expression" : "UndefLiteralNode"
}
},
{
"VariableDeclarationNode" : {
"name" : "$y",
"expression" : "UndefLiteralNode"
}
}
]
}
]
}
}
}
undef
moe> my ($x, $y) = (1, 2); [ $x, $y ]
{
"CompilationUnitNode" : {
"ScopeNode" : {
"StatementsNode" : [
{
"StatementsNode" : [
{
"VariableDeclarationNode" : {
"name" : "$x",
"expression" : { "IntLiteralNode" : 1 }
}
},
{
"VariableDeclarationNode" : {
"name" : "$y",
"expression" : { "IntLiteralNode" : 2 }
}
}
]
},
{
"ArrayLiteralNode" : [
{ "VariableAccessNode" : "$x" },
{ "VariableAccessNode" : "$y" }
]
}
]
}
}
}
[1, 2]
moe> my ($x, $y, $z) = (1, 2); [ $x, $y, $z ]
{
"CompilationUnitNode" : {
"ScopeNode" : {
"StatementsNode" : [
{
"StatementsNode" : [
{
"VariableDeclarationNode" : {
"name" : "$x",
"expression" : { "IntLiteralNode" : 1 }
}
},
{
"VariableDeclarationNode" : {
"name" : "$y",
"expression" : { "IntLiteralNode" : 2 }
}
},
{
"VariableDeclarationNode" : {
"name" : "$z",
"expression" : "UndefLiteralNode"
}
}
]
},
{
"ArrayLiteralNode" : [
{ "VariableAccessNode" : "$x" },
{ "VariableAccessNode" : "$y" },
{ "VariableAccessNode" : "$z" }
]
}
]
}
}
}
[1, 2, undef]
moe> my ($x, $y, $z) = (1, 2, 3, 4); [ $x, $y, $z ]
{
"CompilationUnitNode" : {
"ScopeNode" : {
"StatementsNode" : [
{
"StatementsNode" : [
{
"VariableDeclarationNode" : {
"name" : "$x",
"expression" : { "IntLiteralNode" : 1 }
}
},
{
"VariableDeclarationNode" : {
"name" : "$y",
"expression" : { "IntLiteralNode" : 2 }
}
},
{
"VariableDeclarationNode" : {
"name" : "$z",
"expression" : { "IntLiteralNode" : 3 }
}
}
]
},
{
"ArrayLiteralNode" : [
{ "VariableAccessNode" : "$x" },
{ "VariableAccessNode" : "$y" },
{ "VariableAccessNode" : "$z" }
]
}
]
}
}
}
[1, 2, 3]
moe> my ($x, $y, $z) = (1, 2, 3, 4); [ $x, $y, $z ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment