[racket] Suggestion for saving preferences

From: Eduardo Bellani (ebellani at gmail.com)
Date: Mon Apr 4 23:49:50 EDT 2011

Hello list.

I am trying to figure out a way to save the state of an app and I am
having trouble trying to come up with a decent solution, so I figure
that is wise to ask wiser people :)

The state of the app is given by several different structs such as
this one:

;; algorithm contains :
;;   a name as a string
;;   a list of pairs, where
;;     the car is a string representing a name
;;     the cdr is any value.
(struct algorithm (name arguments))

(algorithm "adding" '(("number" . 10)
                      ("amount" . 1)))

For now, I have 2 paths in mind :

* Use serializable structs, and saving them to a file. 2 problems
  arise from this solution:
  a) I'm having more or less the same problem as [1], specially since
  I am trying to isolate the modules where the structs are declared so
  I can test them.
  b) The serializable format is pretty funky (as opposed to a clear
  saved list), leading to a worse file to edit by hand.

* Create some functions like algorithm->list list->algorithm. The only
  drawback I see is that I will have to create variations for each struct.

Does anybody have a suggestion/alternative?

Thanks for the time.

Eduardo Bellani

omnia mutantur, nihil interit.

Posted on the users mailing list.