gpt4 book ai didi

parsing - 'deferred substitution'是什么意思?

转载 作者:行者123 更新时间:2023-12-02 21:26:44 25 4
gpt4 key购买 nike

我正在为 language 编写一个简单的解析器/解释器。说明中不断提到“延迟替换”,如

Extend the fun language feature described so that functions can accept a list of zero or more arguments instead of just one. All arguments to the function must evaluate with the same deferred substitutions.

我不需要任何帮助来实现这个,我只是对“延迟替换”的含义感到困惑。有什么想法吗?

最佳答案

延迟替换是指在可能的最后一步替换变量值的做法。通过这样做,您将推迟替换它!

这是一个可以帮助您理解其含义的示例:假设您有以下函数:f(x) = 500 + 300 + 2x + 45x

假设 x = 1如果您想推迟 x 的替换,您可能会这样做:

  1. f(x) = 800 + 2x + 45x
  2. f(x) = 800 + 47x
  3. f(1) = 800 + 47(1)

请注意,在简化此函数中不是变量的所有内容之后,我们已在可能的最后一步替换了 x 的值。

关于parsing - 'deferred substitution'是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8043749/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com