Nogc
Utilities to write `@nogc` code
Install / Use
/learn @atilaneves/NogcREADME
nogc
Utilities to write @nogc code, including converting values to strings (text)
and a variant of std.exception.enforce that is @nogc but limits the type
of the exception thrown to be NoGcException. Examples:
// text is @system because it returns a slice to a static array
// if you need to store the string you'll need to make a copy
// since consecutive calls will return the same slice and it will
// be mutated
@nogc @system unittest {
import nogc.conv: text;
// works with basic types and user defined structs/classes
assert(text(1, " ", "foo", " ", 2.0) == "1 foo 2.000000");
}
// enforce is @safe, since it internally makes a call to `text` but
// immediately throws an exception, and casting it to `string` makes
// it immutable. Ugly but it works.
@nogc @safe unittest {
import nogc.exception: enforce;
import nogc.conv: text;
const expected = 1;
const actual = 1;
enforce(actual == expected, "Expected: ", expected, " but got: ", actual);
}
Related Skills
node-connect
347.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
