GithubHelp home page GithubHelp logo

Comments (3)

abstrctn avatar abstrctn commented on June 22, 2024

This is an open question for users: whether arrays should be "sticky" if they're opened multiple times. At the moment, both simple and complex arrays can be reopened:

[complex]
key: value
[]

[complex]
key: value
[]

[simple]
* value
[]

[simple]
* value
[]
{
  "complex": [{"key": "value"}, {"key": "value"}],
  "simple": ["value", "value"]
}

Since an arrays type is decided by whether a key: value or a * value is found first, I think that if you reopen an array, it makes sense in a way to continue to parse only either complex or simple values. (Inside a complex array, * value isn't treated as an array element, and vice versa.)

@minikomi, @archietse - which do you think would be most intuitive for users?

from archieml-js.

minikomi avatar minikomi commented on June 22, 2024

Yep, I didn't realize the key / simple text sticky rule while I was playing about with this. I think once you know the rule, the current behavior makes sense.

from archieml-js.

abstrctn avatar abstrctn commented on June 22, 2024

We've been discussing this behavior at NYT, and think you're original assumption that later array definitions should overwrite prior definitions is more intuitive. The most recent proposal for the spec reflects this, and archieml-js v0.2.0 has been updated to function this way.

from archieml-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.