English 中文(简体)
How to escape identifiers in Boo?
原标题:
  • 时间:2009-12-20 10:43:02
  •  标签:
  • syntax
  • boo

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

最佳回答

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).
问题回答

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.





相关问题
How to change out-of-focus text selection color in Xcode?

Okay, I ll bite. I ve got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, ...

pdo database abstraction

Can someone help me to see what is going wrong with this setup I build the @sql query in the function below like this. The extra quotes are setup in the conditions array. $sql .= " WHERE $...

I wish I could correlate an "inline view"

I have a Patient table: PatientId Admitted --------- --------------- 1 d/m/yy hh:mm:ss 2 d/m/yy hh:mm:ss 3 d/m/yy hh:mm:ss I have a PatientMeasurement table (0 to ...

Syntax help! Php and MYSQL

Original: $sql = "SELECT DATE(TimeAdded) AS Date, $column_name FROM Codes ORDER BY TimeAdded ASC"; Altered: $sql = "SELECT DATE("m", TimeAdded ) AS Date, ColumnName FROM TableName ORDER BY ...

Is this code Equivalent

I am not a fan of the following construction if (self = [super init]) { //do something with self assuming it has been created } Is the following equivalent? self = [super init]; if (self != ...

热门标签