cangjie-enum

Explain enumeration type definition rules and advanced features in Cangjie.

1|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/SunriseSummer/CangjieDocValidator --skill cangjie-enum
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cangjie-enum
Source: https://github.com/SunriseSummer/CangjieDocValidator/tree/main/.github/skills/enum
Command: npx skills add https://github.com/SunriseSummer/CangjieDocValidator --skill cangjie-enum

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill clarifies the intricacies of defining and using enumeration types in the Cangjie programming language, ensuring correct and robust code.

Core Features & Use Cases

  • Enum Definition: Learn the rules for defining enums, including constructors (with/without parameters, same name), non-exhaustive enums, and recursive definitions.
  • Usage and Naming Conflicts: Understand how to create enum values and resolve naming conflicts with keywords or other identifiers.
  • Advanced Features: Explore member functions, operator functions, properties, and integration with interfaces like Equatable.
  • Use Case: You need to represent a set of distinct states or options in your Cangjie program, like different colors or command types, and ensure type safety and clarity.

Quick Start

Use the cangjie-enum skill to learn how to define an enum with named parameters in Cangjie.

Frequently Asked Questions about cangjie-enum

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I define an enum with named parameters in the Cangjie programming language?

To define an enum with named parameters in the Cangjie programming language, you use specific constructor variations within your enum definition. This approach allows you to attach data to distinct states, ensuring type safety and clarity for values like command types or colors.

What are non-exhaustive enums and recursive definitions in Cangjie?

Non-exhaustive enums and recursive definitions are advanced enumeration features in Cangjie. Non-exhaustive enums allow future member additions without breaking existing code, while recursive definitions enable enum members to reference the enum type itself, supporting complex data structures.

Can I implement interfaces like Equatable for Cangjie enum types?

Yes, you can implement interfaces like Equatable for Cangjie enum types. Enums support advanced features including member functions, operator functions, and properties, allowing them to integrate with interfaces for robust value comparison and operations.

How do I resolve naming conflicts with keywords when creating enum values in Cangjie?

To resolve naming conflicts with keywords or other identifiers when creating enum values in Cangjie, you follow specific syntax rules provided by the language. This ensures your enumeration members remain accessible and distinct even when sharing names with reserved keywords.

When should I use an enumeration type instead of standard data types in Cangjie?

You should use an enumeration type in Cangjie when you need to represent a set of distinct, predefined states or options, like different colors or command types. Enums provide strict type safety mechanisms that standard data types cannot guarantee.