cangjie-basic-data-type

Document Cangjie basic data types and core operators.

4|1|Updated Mar 29, 2026
One-click install
npx skills add https://github.com/JunjieChen0/NJUST --skill cangjie-basic-data-type-junjiechen0
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cangjie-basic-data-type
Source: https://github.com/JunjieChen0/NJUST/tree/main/.njust-ai/skills/cangjie-basic-data-type
Command: npx skills add https://github.com/JunjieChen0/NJUST --skill cangjie-basic-data-type-junjiechen0

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Cangjie language basics: understanding the fundamental data types is essential for building reliable programs. This Skill consolidates integers, floats, booleans, Rune, String, Unit, Nothing, Tuple, Array/VArray, Range, and core operators into a single reference.

Core Features & Use Cases

  • Type coverage: Int8–Int64, UInt8–UInt64, Float16/32/64, Bool, Rune, String, Unit, Nothing, Tuple, Array, VArray, Range
  • Literals and conversions: numeric literals, byte literals, string handling, Rune to UInt32 conversions, and range creation
  • Practical examples: inspect how to convert between Rune and integer, create fixed-size arrays, and iterate strings by bytes or by runes
  • Use Case: A language designer or script writer references type rules while implementing or prototyping language features

Quick Start

Create an Int64 variable with value 42 and print it to verify basic type usage.

Frequently Asked Questions about cangjie-basic-data-type

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

FAQPage Schema
What basic data types does Cangjie support for building programs?

Cangjie basic data types include integers (Int8–Int64, UInt8–UInt64), floats (Float16–Float64), Bool, Rune, String, Unit, Nothing, Tuple, Array, VArray, and Range. These foundational types enable reliable program construction with defined type rules and literals.

How do I convert between Rune and UInt32 in Cangjie?

To convert between Rune and UInt32 in Cangjie, apply the core type conversion rules and operators. This Skill provides practical examples showing how to safely switch between Rune and integer representations for character processing.

What is the difference between Array and VArray in Cangjie?

VArray represents a fixed-size array in Cangjie, whereas standard Array provides dynamic sizing. This distinction dictates how you manage memory and create collections, with VArray requiring predefined capacity constraints.

How do I iterate over a Cangjie String by bytes or by runes?

Iterate over a Cangjie String by bytes or by runes using specific core operators and patterns. This Skill demonstrates common iteration techniques to handle text data accurately according to type rules.

When should I use Unit and Nothing types in Cangjie?

Use the Unit type in Cangjie when a function returns no meaningful value, and Nothing for unreachable code or non-returning scopes. These types enforce control flow reliability and strict type checking during compilation.