[phobos] std.base64 replacement

Daniel Murphy yebblies at gmail.com
Thu Oct 14 03:44:07 PDT 2010


On Thu, Oct 14, 2010 at 12:12 PM, Masahiro Nakagawa <repeatedly at gmail.com>wrote:

> 1. The template parameters '!' and '/' are not justified. They should be
>> runtime parameters. Rule of thumb: use generic code when you stand to
>> profit.
>>
>
> I don't understand this point.
> Please tell me the merit of runtime parameters.
> I can't imagine such situations.
>
>
I actually really like the Base64Impl.  It allows you to build DecodeMap
statically, and provides a very nice api for using custom base64 variations.
I'm not sure how you'd do anything this nice with runtime parameters.

alias Base64('^', '&', Base64.NoPadding) CustomBase64;
CustomBase64.encode(data)
CustomBase64.decode(encodeddata)

vs

encode(data, '^', '&', Base64.NoPadding);
decode(encodeddata, '^', '&', Base64.NoPadding);

I didn't really see this until I started using it. :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/phobos/attachments/20101014/d8753749/attachment-0001.html>


More information about the phobos mailing list