Library Features
Library Features (Optional)
Section titled “Library Features (Optional)”Type-Safe Value Access
Section titled “Type-Safe Value Access”CCL values are always strings. Type conversion is a library convenience, not part of Core CCL.
Common Functions:
get_string(config, path...)- Extract string valuesget_int(config, path...)- Parse integers with validationget_bool(config, path...)- Parse booleans (true/false, yes/no, 1/0)get_list(config, path...)- Extract lists from empty-key entries
Example:
app = name = MyApp port = 8080 debug = truename = get_string(config, "app", "name") // "MyApp"port = get_int(config, "app", "port") // 8080debug = get_bool(config, "app", "debug") // trueEntry Processing
Section titled “Entry Processing”Manipulate CCL entries for composition and filtering.
Common Functions:
filter(entries, predicate)- Remove entries (e.g., comments)compose(entries1, entries2)- Merge entry lists (Monoid composition)
Example:
/= Development configdatabase.host = localhost
/= Production overridesdatabase.host = prod.db.comdev_entries = parse(dev_config)prod_entries = parse(prod_config)combined = compose(dev_entries, prod_entries)final_config = build_hierarchy(combined)Experimental Features
Section titled “Experimental Features”Some implementations provide additional experimental features:
Dotted Representation (Go implementation):
- Provides dotted access to hierarchical data
get_string(config, "database.host")works for nested structure- Both
get_string(config, "database.host")andget_string(config, "database", "host")access same data
Test Suite Coverage
Section titled “Test Suite Coverage”The CCL Test Suite provides tests for these features:
- Type-Safe Access: 107 assertions (22 tests)
- Entry Processing: 67 assertions (19 tests)
- Experimental Features: 18 tests for dotted representation
See Test Suite Guide for progressive implementation roadmap.