xpile 0.1.616

Polyglot transpile workbench (Python/C/C++/Rust/Ruchy/Lean ↔ Rust/Ruchy/PTX/WGSL/SPIR-V) with provable contracts at every layer.
1
2
3
4
5
6
7
8
9
10
# PMAT-701: capitalize()/title() titlecase the lead char of each word, not
# uppercase it — so a titlecase-EXPANDING scalar matches Python: ß.capitalize()
# is "Ss" (not "SS"), fl at a word start titlecases to "Fl" (not "FL"). xpile
# derives titlecase from the uppercase expansion (std has no char::to_titlecase).
def cap(s: str) -> str:
    return s.capitalize()


def titl(s: str) -> str:
    return s.title()