Skip to content

Commit

Permalink
Bind parameters into the lexpad using a positional index rather than …
Browse files Browse the repository at this point in the history
…a hash index. Wins us a bit. :-)
  • Loading branch information
jnthn committed Aug 24, 2010
1 parent 1fbc73b commit afb4abf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion dotnet/runtime/Runtime/Signatures/Parameter.cs
Expand Up @@ -18,10 +18,11 @@ public class Parameter
/// <param name="VariableName"></param>
/// <param name="Name"></param>
/// <param name="Flags"></param>
public Parameter(RakudoObject Type, string VariableName, string Name, int Flags)
public Parameter(RakudoObject Type, string VariableName, int VariableLexpadPosition, string Name, int Flags)
{
this.Type = Type;
this.VariableName = VariableName;
this.VariableLexpadPosition = VariableLexpadPosition;
this.Name = Name;
this.Flags = Flags;
}
Expand All @@ -36,6 +37,11 @@ public Parameter(RakudoObject Type, string VariableName, string Name, int Flags)
/// </summary>
public string VariableName;

/// <summary>
/// The position in the lexpad where the variable will be stored.
/// </summary>
public int VariableLexpadPosition;

/// <summary>
/// Name, for named parameters.
/// </summary>
Expand Down
6 changes: 3 additions & 3 deletions dotnet/runtime/Runtime/Signatures/SignatureBinder.cs
Expand Up @@ -67,7 +67,7 @@ public static void Bind(Context C, RakudoObject Capture)
if (CurPositional < Positionals.Length)
{
// We have an argument, just bind it.
Target.SetByName(Param.VariableName, Positionals[CurPositional]);
Target.Storage[Param.VariableLexpadPosition] = Positionals[CurPositional];
}
else
{
Expand All @@ -86,7 +86,7 @@ public static void Bind(Context C, RakudoObject Capture)
if (CurPositional < Positionals.Length)
{
// We have an argument, just bind it.
Target.SetByName(Param.VariableName, Positionals[CurPositional]);
Target.Storage[Param.VariableLexpadPosition] = Positionals[CurPositional];
}
else
{
Expand Down Expand Up @@ -117,7 +117,7 @@ public static void Bind(Context C, RakudoObject Capture)
if (Nameds.TryGetValue(Param.Name, out Value))
{
// We have an argument, just bind it.
Target.SetByName(Param.VariableName, Value);
Target.Storage[Param.VariableLexpadPosition] = Value;
}
else
{
Expand Down

0 comments on commit afb4abf

Please sign in to comment.