【问题标题】:Chibi-scheme Error with Iterator带有迭代器的赤壁方案错误
【发布时间】:2012-07-14 14:02:12
【问题描述】:

任何人都知道为什么 chibi-scheme 在尝试使用 赤壁循环up-from函数:

ERROR: car: not a pair: #<opcode cons>
ERROR in set-dk! on line 590 of file /usr/local/share/chibi/init-7.scm: cdr: not a pair: ()

我以如下方式使用语法:

(import (chibi loop))

>(up-from 0 (to 20) (by 2))

【问题讨论】:

  • 您应该发布导致错误的代码
  • @ÓscarLópez..见我上面的编辑。希望我以正确的方式使用语法。

标签: error-handling scheme chibi-scheme


【解决方案1】:

你不能像这样独立使用up-from。它只适用于loop 表单:

> (loop ((for x (up-from 0 (to 20) (by 2))))
    (display x)
    (newline))
0
2
4
6
8
10
12
14
16
18

【讨论】:

  • 感谢您的直接回答
猜你喜欢
  • 2016-07-19
  • 2015-10-29
  • 2019-01-24
  • 2020-06-09
  • 1970-01-01
  • 1970-01-01
  • 2019-10-31
  • 2016-11-04
  • 2015-05-08
相关资源
最近更新 更多