The Chaga programming language supports single-line and multi-line comments within a Chaga program. Note: If //, /*, or */ appear within a quoted string, the Chaga compiler will not regard it as a comment.
Example: Single-line and multi-line comments within a Chaga program.
// This is a single-line comment. /* This is a multi-line comment */
The following datatypes are built-in to the Chaga programming language. However, one can also define user-defined datatypes using the define statement.
Example: using scale attribute with a REAL datatype to truncate decimal remainder on a repeating, non-terminating division operation.
define procedure main (void) { declare real quotient_and_remainder; set quotient_and_remainder.scale = 5; quotient_and_remainder = 1/3; /* the quotient_and_remainder = 0.33333 */ }
Example: determining string length
declare string input_string; set input_string = "haystack needle haystack needle"; call print (input_string.length, "\n");
Output from example: determining string length
31
Copyright © 2025, 2026 Robert James Bruce.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at https://www.gnu.org/licenses/fdl-1.3.html