namespace Lua.Standard.Text; public sealed class LenFunction : LuaFunction { public override string Name => "len"; public static readonly LenFunction Instance = new(); protected override ValueTask InvokeAsyncCore(LuaFunctionExecutionContext context, Memory buffer, CancellationToken cancellationToken) { var s = context.GetArgument(0); buffer.Span[0] = s.Length; return new(1); } }