I am using Rebol2 and would like to persist a HASH! block.
Currently I am converting it to-string then using save.
Is there a better way? For example:
r: make hash! ["one" "two"]
I want to save this to a file, then load it back to r.
On
You do that just like with any other value - save, then load.
There are zero benefits in using hash! for persistent storage, by the way. What load gives you back is a plain block! ([make hash! [...]]). Populating hashtable from this loaded data takes more time compared to just loading block!, but gives you faster lookups thereafter.
In other words, you can just:
>> save %database [one two]
>> make hash! load %database
== make hash! [one two]
As described in the tutorial that you linked.
you are very near your goal. Just use
save/allandloadIf you want the same result in Red you just need one command more