[nem-en] Nemerle 0.2.0 released

mike roome arhra at arslinux.com
Mon Sep 13 01:28:47 CEST 2004


>    * New cool string interpolation feature -- the `$' operator is now
>      shorthand to Nemerle.IO.sprint, example usage:
>
>    def x = 40;
>    def y = 42;
>        System.Console.Write ($ "$(x + 2) == $y\n")
>
>      Any expression can be used in $(...), but there might be problems
>      with embedded strings and so on. It is meant to be used with simple
>      expressions like array/field access, method call and so on.

Great idea. However, the print/sprint macros have a small problem -
there's no way (afaict) of using a literal $ in them (well, you can do
$('$'), (or even $(\"$\"), it seems), but that's.. inelegant). I've hacked
up a tiny patch that adds $$ as an escape for it (that is, $"total:
$$$total" == "total: $" + total.ToString();)

(hopefully the patch is in an ok format, i've never been too sure of what
the right way to send patches is...)
-- 
Mike Roome
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dollar_escape.patch
Type: text/x-patch
Size: 499 bytes
Desc: not available
Url : /mailman/pipermail/devel-en/attachments/20040913/1bc30b16/dollar_escape.bin


More information about the devel-en mailing list