pure format

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 4 09:21:53 PDT 2015


On Thursday, 4 June 2015 at 14:33:39 UTC, Oleg B wrote:
> Hello. I not found realization of pure format function (in 
> phobos it not pure) and write minimal custom realization.
> https://github.com/dexset/desstdx/blob/master/source/des/stdx/pformat.d#L472
> Now it works with numbers and strings, but in future I improve 
> it.
> Maybe my realization can help someone =)
> Contained in the dub package 
> http://code.dlang.org/packages/desstdx
>
> If pure format exists tell about it, please.

std.format.format should be pure if its arguments have pure 
toString methods or are built-in types. There may be 
implementation issues preventing it for one reason or another (I 
don't know), but if so, then that's a bug that needs to be fixed. 
Regardless, there should be no need for a separate format 
function which is pure.

- Jonathan M Davis


More information about the Digitalmars-d mailing list