Why should file names intended for executables be valid identifiers?

Jacob Carlborg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Dec 16 23:25:12 PST 2015


On 2015-12-17 05:26, Shriramana Sharma wrote:

> Sorry but I don't get this fully: can't a hyphen be part of such mangled
> names? Aren't they just strings that the linker hashes or something? (My
> knowledge of compiler/executable internals is limited.)

I'm not sure about a hyphen but a dollar sign is allowed for example.

> And any reflection
> of the module name would also be just a string which need not be a valid
> identifier no?

I would guess it's to simplify the compiler.

Funny thing: Ruby allows you to have names of methods that you cannot 
declare and cannot call :). The trick is to use metaprogramming and 
reflection to declare and call the methods.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list