How to escape identifiers in Boo?

202 views Asked by At

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

2

There are 2 answers

4
Andrey Shchekin On BEST ANSWER

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).
4
Mauricio Scheffer On

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.