tags:

views:

225

answers:

2

What does the notwithstanding keyword mean in Google Go?

For background, see http://www.libertatia.org/blog/?p=247, which was linked from Reddit | Programming.

+1  A: 

The Go Programming Language Specification does not include the keyword 'notwithstanding'.

Jonathan Leffler
+6  A: 

Looks like an easter egg in the lexer to me:

http://golang.org/src/cmd/gc/lex.c

the relevant section is the symbol table:

"notwithstanding",      LIGNORE,    Txxx,       OXXX,
"thetruthofthematter",  LIGNORE,    Txxx,       OXXX,
"despiteallobjections", LIGNORE,    Txxx,       OXXX,
"whereas",              LIGNORE,    Txxx,       OXXX,
"insofaras",            LIGNORE,    Txxx,       OXXX,

I guess they could be used to test handling of the lexical type LIGNORE, but there doesn't seem to be any "real" ignored tokens.

Jimmy
ugh, their lexer function has a label called 'l0' (el-zero) for the beginning statement. compilers should just be designed to delete your code if you actually use l0 as an identifier in your code.
Jimmy