2009-05-04 02:46:13 -04:00
|
|
|
namespace factor
|
|
|
|
{
|
|
|
|
|
2009-05-04 02:00:30 -04:00
|
|
|
#define DEFPUSHPOP(prefix,ptr) \
|
2009-05-04 05:50:24 -04:00
|
|
|
inline static cell prefix##peek() { return *(cell *)ptr; } \
|
|
|
|
inline static void prefix##repl(cell tagged) { *(cell *)ptr = tagged; } \
|
2009-05-05 12:33:35 -04:00
|
|
|
inline static cell prefix##pop() \
|
2009-05-04 02:00:30 -04:00
|
|
|
{ \
|
2009-05-04 05:50:24 -04:00
|
|
|
cell value = prefix##peek(); \
|
|
|
|
ptr -= sizeof(cell); \
|
2009-05-04 02:00:30 -04:00
|
|
|
return value; \
|
|
|
|
} \
|
2009-05-04 05:50:24 -04:00
|
|
|
inline static void prefix##push(cell tagged) \
|
2009-05-04 02:00:30 -04:00
|
|
|
{ \
|
2009-05-04 05:50:24 -04:00
|
|
|
ptr += sizeof(cell); \
|
2009-05-04 02:00:30 -04:00
|
|
|
prefix##repl(tagged); \
|
|
|
|
}
|
2009-05-04 02:46:13 -04:00
|
|
|
|
|
|
|
}
|