Relaxing the definition of isSomeString and isNarrowString

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Sun Aug 24 22:17:26 PDT 2014


On Mon, 25 Aug 2014 01:23:57 +0400
Dmitry Olshansky via Digitalmars-d <digitalmars-d at puremagic.com> wrote:

> Just make a function that translates UTF-8 into Latin-1, use ubyte
> for Latin-1.
i don't want ubytes. but there is nothing bad with assigning latin-1
text to ordinary string after conversion. ;-)

the downside is memory consumption. i have ALOT of ctfe-magic,
compiling some modules easily hits memory limits (yeah, x86; no, i
don't planning to switch to x86_64 soon), and calling tr-functions
trashes memory even more (i'm not even talking about code readability
here). what i really want is "verbatim" string literal, which scanner,
lexer and parser just passes "as-is", byte-to-byte, without trying to
decode it as UTF-8. or (this can be easier to implement, i think) at
least something like pragma(encoding, "..."). with at least two working
values: "utf-8" and "native".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140825/f82959ff/attachment.sig>


More information about the Digitalmars-d mailing list