Store and Restore

While trying to guess what happens with the restore command (see this thread), I realized that a better approach for ‘restoring’ an image could be simply to use the input command with the variable name as an argument.
So, that’s what I’ve implemented tonight, and you can now do this:

foo : 
   sample lena
   store. lena
   input $lena

This seems very logical, as the store command actually assign a variable with the binary content of an image. The good thing with associating the restore behavior with the input command is:

  • You don’t even need to specify input, so writing sample lena store lena $lena is enough (as input is the only command that can be replaced by nothing).
  • You have the possibility to insert multiple instance of the stored image at different locations of the image list, such as sample lena,bottles,eagle store[0] lena i[0,1] $lena.

I really find this syntax to be logical, so I’ll remove the native version of the restore command in the next stable release (but it will still be usable, as a custom command).