什么是保存哈希的最佳方法!在Rebol中阻止?

问题描述 投票:1回答:1

我正在使用Rebol2,并希望保留HASH!块。

当前,我将其转换为to-string,然后使用save

有更好的方法吗?例如:

r: make hash! ["one" "two"]

我想将其保存到文件,然后将其加载回r

rebol red rebol2
1个回答
1
投票

您非常接近目标。只需使用save/allload

>> r: make hash! ["one" "two"]
== make hash! ["one" "two"]
>> save/all  %htest r
>> r: load %htest
== make hash! ["one" "two"]

如果要在Red中获得相同的结果,则只需要一个命令

>> r: do load %htest
== make hash! ["one" "two"]
© www.soinside.com 2019 - 2024. All rights reserved.