-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend Maps support. #85
Comments
Also the reuse of the options in lookup seems to work. See for tests: +1 |
Thanks for the review!
That's because |
Oh, one side note: Not all attributes have (at least optional) specifications (what is the specific term idk?) what they are. Only some have as I found this a little bit annoying/confusing with catmandu and not user friendly specially with the many attributes/options, Something like this would be nice: Even nice if the options/attributes would not have quotationmarks. This also touches: #74 because if we had consistently |
There are "parameters" and "options", if that's what you mean. Parameters are unnamed, options are named. The problem with maps in particular is that we (ab)use the options as local map, so we can't have actual options as well.
You don't need them here, as long as your keys/values only contain word characters¹:
¹ EDIT: And as long as they're not reserved keywords. |
But that means that having corresponding parameters/options is not easy/possible? |
No, I don't think that's possible in general. |
For the record, if I understand the discussion correctly, the suggestion by @TobiasNx to always use named parameters is basically what I had in mind writing this comment:
Right now we have unnamed and named parameters since it's what Catmandu does. In a future attempt to improve the language while working on a common spec (hence |
In order to allow lookups to access separately defined maps, I'd like to propose the following changes:
Metafix
implementMaps
interface to allow adding maps programmatically (including internal Java maps¹).put_map("mapName", "key": "value", ...)
: Define internal map inside Fix script.put_filemap("fileName"[, "mapName"][, "sep_char": "..."])
: Define external file map.lookup
function usages:lookup("fieldName", "key": "value", ...)
: Access local map (unchanged).lookup("fieldName", "fileName"[, "sep_char": "..."])
: Access external file map (see above); will be defined on first use (unless already defined viaput_filemap
) and reused afterwards (ignoring any options).lookup("fieldName", "mapName")
: Access internal map (see above); must be defined (viaput_map
), otherwise interpreted as new file map.¹ No support for standalone Java maps (
put_javamap
?) required yet.The text was updated successfully, but these errors were encountered: