Thread overview | |||||
---|---|---|---|---|---|
|
March 29, 2018 IZ release 0.6.11, now with SafeAccess (?.) chains and more | ||||
---|---|---|---|---|
| ||||
Iz 0.6.11 is available now. While parts of the library are no really usable by a wide audience (memory management things) There's been a bunch of interesting additions in the iz.sugar.d module, which can be used independently from the "big stuff" (memory-classes-properties-serialization). SafeAccess: =========== A typecons like structure that wraps a class instance and allows to write safe-access chains: http://bbasile.github.io/iz/iz/sugar/SafeAccess.html ``` // like and && chain but working even if any of the member is null. if (auto m = safeAccess(stuff).member.member.member) {} ``` With DMD, the overhead is small. With LDC there are even case where surprisingly SafeAccess is faster than && (when getters are used). CoercionSafeFloat: ================== After a discussion on the topic in the General section, i made DMD emitting a warning in case of coercion from a float type to a smaller one. While this worked it was certainly a too big breaking change (and unjustified in some) case. sugar.d contains a wrapped float struct that prevents such coercion, when needed: http://bbasile.github.io/iz/iz/sugar/CoercionSafeFloat.html Other: ====== sugar.d and types.d contains other small interesting bits that are usable independently from the "big stuff". Coming next is a getopt-like function, much faster and based on UDA...unfortunately it requires 2.080 for now. links: - https://github.com/BBasile/iz - https://code.dlang.org/ - http://bbasile.github.io/iz/ |
March 29, 2018 Re: IZ release 0.6.11, now with SafeAccess (?.) chains and more | ||||
---|---|---|---|---|
| ||||
Posted in reply to Basile B. | On Thursday, 29 March 2018 at 09:56:54 UTC, Basile B. wrote: > links: Alternative docs: http://iz.dpldocs.info/iz.html |
March 29, 2018 Re: IZ release 0.6.11, now with SafeAccess (?.) chains and more | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Thursday, 29 March 2018 at 12:52:36 UTC, Adam D. Ruppe wrote:
> On Thursday, 29 March 2018 at 09:56:54 UTC, Basile B. wrote:
>> links:
>
> Alternative docs:
> http://iz.dpldocs.info/iz.html
thanks for your help, on IRC, with the missing return, btw.
|
Copyright © 1999-2021 by the D Language Foundation