问题描述
我可以找到有关数据类型UTYPE的唯一信息!是尚未为R3记录的文档"和用户定义的数据类型",仍然给我带来了希望,我可以摆脱Rebol的预定义数据类型的规范,并以更直接的方式制定函数的多态性.只是...我不知道如何处理UTYPE!正在尝试:
The only information I can find on the datatype UTYPE! is "not yet been documented for R3" and "user defined datatype", still giving a shred of hope that I can break out of Rebol's canon of predefined datatypes and formulate the polymorphism of my functions in a more straightforward manner. Just... I've no idea how to deal with UTYPE!. Trying:
make utype! <2nd-arg>
带有多种参数(包括对象)的对象总是会导致脚本错误:无效的参数:< 2nd-arg>".
with several kinds of arguments (including an object) was invariably leading to "Script error: invalid argument: <2nd-arg>".
那么,如何使用它呢?是否完全实现了此功能?如果没有,是否有关于其工作方式的任何已知信息?
So, how to operate with it? Is this feature implemented at all? And if not, is there anything known about how it is intended to work?
顺便说一句,我很清楚可以通过类似以下的构造来模拟自制数据类型:
BTW, I'm well aware home brewed datatypes can be simulated by constructs like:
make object! [
class: ...
value: ...
]
补编,写于11月8日:
玩UTYPE!会产生帮助:
>> foo!: make utype! [[] [random: func [value] [42]]]
>> type? foo!
== utype!
>> ? echo
USAGE:
ECHO target
DESCRIPTION:
Copies console output to a file.
ECHO is a native value.
ARGUMENTS:
REBOL System Error:
REBOL System Error #1224: assertion failed
Program terminated abnormally.
This should never happen.
Please contact www.REBOL.com with details.
(在Lion上为2.101.0.2.5).幕后肯定有事发生.
(2.101.0.2.5 on Lion). There was certainly something going on under the hood.
推荐答案
如果您在github上查看Rebol源代码( https://github.com/rebol/rebol/blob/25033f897b2bd466068d7663563cd3ff64740b94/src/core/t-utype.c )很明显,此功能尚未构建.
If you view the Rebol source code on github (https://github.com/rebol/rebol/blob/25033f897b2bd466068d7663563cd3ff64740b94/src/core/t-utype.c) it is clear that this feature has not been built yet.
从文件标题中进行注释:
Comment from the header of the file:
** Notes: NOT IMPLEMENTED
通过curscode.org搜索将带回许多注释,这些注释显示了针对utype!
数据类型的计划方向.
Searching through curecode.org brings back a number of comments which show the direction that is planned for the utype!
datatype.
来源: http://curecode.org/rebol3/ticket.rsp?id= 2137
这篇关于关于UTYPE的知识!在REBOL 3中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!