lua-users home
lua-l archive

Re: Question on get/setmetatable()

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Lorenzo Donati once stated:
> 
> [1] I do hate with a passion to remember how many and different 
> identifiers are reserved in C: mem*, str*, *_t, everything beginning 
> with _ and a capital, every all caps identifiers beginning with E, and 
> what else!?!. In a modern language I just want proper namespacing 
> facilities, not tons of conventions to avoid clashing, especially when 
> clashing doesn't mean a clean syntax error but nasty undefined behavior!!!
 It's pretty bad actually. The following are reserved by C (using the C99
standard and the pattern "*" matches the character set for a valid
identifier):
	The keywords (obviously) (6.4.2)
	any id matching ^_[A-Za-z_]* (7.1.3)
	function matching *[fl] (7.26.1)
	function matching is* or to* (7.26.2)
	macro matching E[0-9A-Z]* (7.26.3)
	macro matchint PRI[a-zX]* or SCN[a-zX]* (7.26.4)
	macro matchint LC_[A-Z]* (7.26.5)
	macro matching SIG[A-Z]* or SIG_[A-Z]* (7.26.6)
	typedef matching int* uint* *_t (7.26.8)
	macro matching INT*_MAX INT*_MIN INT*_C UINT*_MAX UINT*_MIN UINT*_C (7.26.8)
	function matching str[a-z]* (7.26.10)
	function matching mem[a-z]* wcs[a-z]* (7.26.11)
 C11 adds the following (using the C11 standard here):
	macro matching ATOMIC[A-Z]* (7.31.8)
	typedef matching atomic_[a-z]* memory_[a-z]* (7.31.8)
	enum matching memory_order_[a-z]* (7.31.8)
	function matching atomic_[a-z]* (7.31.8)
	macro matching TIME_[A-Z]* (7.31.14)
	any id matching cnd_[a-z]* mtx_[a-z]* thrd_[a-z]* tss_[a-z]* (7.31.15)
 POSIX might carve out more, but that's left as an exercise to the reader.
 -spc

AltStyle によって変換されたページ (->オリジナル) /