Hello,

Sorry to answer myself, but complementing on what I've said before.
There's also ABI and optimization's concern on adding empty value for
all types. Since Eina_Value is defined in eina_value.h header, it is
public and needs to be backwards compatible ABI-wise, and since it can
be used by value with eina_value_setup we can't just add a field in
struct _Eina_Value. And, since Eina_Value_Union is the size of 8 bytes
in most architectures, it means we'd need an unnecessary indirection
for all except char, short and ints if we added an empty state.

Regards,

On Sun, Jan 17, 2016 at 10:51 PM, Felipe Magno de Almeida
<felipe.m.alme...@gmail.com> wrote:
> On Wed, Jan 13, 2016 at 12:38 AM, Jean-Philippe André <j...@videolan.org> 
> wrote:
>> Hi Felipe,
>>
>> You added the optional type to eina value. I'm not sure what it's point is.
>> I understand an optional value can be empty (ie. void and not "nil" or 0 or
>> whatever).
>>
>> But I don't understand why this couldn't be implemented inside all standard
>> values. Add an "empty" property to them.
>>
>> Could you explain shortly why we need a special type? I'm sure you had a
>> good reason :)
>
> Hello jpeg,
>
> When implementing a data model for esskyuehl we needed a way to handle
> NULL values from database for certain columns. The "empty" value is
> a specific, valid, value for that type.
>
> If we added "empty" property to all values in Eina Value, we'd be adding
> an ambigous information for each use. Is that an invalid value? An
> indication of an error? Is that a valid value? Equivalent to a NULL
> Eina_Value?
>
> The optional doesn't have this problem, it is the equivalent of
> a "T + 1" in algebraic data type, with 1 meaning "empty", which
> would be used when an empty value is possible and is a valid
> value.
>
> That way we don't need to check for emptiness for all current
> uses of integer Eina Values or some other type, for example.
> Their semantics are completely intact..
>
>> Thanks in advance,
>
> Sorry for the delay of this answer,
>
>
>> --
>> Jean-Philippe André
>
> Regards,
> --
> Felipe Magno de Almeida



-- 
Felipe Magno de Almeida

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to