Question

If I have an identifier with a same name as existing keyword, how do I escape it?

Was it helpful?

Solution

That's what I found (and this is probably the final answer):

  1. It is possible to use @ as a prefix in identifier names. However, by default it creates a different identifier (@a != a).
  2. Since @ is allowed, it is possible to add a new compiler step to the pipeline that will do TrimStart('@') on all identifiers. It works ok, you will just have to remember all types of things that have names.
  3. If you are using Rhino.DSL, it has a UseSymbols step that converts @a into 'a', which had confused me a lot (I was working with project that included this step by default).

OTHER TIPS

I don't think anything like the C# @ prefix is implemented in Boo... but I'm pretty sure it could be achieved by inserting a custom compiler step to the beginning of the compiler pipeline.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top