From 862d3b7684f170a85082b511bcc30f9d600b4f50 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 27 Mar 2023 22:54:21 +0200 Subject: [PATCH] Methods can be impure Fixes #385. --- docs/src/reference/types.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/src/reference/types.md b/docs/src/reference/types.md index b87b07790..c323ab41d 100644 --- a/docs/src/reference/types.md +++ b/docs/src/reference/types.md @@ -822,6 +822,10 @@ In Typst, all functions are _pure._ This means that for the same arguments, they always return the same result. They cannot "remember" things to produce another value when they are called a second time. +The only exception are built-in methods like +[`array.push(value)`]($type/array.push). These can modify the values they are +called on. + ## Methods ### with() Returns a new function that has the given arguments pre-applied.