diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-02-23 10:16:18 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-02-23 10:16:18 -0300 |
| commit | 9243c414d92c253edd908f438caa31e2aa16f3f4 (patch) | |
| tree | e8959a48f4672037aef061cc6eb82bba21d0766b /ltm.h | |
| parent | 477ca2fe8ceaf79038972977915987adbef0e425 (diff) | |
| download | lua-9243c414d92c253edd908f438caa31e2aa16f3f4.tar.gz lua-9243c414d92c253edd908f438caa31e2aa16f3f4.tar.bz2 lua-9243c414d92c253edd908f438caa31e2aa16f3f4.zip | |
first version of empty entries in tables
(so that, in the future, tables can contain regular nil entries)
Diffstat (limited to 'ltm.h')
| -rw-r--r-- | ltm.h | 8 |
1 files changed, 7 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltm.h,v 2.31 2018/02/09 15:16:06 roberto Exp roberto $ | 2 | ** $Id: ltm.h,v 2.32 2018/02/17 19:20:00 roberto Exp roberto $ |
| 3 | ** Tag methods | 3 | ** Tag methods |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -45,6 +45,12 @@ typedef enum { | |||
| 45 | } TMS; | 45 | } TMS; |
| 46 | 46 | ||
| 47 | 47 | ||
| 48 | /* | ||
| 49 | ** Test whether there is no tagmethod. | ||
| 50 | ** (Because tagmethods use raw accesses, the result may be an "empty" nil.) | ||
| 51 | */ | ||
| 52 | #define notm(tm) ttisnilorempty(tm) | ||
| 53 | |||
| 48 | 54 | ||
| 49 | #define gfasttm(g,et,e) ((et) == NULL ? NULL : \ | 55 | #define gfasttm(g,et,e) ((et) == NULL ? NULL : \ |
| 50 | ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e])) | 56 | ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e])) |
