From 422b8e640f00977177a5a7250a3c56009eed10c4 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 26 Jun 2021 18:07:05 +0200 Subject: With expressions --- tests/typ/code/ops.typ | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/typ/code/ops.typ') diff --git a/tests/typ/code/ops.typ b/tests/typ/code/ops.typ index e2ecd4ff..a7d5474e 100644 --- a/tests/typ/code/ops.typ +++ b/tests/typ/code/ops.typ @@ -145,3 +145,21 @@ { x /= 2.0 } #test(x, 18.0) { x = "some" } #test(x, "some") { x += "thing" } #test(x, "something") + +--- +// Test with operator. +// Ref: true + +// Apply positional arguments. +#let add(x, y) = x + y +#test((add with (2))(4), 6) + +// Let .. with .. syntax. +#let f = add +#let f with (2) +#test(f(4), 6) + +// Make sure that named arguments are overridable. +#let align with (horizontal: right) +#align[Right] \ +#align(horizontal: left)[Left] -- cgit v1.2.3