bind - rebol 程序中出现奇怪的 "word has no context"错误

标签 bind rebol

这是我在控制台中遇到的错误:

>> ? column
COLUMN is a block of value: [Person 2 Date 3 Quantity 4 Size 5 ProductType 6 
LineItem  7 Deliver 8 FillStatus 9 Note 10 Time 11]
>> ? column/Size
COLUMN/SIZE is an integer of value: 5
>> ? a
A is a block of value: [column/Size]
>> reduce a
** Script Error: column word has no context
** Near: column/Size
>> ? b
B is a block of value: [column/Size]
>> reduce b
== [5]

为什么变量“a”没有正确减少?

最佳答案

我不知道你如何定义columna,因为当我从控制台尝试它时,它起作用了:

>> column: [Person 2 Date 3 Quantity 4 Size 5 ProductType 6 LineItem  7 Deliver 8 FillStatus 9 Note 10 Time 11]
== [Person 2 Date 3 Quantity 4 Size 5 ProductType 6 LineItem 7 Deliver 8 FillStatus 9 Note 10 Time 11]

>> a: [column/size]
== [column/size]

>> reduce a
== [5]

无论如何,你可以尝试绑定(bind)a:

>> reduce bind a 'column
== [5]

关于bind - rebol 程序中出现奇怪的 "word has no context"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23052875/

相关文章:

parsing - Rebol:如何将相同的解析规则应用于从 Windows 剪贴板粘贴的多行

Rebol 库访问

javascript - JS如何使用父函数的参数调用函数内部的函数?

c++ - 将指针传递给期望引用的函数会更改指向的值

javascript - 对每个表行 react onclick

Rebol 快速入门

C++0x:在 std::map 中存储任何类型的 std::function

c++ - 将异步操作的处理程序绑定(bind)到另一个类的非静态成员

html - 如何自定义 Power-Mezz 的 HTML 过滤器?