On Fri, Oct 20, 2017 at 4:18 AM, Jean-Philippe André <j...@videolan.org> wrote:
> 2017-10-20 8:15 GMT+09:00 Carsten Haitzler <ras...@rasterman.com>:
>
>> On Thu, 19 Oct 2017 14:28:27 -0200 Gustavo Sverzut Barbieri
>> <barbi...@gmail.com> said:
>>
>> > > +         get {
>> > > +            keys {
>> > > +               name: string; [[Configuration option name.]]
>> >
>> > shall we document and handle this as a path, so nested Eets can be
>> > used, such as in E (wm).
>>
>
> It could be. Why not.
> Then use '.' or '/' for path separator? :)

Pick one, and if possible, choose something there is a standard for,
like XPath or JSONPath, allows to address keys or indexes.

They also allow search and collections, so would be bit more work to
implement (ie: give me all keys named "x"), where you'd return a
List/Array of Eina_Value... but I already used things like that in the
past and helps. In my case it was more useful in "set", where I wanted
to set lots of properties to the same value (ie: colors).


> I am in fact not very happy about the value type returned, as it's @owned
> (terrible in C... it WILL leak).
> But returning const(any_value) is hard (lifetime of the value? lifetime of
> the strings stored?).

I'd return `any_value` not (_ptr), so `eina_value_flush()` instead of
`eina_value_free()`. Simpler to manage, less to check.

However doesn't solve the "@owned" issue... that's life. Tools such as
coverity will report leaks... and that's one reason to not come with
'slstr' kind of solution... as that could trick people into forgetting
to "flush".

Also, if the value is needed further, being able to carry the
Eina_Value struct around is handy... no need to deep-copy the whole
thing.


-- 
Gustavo Sverzut Barbieri
--------------------------------------
Mobile: +55 (16) 99354-9890

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to