{"action":"opened","issue":{"url":"https://api.github.com/repos/ElektraInitiative/libelektra/issues/533","repository_url":"https://api.github.com/repos/ElektraInitiative/libelektra","labels_url":"https://api.github.com/repos/ElektraInitiative/libelektra/issues/533/labels{/name}","comments_url":"https://api.github.com/repos/ElektraInitiative/libelektra/issues/533/comments","events_url":"https://api.github.com/repos/ElektraInitiative/libelektra/issues/533/events","html_url":"https://github.com/ElektraInitiative/libelektra/issues/533","id":134807340,"number":533,"title":"Improve default-value","user":{"login":"markus2330","id":7949075,"avatar_url":"https://avatars.githubusercontent.com/u/7949075?v=3","gravatar_id":"","url":"https://api.github.com/users/markus2330","html_url":"https://github.com/markus2330","followers_url":"https://api.github.com/users/markus2330/followers","following_url":"https://api.github.com/users/markus2330/following{/other_user}","gists_url":"https://api.github.com/users/markus2330/gists{/gist_id}","starred_url":"https://api.github.com/users/markus2330/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markus2330/subscriptions","organizations_url":"https://api.github.com/users/markus2330/orgs","repos_url":"https://api.github.com/users/markus2330/repos","events_url":"https://api.github.com/users/markus2330/events{/privacy}","received_events_url":"https://api.github.com/users/markus2330/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ElektraInitiative/libelektra/labels/proposal","name":"proposal","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/ElektraInitiative/libelektra/milestones/8","html_url":"https://github.com/ElektraInitiative/libelektra/milestones/0.8.16","labels_url":"https://api.github.com/repos/ElektraInitiative/libelektra/milestones/8/labels","id":1587744,"number":8,"title":"0.8.16","description":"","creator":{"login":"markus2330","id":7949075,"avatar_url":"https://avatars.githubusercontent.com/u/7949075?v=3","gravatar_id":"","url":"https://api.github.com/users/markus2330","html_url":"https://github.com/markus2330","followers_url":"https://api.github.com/users/markus2330/followers","following_url":"https://api.github.com/users/markus2330/following{/other_user}","gists_url":"https://api.github.com/users/markus2330/gists{/gist_id}","starred_url":"https://api.github.com/users/markus2330/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markus2330/subscriptions","organizations_url":"https://api.github.com/users/markus2330/orgs","repos_url":"https://api.github.com/users/markus2330/repos","events_url":"https://api.github.com/users/markus2330/events{/privacy}","received_events_url":"https://api.github.com/users/markus2330/received_events","type":"User","site_admin":false},"open_issues":26,"closed_issues":0,"state":"open","created_at":"2016-02-17T07:39:03Z","updated_at":"2016-02-19T08:48:31Z","due_on":"2016-03-30T22:00:00Z","closed_at":null},"comments":0,"created_at":"2016-02-19T08:48:31Z","updated_at":"2016-02-19T08:48:31Z","closed_at":null,"body":"The current default values logic is hard-coded in `ksLookup`. See `elektraLookupBySpecDefault`, when a metakey `default` is found, a new so-called default-key (starting with `/`) is created.\r\n\r\nThere are multiple issues with that:\r\n\r\n1. The metadata `default` only allows values, no calculation. Actually it should be similar to `assign` (calculated by `conditionals` and `matchcheck`), with the only difference that the value would be invisible when the key is present. Such more complex calculation should be, of course, done in plugins and not in the core.\r\n2. The default-key (starting with `/`) might be an over-optimization of using as little namespaces as possible. The question is if we should introduce a `default`-namespace? The default-namespace is quite different, because it does not work recursively, instead it is only considered for the key which was searched for, not for any other keys that are traversed because of symlinks. It is, however, also transient, in the same way as the `proc` namespace.\r\n\r\nAnyway, documentation about the default-key logic is clearly missing, even if we decide to leave 2. as is.\r\n\r\n@tom-wa @KurtMi What do you think?"}}