【问题标题】:(Unbound variable) Use functions on a list of S-Expressions (mit-scheme)(未绑定变量)在 S-Expressions 列表上使用函数(mit-scheme)
【发布时间】:2013-12-10 13:36:45
【问题描述】:

我正在尝试在 S 表达式列表中使用一个函数,但它只会给我一个错误 "Unbound variable butter"。

(depth* (()
         ((bitter butter)
          (makes)
          (butter bitter)
         butter)))

【问题讨论】:

    标签: list variables scheme s-expression


    【解决方案1】:

    您似乎忘记引用 s 表达式,试试这个:

    (depth* '(() ; notice the quote at the start of the list
              ((bitter butter)
               (makes)
               (butter bitter)
               butter)))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-11
      • 1970-01-01
      相关资源
      最近更新 更多