sug

Function sug 

Source
pub fn sug(sexp: &Sexp) -> Sexp
Expand description

pink.scm’s sug pre-pass (pink.scm:11): desugar cadr/caddr/cadddr into car/cdr chains over the whole surface tree — including quoted data, since Pink source is itself a quoted list. Oracle under Chez: (sug '(quote (cadr x))) => (quote (car (cdr x))).

Applied exactly once, at the surface-source boundary (TopLevel::eval_exp) — not inside lower’s recursion, and not on the read primitive’s runtime data (the reference sugs source only).

use narju::parse::{parse_one, sug};

let form = parse_one("(cadr xs)").unwrap();
assert_eq!(sug(&form), parse_one("(car (cdr xs))").unwrap());