[nem-en] format strings in the sprint macro

Philippe Quesnel philippe.quesnel at gmail.com
Sun Jan 8 01:17:39 CET 2006


interesting,
I think using a different character to separate the value from the format is
a good idea !!

ps: I posted a similar / related question on the BOO mail list,
maybe some good ideas will popup that apply to Nemerle ;-)

On 1/7/06, Michal Moskal <michal.moskal at gmail.com> wrote:
>
> Hi,
>
> We (Kamil and I) were just discussing adding String.Format-like formatting
> strings to the sprint macro (better known as $). A good overview of the
> formatting strings is available at:
>
>   http://www.stevex.org/CS/blogs/dottext/articles/158.aspx
>
> For example: string.Format ("foo{0,5:0.00}", 1) will return "foo 1.00".
> The idea would be for $ "foo$(5:0.00, 1)" to return the same.
> The problem is with syntax -- we thought it would be good to split at the
> last comma (possibly excluding ones in parens). This could lead to
> monsters like:
> $"Ala has $(0:?#,##0.00;(?#,##0.00);Nothing,apple_count) apples".
>
> Maybe other character, or other syntax would be better? What do you think?
>
> --
>    Michal Moskal,
>    http://nemerle.org/~malekith/
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /mailman/pipermail/devel-en/attachments/20060108/dfa42f62/attachment.html


More information about the devel-en mailing list