pascalabcnet/TestSuite/lambdas15.pas
Ivan Bondarev 4db76663d1 #2328
2021-01-06 14:20:07 +01:00

13 lines
438 B
ObjectPascal
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

begin
var i := 0;
// Обязательно p0 - процедурная переменная, с методом или глобальной подпрограммой не воспроизводится
// Обязательно принимать в p хотя бы 1 параметр
var p0 := procedure(p: byte->()) -> p(2);
// Обязательно вызвать передав лямбду
p0(b->Inc(i));
assert(i = 1);
end.