From f352aa96862cfacf443231a3d66499442d06585d Mon Sep 17 00:00:00 2001 From: Martin Henz Date: Wed, 3 Jul 2024 08:35:49 +0800 Subject: [PATCH] fixes #814 (#1015) --- xml/chapter4/section2/subsection1.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xml/chapter4/section2/subsection1.xml b/xml/chapter4/section2/subsection1.xml index 4e287a53e..7243f0d75 100644 --- a/xml/chapter4/section2/subsection1.xml +++ b/xml/chapter4/section2/subsection1.xml @@ -342,6 +342,11 @@ factorial(5); functions work in a normal-order language? + + (provided by GitHub user joeng03) +When evaluated in default (‘strict’) mode, the code undergoes applicative order reduction and runs into an infinite loop because it needs to evaluate the arguments of the unless function, but the factorial function does not have a terminating condition. +When evaluated in lazy mode, the code undergoes normal order reduction. It produces the correct output because the unless function is applied before its arguments are evaluated. +