Dan Sugalski wrote:
Or, rather, the const_string function.

Simple thing, looks like:

    STRING *foo = const_string(interpreter, c-style string constant);

Easy, right? Yeah. Easy.

Well, the real constant string is constructed like so:

  STRING *foo = CONST_STRING(interpreter, "cstring");

These strings get folded into a constant table (interpreter->const_cstring_table). The drawback is that it needs a bit of work per file (include the .str file, adapt Makefile build rules).

See e.g. src/objects.c for usage patterns.

leo



Reply via email to