Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

notwithstanding keyword

Tags:

go

What does the notwithstanding keyword mean in Google Go?

like image 545
Justin Ethier Avatar asked Mar 22 '10 03:03

Justin Ethier


2 Answers

2017 Update: There was a major parser update and the new one no longer seems to support these Easter egg words.


Looks like an easter egg in the lexer to me:

https://github.com/golang/go/blob/08e25fc1ba397e02ec776561ed73b7f9a8b94392/src/cmd/compile/internal/gc/lex.go#L2152-L2156

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.

like image 109
Jimmy Avatar answered Nov 05 '22 22:11

Jimmy


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

like image 20
Jonathan Leffler Avatar answered Nov 05 '22 21:11

Jonathan Leffler