'John Clements' via Racket Users (21.10. 16:32):

> 
> > On Oct 21, 2016, at 12:42 PM, Tony Garnock-Jones <to...@ccs.neu.edu> wrote:
> > 
> > You know how Excel guesses whether things are dates or not and messes
> > things up as a consequence? YAML does that too.

YAML does not guess, the processor does. Just like "undefined"
behavior in C, where decisions are left to the compiler. Still,
some people manage to get some use out of it.

> Interesting. I’m trying to wiggle out of your argument, but it’s
> fairly persuasive. Many thanks for your info. Sigh.

If you know what the contents in the file are going to be and that the
processor handles them to your satisfaction, YAML is a convenient
choice. Yes, like whipping up a quick Excel spreadsheet instead of
doing the right thing and separating the data from the evaluation from
the presentation.

    ---
    billing_id: some number
    paid: no
    address: |
      Company
      Address
      Location
    email: some...@some.tld
    billing_date: a date
    due_date: another date
    vat_percent: some number
    items:
    - title: words
      effort: number of hours
      rate: hourly rate
    - title: words
      effort: number of hours
      rate: hourly rate

I've been using this low-ceremony description for invoices for over a
decade and it works reliably with just the right amount of flexibility.

If you want a "natural" looking text-based description of simple data
structures, YAML is not the worst tool to use. Especially if you're
aware of the limitations.

s.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to