这很好用(感谢 Sunanda 的建议How can I parse [a / b] ? syntax error in Rebol?):
attribute: copy []
class: copy []
definition-rule: compose/deep [some [set class word! 'is 'defined 'by
[some [copy attribute to (to-lit-word "/") thru (to-lit-word "/") ]]
copy attribute to end]]
parse [Customer is defined by First Name / Last Name / Email] definition-rule
但我现在需要添加一些附加指令(附加输出类),它不再起作用:
attribute: copy []
class: copy []
definition-rule: compose/deep [some [set class word! (append output class) 'is 'defined 'by
[some [copy attribute to (to-lit-word "/") thru (to-lit-word "/") ]]
copy attribute to end]]
parse [Customer is defined by First Name / Last Name / Email] definition-rule