Hi Russ,

The limitation of STON not being capable of serialising a block closure still 
stands and will probably not change very soon (it open up the whole language to 
be written out).

You can work around this though, with sort functions for example.

Here is an example:

{ 1->#one. 3->#three. 2->#two } sorted: (STON fromString: (STON toStringPretty: 
#key ascending)).

SortFunctions are really cool BTW (they can handles nil values elegantly).

Sven

> On 27 Jun 2020, at 16:07, Russ Whaley <whaley.r...@gmail.com> wrote:
> 
> Good morning all from stormy Ohio/USA.  Hope everyone is well and sheltering 
> effectively from COVID, etc.
> 
> I have a STON question.  FIrst off, I LOVE STON.  It has been the answer to 
> my (minimal) persistence needs.  I'm writing two different applications, both 
> of which I hope to distribute someday, and I struggled with what would work 
> to save configurations, templates, status, etc.  STON was the answer for me - 
> it's very easy to install and simple to use.
> 
> But as I add the next feature/function in my code - sort blocks - as soon as 
> I tried to save them (a collection of them in an instvar)... I get an error 
> on the writeToSTON, and the target file is now corrupt - at the point where 
> it tried to write the blocks.  I have looked in the documentation and it 
> plainly states the version I'm using does not yet address blocks - but I was 
> hoping someone out there has developed a workaround, or perhaps has STON been 
> updated to handle blocks?
> 
> I could make the jump to a more sophisticated storage mechanism (i.e. Fuel?), 
> but I'd rather spend my time working on features and figuring out the Spec2 
> GUI. :)
> 
> Any advice is welcome and appreciated.
> 
> Thanks!
> Russ 
> 
> -- 
> Russ Whaley
> whaley.r...@gmail.com


Reply via email to