One nice thing about C# is their support for escaping keywords. For instance, if you want a var named for, you just say @for. This probably matters especially for the CLR notion where different languages might have different reserved words.
Still, I think it matters even from a one-language perspective. For instance, instead of creative spelling like clazz for var names in Java, I prefer to say $class.
I think the same $ prefix would work well in Fan. That is, allow $ at the front of var names but only at the front. I'm mixed on whether behind the scenes $class should be seen as the name class or the name $class, but in either case, the escaping is nice, I think.
andyMon 21 Jul 2008
I don't have an opinion on that feature yet - but just FYI - it can't be $ because that character cannot be used for identifiers in C# code, which is a requirement to write native code.
tompalmerMon 21 Jul 2008
Thanks for the info. Then at least it can't keep $ behind the scenes (resolving my question above). But that could still be the escape char in source, and I think it's the most obvious one.
brianMon 21 Jul 2008
C# and all CLR languages require that so that they can use each identifiers reserved as keywords. Since C# takes common identifiers like out, in, and value its a darn good thing.
Fan will probably need it at some point, but it is really is only useful when combining languages (Java really needs it).
So I'm inclined to defer this until we have a real use case (I don't really think $class justifies it).
tompalmer Mon 21 Jul 2008
One nice thing about C# is their support for escaping keywords. For instance, if you want a var named
for
, you just say@for
. This probably matters especially for the CLR notion where different languages might have different reserved words.Still, I think it matters even from a one-language perspective. For instance, instead of creative spelling like
clazz
for var names in Java, I prefer to say$class
.I think the same
$
prefix would work well in Fan. That is, allow$
at the front of var names but only at the front. I'm mixed on whether behind the scenes$class
should be seen as the nameclass
or the name$class
, but in either case, the escaping is nice, I think.andy Mon 21 Jul 2008
I don't have an opinion on that feature yet - but just FYI - it can't be
$
because that character cannot be used for identifiers in C# code, which is a requirement to write native code.tompalmer Mon 21 Jul 2008
Thanks for the info. Then at least it can't keep
$
behind the scenes (resolving my question above). But that could still be the escape char in source, and I think it's the most obvious one.brian Mon 21 Jul 2008
C# and all CLR languages require that so that they can use each identifiers reserved as keywords. Since C# takes common identifiers like out, in, and value its a darn good thing.
Fan will probably need it at some point, but it is really is only useful when combining languages (Java really needs it).
So I'm inclined to defer this until we have a real use case (I don't really think $class justifies it).