Show
Ignore:
Timestamp:
05/25/08 22:12:38 (5 years ago)
Author:
mokehehe
Message:

Add 'begin' syntax.
Add 'gensym' for macro.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/c/misc/mlisp/core/m_basic.cpp

    r12283 r12358  
    245245} 
    246246 
     247static SExp builtin_gensym() { 
     248        static int cnt; 
     249        char buf[16]; 
     250        sprintf(buf, "G:%d", ++cnt); 
     251        return intern(buf); 
     252} 
     253 
    247254 
    248255 
     
    331338                {       "compile",      builtin_compile,        1,      1,      }, 
    332339                {       "exit",         builtin_exit,           0,      1,      }, 
     340 
     341                {       "gensym",       builtin_gensym,         0,      0,      }, 
    333342        }; 
    334343        for (int i=0; i<sizeof(tbl)/sizeof(*tbl); ++i) {