Unless I am missing something, the interpreter does not provide a mechanism to do save & rebuild any possible type of variable (there's a lot of complexity with namespaces, objects, references to any of these etc.). "Serialisation" might come closest, but (a) it's not human-readable and (b) it's more an interpreter-mechanism than a tool for application-developers, so I do not even want to talk about it further - there are better ways to deal with that ;)
However, there is a user command which will allow you to do that:
]save (Object) (Filename)
so
]save x h:\temp\x
saved it to a unicode-file h:\temp\x.dyalog which could also be edited using any Unicode-capable editor (or even )edit h:\temp\x.dyalog ).
By doing
]load h:\temp\x
you can load that object into the workspace. Alternatively, use
]xyz←load h:\temp\x -noname
to assign the value to xyz
instead of loading into x
again.
And there is more... I assume your question is the result of wanting to be able to reproduce some data. Are you aware of the "component file system" which offers an easy way to save variables like x
to files and reload them from there?
Example:
{x ⎕fappend ⍵ ⋄ ⎕FUNTIE ⍵}'h:\temp\x'⎕FCREATE 0
to save x
and then
{r←⎕fread ⍵,1 ⋄ ⎕FUNTIE ⍵ ⋄ r}'h:\temp\x'⎕FTIE 0
to read it again. (Disclaimer: these examples are over-simplistic because there is no error-handling in case the file you're creating already exists etc. - usually that also needs to be taken care of, but that would have been too much distraction for this little sample...)
So, finally, I think my real concern is about the context of that problem and the purpose you're trying to achieve. In my entire APL-life I have rarely seen things that were "not doable" - but sometimes the path is different than what you'd expect (knowing other languages)...