Named Parameters
In Cangjie, you can define named parameters using the name!: Type syntax. When calling a function, named parameters require writing the parameter name in the format name: value. Named parameters can be passed in any order, which makes code more readable and reduces parameter passing errors.
Named parameters must be marked with !, which is Cangjie's unique syntax. Parameter lists can contain both regular parameters and named parameters, but named parameters must come after regular parameters. When calling, regular parameters are passed by position, while named parameters are passed by name.
The code on the right defines createUser and sendEmail functions, both using named parameters. Note that the parameter order at call site can differ from the definition order, which is especially useful for large parameter lists.
Click Run to see the effect of named parameters, then try modifying the function calls to change the parameter order.