Abstract
The print() function for sstd::terp::var
.
sstd::terp::var
向け print() 関数.
Header file
namespace sstd{
void print(const sstd::terp::var& rhs);
void for_printn(const sstd::terp::var& rhs);
}
Description
Function name | Description |
---|---|
print() | prints the sstd::terp::var type.sstd::terp::var 型を表示します. |
for_printn() | is an internal implementation for sstd::printn() macro defined at print/printn.sstd::printn() マクロ向け内部実装.マクロ実装は print/printn を参照すること. |
Usage
- main.cpp
#include <sstd/sstd.hpp> int main(){ sstd::terp::var x; x = sstd::terp::list(3); x[0] = "a"; x[1] = sstd::terp::list(2); x[1][0] = "b"; x[1][1] = "c"; x[2] = sstd::terp::hash(); x[2]["key"] = "value"; sstd::print(x); sstd::printn(x); // a `printn` macro is replaced to the variable name of 'x', string ' = ' and `for_pirntn()`. }
- Execution result
["a" ["b" "c"] {"key": "value"}] x = ["a" ["b" "c"] {"key": "value"}]
Implementation
- Source: sstd/src/memory/terp/print.cpp
- Header: sstd/src/memory/terp/print.hpp
- Test: test/memory/terp/terp_print.cpp