Skip to content

Library Features

CCL values are always strings. Type conversion is a library convenience, not part of Core CCL.

Common Functions:

  • get_string(config, path...) - Extract string values
  • get_int(config, path...) - Parse integers with validation
  • get_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 = true
name = get_string(config, "app", "name") // "MyApp"
port = get_int(config, "app", "port") // 8080
debug = get_bool(config, "app", "debug") // true

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 config
database.host = localhost
/= Production overrides
database.host = prod.db.com
dev_entries = parse(dev_config)
prod_entries = parse(prod_config)
combined = compose(dev_entries, prod_entries)
final_config = build_hierarchy(combined)

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") and get_string(config, "database", "host") access same data

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.