(input) (output "café 日本語 🍺" "café1" "naïve: 3" "predicate: 1 0") (return 0) ;;; Non-ASCII string literals and identifiers. ;;; ;;; Two things are pinned here. First, a character outside printable ;;; ASCII must reach the C compiler as the UTF-8 bytes it was written ;;; as. Octal escapes are used because C's \x escape swallows every ;;; following hex digit: "café1" is the case that catches it, since a ;;; hex escape would run "\xc3\xa9" into the "1" and produce a value out ;;; of range for a char. Second, a kebab-case identifier containing ;;; non-ASCII characters must survive unkebabify intact -- getting this ;;; wrong truncates the name silently, and the program still compiles ;;; and runs, just under a different name than the one written. ;;; ;;; `?' and `!' end Lisp predicates and mutators, and C takes neither: ;;; they become the letters ʔ and ꜝ. (include stdio.h) (fn zero? ((n int)) bool (return (== n 0))) (fn clear! ((n (* int))) void (= (* n) 0)) (pub fn main () int (puts "café 日本語 🍺") (puts "café1") (var naïve-count int 3) (printf "naïve: %d\n" naïve-count) (var n int 5) (var before bool (zero? n)) (clear! (& n)) (printf "predicate: %d %d\n" (zero? n) before) (return 0))