Comments (3)
It is an interesting idea. Would have to play with the parser and see if it's workable. It creates some ambiguity; note that outside of [], "a=1, b=2" is a single object, but here "a=1,b=1" would be two objects in a list. Also it requires the parser to "look ahead" because in all existing cases, if you see "alpha" in "alpha=1" you know that "alpha" is an object key already. But in this case, you don't know whether "alpha" is an object key or just a string, until you get to the "=" or ":" - so that's a look-ahead to the next token that is never (if I remember right) currently done. Anyway those are just some possible issues I thought of offhand, it would need more digging in.
from config.
I don't think that it will create an ambiguity, on the contrary in my opinion it would be even more coherent with the JSON array semantic. In fact an array can hold a list of primitive types or objects, so the assignment notation can only represent an object since it is not a primitive types.
My real use case it the following: I have a list of components, for each of them I have to provide a configuration. I know that I could use the object notation instead of the array, for example:
components { alpha: { a:1, b:2 }, beta: { x:3, y:4} }
But the main problem with this approach is that I cannot have different configuration for the same "component" because the last will override the previous ones. So here, the array is the best choice:
components [ {alpha: { a:1, b:2 }}, {beta: { x:3, y:4}}, {beta: { x:5, y:6}} ]
But the syntax it is not so clean as it would be expected. Much better would be:
components [ alpha = { a:1, b:2 }, beta = { x:3, y:4 }, beta = { x:5, y:6 } ]
from config.
+1
from config.
Related Issues (20)
- Find a StackOverflowError in config
- Find a StackOverflowError in config
- Find a StackOverflowError in config HOT 1
- underscore characters HOT 2
- Problems with com.typesafe/config and maven-dependency-plugin
- introduce method accepting a list of Objects to add a value
- Should this project be explicitly considered as deprecated/not supported? HOT 29
- Community fork? HOT 7
- Resolving Variable Substitutions Between Multiple Config HOT 1
- Something error when use com.typesafe.config API convert conf file to scala bean class
- withFallBack is not adding value if not present
- how to load the config with substitution details HOT 3
- Add info about which signing keys will be used for published artifacts.
- Cannot provide environment variables programmatically
- Rendering partially resolved appended array results in invalid configuration HOT 1
- Inconsistent behavior with Overflow/Underflow and Exceptions
- Regression in environment variable reading behavior HOT 2
- Add a module info HOT 6
- Question about `ConfigFactory.systemProperties()` on windows HOT 1
- When rendering unresolved ConfigConcatenation, whitespaces are erroneously included
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from config.