with_optional_args.sql 302 B

12345678
  1. /* syntax version 1 */
  2. /* postgres can not */
  3. $f = Yql::WithOptionalArgs(($x,$y,$z)->($x + ($y ?? 0) + ($z ?? 0)), AsAtom("2"));
  4. select $f(1),$f(2,3),$f(4,5,6),
  5. Yql::NamedApply($f,(1,),<||>),
  6. Yql::NamedApply($f,(1,2),<||>),
  7. Yql::NamedApply($f,(1,2,3),<||>),
  8. Yql::NamedApply($f,(1,2,3,4),<||>);