本文整理汇总了C#中AType.IsSlotFiller方法的典型用法代码示例。如果您正苦于以下问题:C# AType.IsSlotFiller方法的具体用法?C# AType.IsSlotFiller怎么用?C# AType.IsSlotFiller使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AType
的用法示例。
在下文中一共展示了AType.IsSlotFiller方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Alsf
internal static AType Alsf(Aplus environment, AType input)
{
if (input.Rank > 1)
{
throw new Error.Rank("_alsf");
}
if (input.IsSlotFiller())
{
return input.Clone();
}
return (input.IsArray) ? ArrayInput(input) : NotArrayInput(input);
}
示例2: IsaSlotfiller
internal static AType IsaSlotfiller(Aplus environment, AType input)
{
AType result;
if (input.IsSlotFiller())
{
result = AInteger.Create(1);
}
else
{
result = AInteger.Create(0);
}
return result;
}
示例3: SimpleSymbolConstant2SlotFiller
/// <summary>
/// CASE 3: Slotfiller right argument and simple symbol left argument.
/// </summary>
/// <param name="symbol">Symbol to use for selecting from a slotfiller</param>
/// <param name="items">Slotfiller</param>
/// <returns></returns>
private AType SimpleSymbolConstant2SlotFiller(AType symbol, AType items, Aplus environment)
{
if (!items.IsSlotFiller(true))
{
throw new Error.Domain(DomainErrorText);
}
AType result;
AType keys = MonadicFunctionInstance.Disclose.Execute(items[0], environment);
AType values = MonadicFunctionInstance.Disclose.Execute(items[1], environment);
if (keys.IsArray)
{
if (keys.Rank > 1)
{
keys = MonadicFunctionInstance.Ravel.Execute(keys);
}
if (values.Rank > 1)
{
values = MonadicFunctionInstance.Ravel.Execute(values);
}
int index = -1;
// TODO: refactor, remove 'i' use the 'index' variable
for (int i = 0; i < keys.Length; i++)
{
if (keys[i].IsBox)
{
throw new Error.Domain(DomainErrorText);
}
if (keys[i].CompareTo(symbol) == 0)
{
index = i;
break;
}
}
if (index == -1)
{
//y is a symbol and is not a member of the vector of symbol s in x.
throw new Error.Index(IndexErrorText);
}
if (values[index].IsPrimitiveFunction() || !values[index].IsBox)
{
throw new Error.Domain(DomainErrorText);
}
result = MonadicFunctionInstance.Disclose.Execute(values[index], environment);
}
else
{
// We have only one item in the keys list
if (symbol.CompareTo(keys) != 0)
{
throw new Error.Index(IndexErrorText);
}
if (values.IsPrimitiveFunction() || !values.IsBox)
{
throw new Error.Domain(DomainErrorText);
}
result = MonadicFunctionInstance.Disclose.Execute(values, environment);
}
return result;
}