cangjie-function

Explain Cangjie language functions including lambdas, closures, and operator overloading syntax and rules.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps users understand and utilize the comprehensive function-related features of the Cangjie programming language, from basic definitions to advanced concepts like closures and operator overloading.

Core Features & Use Cases

  • Function Definition & Invocation: Covers syntax, parameters (named, default), return types, and function bodies.
  • Advanced Concepts: Explains function types, lambdas, closures, nested functions, overloading, and operator overloading.
  • Syntax Sugar: Details tail-call optimization, pipe (|>), and composition (~>) operators.
  • Use Case: A developer needs to implement a complex callback mechanism using lambda expressions with captured variables. This Skill provides the exact syntax and rules for creating such closures.

Quick Start

Explain how to define a function in Cangjie that accepts named parameters with default values.

Frequently Asked Questions about cangjie-function

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

FAQPage Schema
How do I define a Cangjie function with named parameters and default values?

Cangjie closures capture variables from their surrounding scope by using lambda expressions with specific syntax. This Skill explains the exact rules for creating closures, capturing external variables, and implementing complex callback mechanisms.

What is the syntax for operator overloading in Cangjie functions?

Operator overloading in Cangjie allows you to define custom behavior for operators within your functions. This Skill details the specific syntax, operator precedence rules, and overloading resolution mechanisms for implementing these features.

How do pipe and composition operators work in Cangjie?

Pipe (`|>`) and composition (`~>`) operators in Cangjie provide syntax sugar for chaining function calls and combining operations. This Skill covers how to apply these operators alongside tail-call optimization to streamline your function logic.

Can I use nested functions and tail-call optimization in Cangjie?

Yes, Cangjie supports nested functions defined inside other functions and tail-call optimization to prevent stack overflow. This Skill explains the syntax for nesting functions and utilizing optimization for recursive calls.