Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> The specific problems in the example could be solved by changing how the data is represented.

Finding the "right" representation for a given set of data is an interesting problem, but most (all) of the time the representation is specified by someone/something else.

In the past I've written a [preprocessor][1] that adds some power to the representation while avoiding general purpose computation. For example,

    (buckets
      (let ([(regional region (name policy) ...)
             ((['name name] ['region region] ['lifecycle_policy policy]) ...)])
        (regional us-west
          (alpha-hourly (delete_after_seconds 345600))
          (alpha-daily (delete_after_seconds 2592000))
          (alpha-monthly (delete_after_seconds 31536000))
          (bravo-hourly (delete_after_seconds 345600))
          (bravo-daily (delete_after_seconds 259200))
          (bravo-monthly (delete_after_seconds 31536000)))))
Macros, basically. Arithmetic would help there, but that might be too much.

[1]: https://github.com/dgoffredo/llama



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: