4 ms·
OK, I totally get the argument that YAML is for data and not programming. But I'm not sure the line between them is always clear. For example: I used to use YA
by decasia 8y ago
OK, I totally get the argument that YAML is for data and not programming. But I'm not sure the line between them is always clear.
For example: I used to use YAML to define field mappings between external data and internal models in a Rails application.
like:
- src: fieldA
dest: field_a
filter: name_of_some_filter_function
Is this programming? Data? Really it's configuration for an import library, but I find the line blurry.
- fendy3002 8y agoImo that's data, except if the filter is an executable script. For me, the programming part in yaml is string, either single, array or multiline, that will be compiled, executed or eval-ed. In your case, it can be defended as documentation for data mapping, but executable scripts are rarely so.
- philipov 8y agoI once built an interpreter that parsed YAML files as s-expressions, just to watch them scream. I called it YAMlisp, because it's better than a potato.