text:
static void Assert_Basics(void)
{
  #if !defined(NDEBUG) && defined(SHOW_SIZEOFS)
    //
    // For debugging ports to some systems
    //
  #if defined(__LP64__) || defined(__LLP64__)
    const char *fmt = "%lu %s\n";
  #else
    const char *fmt = "%u %s\n";
  #endif

    union Reb_Value_Payload *dummy_payload;

    printf(fmt, sizeof(dummy_payload->any_word), "any_word");
    printf(fmt, sizeof(dummy_payload->any_series), "any_series");
    printf(fmt, sizeof(dummy_payload->integer), "integer");
    printf(fmt, sizeof(dummy_payload->decimal), "decimal");
    printf(fmt, sizeof(dummy_payload->character), "char");
    printf(fmt, sizeof(dummy_payload->datatype), "datatype");
    printf(fmt, sizeof(dummy_payload->typeset), "typeset");
    printf(fmt, sizeof(dummy_payload->time), "time");
    printf(fmt, sizeof(dummy_payload->tuple), "tuple");
    printf(fmt, sizeof(dummy_payload->function), "function");
    printf(fmt, sizeof(dummy_payload->any_context), "any_context");
    printf(fmt, sizeof(dummy_payload->pair), "pair");
    printf(fmt, sizeof(dummy_payload->event), "event");
    printf(fmt, sizeof(dummy_payload->library), "library");
    printf(fmt, sizeof(dummy_payload->structure), "struct");
    printf(fmt, sizeof(dummy_payload->gob), "gob");
    printf(fmt, sizeof(dummy_payload->money), "money");
    printf(fmt, sizeof(dummy_payload->handle), "handle");
    printf(fmt, sizeof(dummy_payload->all), "all");
    fflush(stdout);
  #endif

  #if !defined(NDEBUG)
    //
    // Sanity check the platform byte-ordering sensitive flag macros
    //
    REBFLGS flags;

    flags = FLAGIT_LEFT(0);
    unsigned char *ch = (unsigned char*)&flags;
    if (*ch != 128) {
        printf("Expected 128, got %d\n", *ch);
        panic ("Bad leftmost bit setting of platform unsigned integer.");
    }

    flags = FLAGIT_LEFT(0) | FLAGIT_LEFT(1) | FLAGBYTE_RIGHT(13);

    unsigned int left = LEFT_N_BITS(flags, 3); // == 6 (binary `110`)
    unsigned int right = RIGHT_N_BITS(flags, 3); // == 5 (binary `101`)
    if (left != 6 or right != 5) {
        printf("Expected 6 and 5, got %u and %u\n", left, right);
        panic ("Bad composed integer assignment for byte-ordering macro.");
    }
  #endif

    // !!! Should runtime debug be double-checking all of <stdint.h>?
    //
    assert(sizeof(uint32_t) == 4);

    // Although the system is designed to be able to function with REBVAL at
    // any size, the optimization of it being 4x(32-bit) on 32-bit platforms
    // and 4x(64-bit) on 64-bit platforms is a rather important performance
    // point.  For the moment we consider it to be essential enough to the
    // intended function of the system that it refuses to run if not true.
    //
    // But if someone is in an odd situation and understands why the size did
    // not work out as designed, defining UNUSUAL_REBVAL_SIZE should still
    // work, so long as that size is an even multiple of ALIGN_SIZE.
    //
    size_t sizeof_REBVAL = sizeof(REBVAL);
  #if defined(UNUSUAL_REBVAL_SIZE)
    if (sizeof_REBVAL % ALIGN_SIZE != 0)
        panic ("size of REBVAL does not evenly divide by ALIGN_SIZE");
  #else
    if (sizeof_REBVAL != sizeof(void*) * 4)
        panic ("size of REBVAL is not sizeof(void*) * 4");

    #if defined(DEBUG_SERIES_ORIGINS) || defined(DEBUG_COUNT_TICKS)
        assert(sizeof(REBSER) == sizeof(REBVAL) * 2 + sizeof(void*) * 2);
    #else
        assert(sizeof(REBSER) == sizeof(REBVAL) * 2);
    #endif

    assert(sizeof(REBEVT) == sizeof(REBVAL));
  #endif

    // The REBSER is designed to place the `info` bits exactly after a REBVAL
    // so they can do double-duty as also a terminator for that REBVAL when
    // enumerated as an ARRAY.  Put the offest into a variable to avoid the
    // constant-conditional-expression warning.
    //
    size_t offsetof_REBSER_info = offsetof(REBSER, info);
    if (
        offsetof_REBSER_info - offsetof(REBSER, content) != sizeof(REBVAL)
    ){
        panic ("bad structure alignment for internal array termination");
    }

    // Void cells currently use REB_MAX for the type bits, and the debug
    // build uses REB_MAX + 1 for signaling "trash".  At most 64 "Reb_Kind"
    // types are used at the moment, yet the type is a byte for efficient
    // reading, so there's little danger of hitting this unless there's
    // a big change.
    //
    assert(REB_MAX_PLUS_ONE_TRASH < 256);

    // Make sure tricks for "internal END markers" are lined up as expected.
    //
    assert(SERIES_INFO_0_IS_TRUE == NODE_FLAG_NODE);
    assert(SERIES_INFO_1_IS_FALSE == NODE_FLAG_FREE);
    assert(SERIES_INFO_4_IS_TRUE == NODE_FLAG_END);
    assert(SERIES_INFO_7_IS_FALSE == NODE_FLAG_CELL);

    assert(DO_FLAG_0_IS_TRUE == NODE_FLAG_NODE);
    assert(DO_FLAG_1_IS_FALSE == NODE_FLAG_FREE);
    assert(DO_FLAG_4_IS_TRUE == NODE_FLAG_END);
    assert(DO_FLAG_7_IS_FALSE == NODE_FLAG_CELL);
}

//
//  Startup_Base: C
//
// The code in "base" is the lowest level of Rebol initialization written as
// Rebol code.  This is where things like `+` being an infix form of ADD is
// set up, or FIRST being a specialization of PICK.  It's also where the
// definition of the locals-gathering FUNCTION currently lives.
//
static void Startup_Base(REBARR *boot_base)
{
    RELVAL *head = ARR_HEAD(boot_base);

    // By this point, the Lib_Context contains basic definitions for things
    // like true, false, the natives, and the actions.  But before deeply
    // binding the code in the base block to those definitions, add all the
    // top-level SET-WORD! in the base block to Lib_Context as well.
    //
    // Without this shallow walk looking for set words, an assignment like
    // `foo: func [...] [...]` would not have a slot in the Lib_Context
    // for FOO to bind to.  So FOO: would be an unbound SET-WORD!,
    // and give an error on the assignment.
    //
    Bind_Values_Set_Midstream_Shallow(head, Lib_Context);

    // With the base block's definitions added to the mix, deep bind the code
    // and execute it.  As a sanity check, it's expected the base block will
    // return no value when executed...hence it should end in `()`.

    Bind_Values_Deep(head, Lib_Context);

    DECLARE_LOCAL (result);
    if (Do_At_Throws(result, boot_base, 0, SPECIFIED))
        panic (result);

    if (not IS_VOID(result))
        panic (result);
}

//
//  Startup_Sys: C
//
// The SYS context contains supporting Rebol code for implementing "system"
// features.  The code has natives, actions, and the definitions from
// Startup_Base() available for its implementation.
//
// (Note: The SYS context should not be confused with "the system object",
// which is a different thing.)
//
// The sys context has a #define constant for the index of every definition
// inside of it.  That means that you can access it from the C code for the
// core.  Any work the core C needs to have done that would be more easily
// done by delegating it to Rebol can use a function in sys as a service.
//
static void Startup_Sys(REBARR *boot_sys) {
    RELVAL *head = ARR_HEAD(boot_sys);

    // Add all new top-level SET-WORD! found in the sys boot-block to Lib,
    // and then bind deeply all words to Lib and Sys.  See Startup_Base() notes
    // for why the top-level walk is needed first.
    //
    Bind_Values_Set_Midstream_Shallow(head, Sys_Context);
    Bind_Values_Deep(head, Lib_Context);
    Bind_Values_Deep(head, Sys_Context);

    DECLARE_LOCAL (result);
    if (Do_At_Throws(result, boot_sys, 0, SPECIFIED))
        panic (result);

    if (not IS_VOID(result))
        panic (result);
}

//
//  Startup_Datatypes: C
//
// Create library words for each type, (e.g. make INTEGER! correspond to
// the integer datatype value).  Returns an array of words for the added
// datatypes to use in SYSTEM/CATALOG/DATATYPES
//
// Note the type enum starts at 1 (REB_ACTION), given that REB_0 is used
// for special purposes and not correspond to a user-visible type.  REB_MAX is
// used for void, and also not value type.  Hence the total number of types is
// REB_MAX - 1.
//
static REBARR *Startup_Datatypes(REBARR *boot_types, REBARR *boot_typespecs)
{
    if (ARR_LEN(boot_types) != REB_MAX - 1)
        panic (boot_types); // Every REB_XXX but REB_0 should have a WORD!

    RELVAL *word = ARR_HEAD(boot_types);

    if (VAL_WORD_SYM(word) != SYM_ACTION_X)
        panic (word); // First type should be ACTION!

    REBARR *catalog = Make_Array(REB_MAX - 1);

    REBINT n;
    for (n = 1; NOT_END(word); word++, n++) {
        assert(n < REB_MAX);

        REBVAL *value = Append_Context(Lib_Context, KNOWN(word), NULL);
        RESET_VAL_HEADER(value, REB_DATATYPE);
        VAL_TYPE_KIND(value) = cast(enum Reb_Kind, n);
        VAL_TYPE_SPEC(value) = VAL_ARRAY(ARR_AT(boot_typespecs, n - 1));

        // !!! The system depends on these definitions, as they are used by
        // Get_Type and Type_Of.  Lock it for safety...though consider an
        // alternative like using the returned types catalog and locking
        // that.  (It would be hard to rewrite lib to safely change a type
        // definition, given the code doing the rewriting would likely depend
        // on lib...but it could still be technically possible, even in
        // a limited sense.)
        //
        assert(value == Datatype_From_Kind(cast(enum Reb_Kind, n)));
        SET_VAL_FLAG(CTX_VAR(Lib_Context, n), CELL_FLAG_PROTECTED);

        Append_Value(catalog, KNOWN(word));
    }

    return catalog;
}

//
//  Startup_True_And_False: C
//
// !!! Rebol is firm on TRUE and FALSE being WORD!s, as opposed to the literal
// forms of logical true and false.  Not only does this frequently lead to
// confusion, but there's not consensus on what a good literal form would be.
// R3-Alpha used #[true] and #[false] (but often molded them as looking like
// the words true and false anyway).  $true and $false have been proposed,
// but would not be backward compatible in files read by bootstrap.
//
// Since no good literal form exists, the %sysobj.r file uses the words.  They
// have to be defined before the point that it runs (along with the natives).
//
static void Startup_True_And_False(void)
{
    REBVAL *true_value = Append_Context(Lib_Context, 0, Canon(SYM_TRUE));
    Init_Logic(true_value, true);
    assert(VAL_LOGIC(true_value) == true);
    assert(IS_TRUTHY(true_value));

    REBVAL *false_value = Append_Context(Lib_Context, 0, Canon(SYM_FALSE));
    Init_Logic(false_value, false);
    assert(VAL_LOGIC(false_value) == false);
    assert(IS_FALSEY(false_value));
}

//
//  action: enfix native [
//
//  {Creates datatype action (for internal usage only).}
//
//      return: [action!]
//      :verb [set-word! word!]
//      spec [block!]
//  ]
//
REBNATIVE(action)
//
// The `action` native is searched for explicitly by %make-natives.r and put
// in second place for initialization (after the `native` native).
//
// It is designed to be an enfix function that quotes its first argument,
// so when you write FOO: ACTION [...], the FOO: gets quoted to be the verb.
// The SET/ENFIX is done by the bootstrap, after the natives are loaded.
{
    INCLUDE_PARAMS_OF_ACTION;

    REBVAL *spec = ARG(spec);

    // We only want to check the return type in the debug build.  In the
    // release build, we want to have as few argument slots as possible...
    // especially to get the optimization for 1 argument to go in the cell
    // and not need to push arguments.
    //
    REBFLGS flags = MKF_KEYWORDS | MKF_FAKE_RETURN;

    REBACT *a = Make_Action(
        Make_Paramlist_Managed_May_Fail(spec, flags),
        &Type_Action_Dispatcher,
        NULL, // no facade (use paramlist)
        NULL // no specialization exemplar (or inherited exemplar)
    );

    Init_Word(ACT_BODY(a), VAL_WORD_CANON(ARG(verb)));

    // A lookback quoting function that quotes a SET-WORD! on its left is
    // responsible for setting the value if it wants it to change since the
    // SET-WORD! is not actually active.  But if something *looks* like an
    // assignment, it's good practice to evaluate the whole expression to
    // the result the SET-WORD! was set to, so `x: y: op z` makes `x = y`.
    //
    Move_Value(Sink_Var_May_Fail(ARG(verb), SPECIFIED), ACT_ARCHETYPE(a));
    Move_Value(D_OUT, ACT_ARCHETYPE(a));

    // !!! A very hacky (yet less hacky than R3-Alpha) re-dispatch of APPEND
    // as WRITE/APPEND on ports requires knowing what the WRITE action is.
    // Rather than track an entire table of all the actions in order to
    // support that and thus endorse this hack being used other places, just
    // save the write action into a global.
    //
    if (VAL_WORD_SYM(ARG(verb)) == SYM_WRITE) {
        Prep_Non_Stack_Cell(&PG_Write_Action);
        Move_Value(&PG_Write_Action, D_OUT);
    }

    return R_OUT;
}

//
//  Add_Lib_Keys_R3Alpha_Cant_Make: C
//
// In order for the bootstrap to assign values to library words, they have to
// exist in the bootstrap context.  The way they get into the context is by
// a scan for top-level SET-WORD!s in the %sys-xxx.r and %mezz-xxx.r files.
//
// However, R3-Alpha doesn't allow set-words like /: and <=:  The words can
// be gotten with `pick [/] 1` or similar, but they cannot be SET because
// there's nothing in the context to bind them to...since no SET-WORD! was
// picked up in the scan.
//
// As a workaround, this just adds the words to the context manually.  Then,
// however the words are created, it will be possible to bind them and set
// them to things.
//
// !!! Even as Ren-C becomes more permissive in letting SET-WORDs for these
// items be created, they should not be seen by %make-boot.r so long as the
// code expects to be bootstrapped with R3-Alpha.  This is because as part
// of the bootstrap, the code is loaded/processed and molded out as one
// giant file.  Ren-C being able to read `=>:` would not be able to help
// retroactively make old R3-Alphas read it too.
//
static void Add_Lib_Keys_R3Alpha_Cant_Make(void)
{
    const char *names[] = {
        "<",
        ">",

        "<=", // less than or equal !!! https://forum.rebol.info/t/349/11
        "=>", // Lambda function, quotes optional left argument

        ">=", // greater than or equal to
        "=<", // equal to or less than

        "<>", // not equal (the chosen meaning, as opposed to "empty tag")

        "->", // no current meaning
        "<-", // Non-null implicit GROUP! begin, e.g. `7 = 1 + <- 2 * 3`

        "|>", // Evaluate to next single expression, but do ones afterward
        "<|", // Evaluate to previous expression, but do rest (like ALSO)

        "/",

        NULL
    };

    REBCNT i;
    for (i = 0; names[i] != NULL; ++i) {
        REBSTR *str = Intern_UTF8_Managed(cb_cast(names[i]), strlen(names[i]));
        REBVAL *val = Append_Context(Lib_Context, NULL, str);
        Init_Void(val); // functions will fill in (no-op, since void already)
    }
}

//
//  Init_Action_Spec_Tags: C
//
// FUNC and PROC search for these tags, like <opt> and <local>.  They are
// natives and run during bootstrap, so these string comparisons are
// needed.
//
static void Init_Action_Spec_Tags(void)
{
    Root_With_Tag = rebLock(rebTag("with"), END);
    Root_Ellipsis_Tag = rebLock(rebTag("..."), END);
    Root_Opt_Tag = rebLock(rebTag("opt"), END);
    Root_End_Tag = rebLock(rebTag("end"), END);
    Root_Local_Tag = rebLock(rebTag("local"), END);
}

static void Shutdown_Action_Spec_Tags(void)
{
    rebRelease(Root_With_Tag);
    rebRelease(Root_Ellipsis_Tag);
    rebRelease(Root_Opt_Tag);
    rebRelease(Root_End_Tag);
    rebRelease(Root_Local_Tag);
}

//
//  Init_Action_Meta_Shim: C
//
// Make_Paramlist_Managed_May_Fail() needs the object archetype ACTION-META
// from %sysobj.r, to have the keylist to use in generating the info used
// by HELP for the natives.  However, natives themselves are used in order
// to run the object construction in %sysobj.r
//
// To break this Catch-22, this code builds a field-compatible version of
// ACTION-META.  After %sysobj.r is loaded, an assert checks to make sure
// that this manual construction actually matches the definition in the file.
//
static void Init_Action_Meta_Shim(void) {
    REBSYM field_syms[6] = {
        SYM_SELF, SYM_DESCRIPTION, SYM_RETURN_TYPE, SYM_RETURN_NOTE,
        SYM_PARAMETER_TYPES, SYM_PARAMETER_NOTES
    };
    REBCTX *meta = Alloc_Context(REB_OBJECT, 6);
    REBCNT i = 1;
    for (; i != 7; ++i) {
        //
        // void is used as the default for fields (R3-Alpha makes them as
        // BLANK! on initialization, e.g. `make object! [x: ()]` is illegal).
        //
        Init_Void(Append_Context(meta, NULL, Canon(field_syms[i - 1])));
    }

    Init_Object(CTX_VAR(meta, 1), meta); // it's "selfish"

    Root_Action_Meta = Init_Object(Alloc_Value(), meta);
    rebLock(Root_Action_Meta, END);
}

static void Shutdown_Action_Meta_Shim(void) {
    rebRelease(Root_Action_Meta);
}

//
//  Startup_Natives: C
//
// Create native functions.  In R3-Alpha this would go as far as actually
// creating a NATIVE native by hand, and then run code that would call that
// native for each function.  Ren-C depends on having the native table
// initialized to run the evaluator (for instance to test functions against
// the UNWIND native's FUNC signature in definitional returns).  So it
// "fakes it" just by calling a C function for each item...and there is no
// actual "native native".
//
// If there *were* a REBNATIVE(native) this would be its spec:
//
//  native: native [
//      spec [block!]
//      /body
//          {Body of user code matching native's behavior (for documentation)}
//      code [block!]
//  ]
//
// Returns an array of words bound to natives for SYSTEM/CATALOG/NATIVES
//
static REBARR *Startup_Natives(REBARR *boot_natives)
{
    // Must be called before first use of Make_Paramlist_Managed_May_Fail()
    //
    Init_Action_Meta_Shim();

    RELVAL *item = ARR_HEAD(boot_natives);

    // Although the natives are not being "executed", there are typesets
    // being built from the specs.  So to process `foo: native [x [integer!]]`
    // the INTEGER! word must be bound to its datatype.  Deep walk the
    // natives in order to bind these datatypes.
    //
    Bind_Values_Deep(item, Lib_Context);

    REBARR *catalog = Make_Array(Num_Natives);

    REBCNT n = 0;
    REBVAL *action_word = NULL; // for giving clear error if ACTION not found

    while (NOT_END(item)) {
        if (n >= Num_Natives)
            panic (item);

        // Each entry should be one of these forms:
        //
        //    some-name: native [spec content]
        //
        //    some-name: native/body [spec content] [equivalent user code]
        //
        // If more refinements are added, this code will have to be made
        // more sophisticated.
        //
        // Though the manual building of this table is not as nice as running
        // the evaluator, the evaluator makes comparisons against native
        // values.  Having all natives loaded fully before ever running
        // Do_Core() helps with stability and invariants.

        // Get the name the native will be started at with in Lib_Context
        //
        if (not IS_SET_WORD(item))
            panic (item);

        REBVAL *name = KNOWN(item);
        ++item;

        REBOOL enfix;
        if (IS_WORD(item) and VAL_WORD_SYM(item) == SYM_ENFIX) {
            enfix = true;
            ++item;
        }
        else
            enfix = false;

        // See if it's being invoked with NATIVE or NATIVE/BODY
        //
        REBOOL has_body;
        if (IS_WORD(item)) {
            if (VAL_WORD_SYM(item) != SYM_NATIVE)
                panic (item);
            has_body = false;
        }
        else {
            if (
                not IS_PATH(item)
                or VAL_LEN_HEAD(item) != 2
                or not IS_WORD(ARR_HEAD(VAL_ARRAY(item)))
                or VAL_WORD_SYM(ARR_HEAD(VAL_ARRAY(item))) != SYM_NATIVE
                or not IS_WORD(ARR_AT(VAL_ARRAY(item), 1))
                or VAL_WORD_SYM(ARR_AT(VAL_ARRAY(item), 1)) != SYM_BODY
            ){
                panic (item);
            }
            has_body = true;
        }
        ++item;

        REBVAL *spec = KNOWN(item);
        ++item;
        if (not IS_BLOCK(spec))
            panic (spec);

        // With the components extracted, generate the native and add it to
        // the Natives table.  The associated C function is provided by a
        // table built in the bootstrap scripts, `Native_C_Funcs`.

        // We only want to check the return type in the debug build.  In the
        // release build, we want to have as few argument slots as possible...
        // especially to get the optimization for 1 argument to go in the cell
        // and not need to push arguments.
        //
        REBFLGS flags = MKF_KEYWORDS | MKF_FAKE_RETURN;

        REBACT *act = Make_Action(
            Make_Paramlist_Managed_May_Fail(KNOWN(spec), flags),
            Native_C_Funcs[n], // "dispatcher" is unique to this "native"
            NULL, // no facade (use paramlist)
            NULL // no specialization exemplar (or inherited exemplar)
        );

        // If a user-equivalent body was provided, we save it in the native's
        // REBVAL for later lookup.
        //
        if (has_body) {
            REBVAL *body = KNOWN(item); // !!! handle relative?
            ++item;
            if (not IS_BLOCK(body))
                panic (body);
            Move_Value(ACT_BODY(act), body);
        }

        Prep_Non_Stack_Cell(&Natives[n]);
        Move_Value(&Natives[n], ACT_ARCHETYPE(act));

        // Append the native to the Lib_Context under the name given.
        //
        REBVAL *var = Append_Context(Lib_Context, name, 0);
        Move_Value(var, &Natives[n]);
        if (enfix)
            SET_VAL_FLAG(var, VALUE_FLAG_ENFIXED);

        REBVAL *catalog_item = Alloc_Tail_Array(catalog);
        Move_Value(catalog_item, name);
        VAL_SET_TYPE_BITS(catalog_item, REB_WORD);

        if (VAL_WORD_SYM(name) == SYM_ACTION)
            action_word = name;

        ++n;
    }

    if (n != Num_Natives)
        panic ("Incorrect number of natives found during processing");

    if (not action_word)
        panic ("ACTION native not found during boot block processing");

    return catalog;
}

//
//  Startup_Actions: C
//
// Returns an array of words bound to actions for SYSTEM/CATALOG/ACTIONS
//
static REBARR *Startup_Actions(REBARR *boot_actions)
{
    RELVAL *head = ARR_HEAD(boot_actions);

    // Add SET-WORD!s that are top-level in the actions block to the lib
    // context, so there is a variable for each action.  This means that the
    // assignments can execute.
    //
    Bind_Values_Set_Midstream_Shallow(head, Lib_Context);

    // The above code actually does bind the ACTION word to the ACTION native,
    // since the action word is found in the top-level of the block.  But as
    // with the natives, in order to process `foo: action [x [integer!]]` the
    // INTEGER! word must be bound to its datatype.  Deep bind the code in
    // order to bind the words for these datatypes.
    //
    Bind_Values_Deep(head, Lib_Context);

    DECLARE_LOCAL (result);
    if (Do_At_Throws(result, boot_actions, 0, SPECIFIED))
        panic (result);

    if (not IS_VOID(result))
        panic (result);

    // Sanity check the symbol transformation
    //
    if (0 != strcmp("open", STR_HEAD(Canon(SYM_OPEN))))
        panic (Canon(SYM_OPEN));

    REBDSP dsp_orig = DSP;

    RELVAL *item = head;
    for (; NOT_END(item); ++item)
        if (IS_SET_WORD(item)) {
            DS_PUSH_RELVAL(item, SPECIFIED);
            VAL_SET_TYPE_BITS(DS_TOP, REB_WORD); // change pushed to WORD!
        }

    return Pop_Stack_Values(dsp_orig); // catalog of actions
}

//
//  Init_Root_Vars: C
//
// Create some global variables that are useful, and need to be safe from
// garbage collection.  This relies on the mechanic from the API, where
// handles are kept around until they are rebRelease()'d.
//
// This is called early, so there are some special concerns to building the
// values that would not apply later in boot.
//
static void Init_Root_Vars(void)
{
    // These values are simple isolated VOID, NONE, TRUE, and FALSE values
    // that can be used in lieu of initializing them.  They are initialized
    // as two-element series in order to ensure that their address is not
    // treated as an array.
    //
    // They should only be accessed by macros which retrieve their values
    // as `const`, to avoid the risk of accidentally changing them.  (This
    // rule is broken by some special system code which `m_cast`s them for
    // the purpose of using them as directly recognizable pointers which
    // also look like values.)
    //
    // It is presumed that these types will never need to have GC behavior,
    // and thus can be stored safely in program globals without mention in
    // the root set.  Should that change, they could be explicitly added
    // to the GC's root set.

    Prep_Non_Stack_Cell(&PG_Void_Cell[0]);
    Prep_Non_Stack_Cell(&PG_Void_Cell[1]);
    Init_Void(&PG_Void_Cell[0]);
    TRASH_CELL_IF_DEBUG(&PG_Void_Cell[1]);

    Prep_Non_Stack_Cell(&PG_Blank_Value[0]);
    Prep_Non_Stack_Cell(&PG_Blank_Value[1]);
    Init_Blank(&PG_Blank_Value[0]);
    TRASH_CELL_IF_DEBUG(&PG_Blank_Value[1]);

    Prep_Non_Stack_Cell(&PG_Bar_Value[0]);
    Prep_Non_Stack_Cell(&PG_Bar_Value[1]);
    Init_Bar(&PG_Bar_Value[0]);
    TRASH_CELL_IF_DEBUG(&PG_Bar_Value[1]);

    Prep_Non_Stack_Cell(&PG_False_Value[0]);
    Prep_Non_Stack_Cell(&PG_False_Value[1]);
    Init_Logic(&PG_False_Value[0], false);
    TRASH_CELL_IF_DEBUG(&PG_False_Value[1]);

    Prep_Non_Stack_Cell(&PG_True_Value[0]);
    Prep_Non_Stack_Cell(&PG_True_Value[1]);
    Init_Logic(&PG_True_Value[0], true);
    TRASH_CELL_IF_DEBUG(&PG_True_Value[1]);

    // We can't actually put an end value in the middle of a block, so we poke
    // this one into a program global.  It is not legal to bit-copy an
    // END (you always use SET_END), so we can make it unwritable.
    //
    Init_Endlike_Header(&PG_End_Node.header, 0); // mutate to read-only end
  #if defined(DEBUG_TRACK_CELLS)
    Set_Track_Payload_Debug(&PG_End_Node, __FILE__, __LINE__);
  #endif
    assert(IS_END(END)); // sanity check that it took
    assert(VAL_TYPE_RAW(END) == REB_0); // this implicit END marker has this

    // Note: Not only can rebBlock() not be used yet (because there is no
    // data stack), PG_Unbound_Singular must exist before calling Init_Block()
    //
    // !!! Users should never see this, and if you panic() on this series it
    // will point to this line of code to identify it.  Still, review putting
    // something in the block to make it stand out in a debug dump, like a
    // `#PG_Unbound_Singular` ISSUE! (mold buffer not initialized yet)
    //
    PG_Unbound_Singular = Alloc_Singular_Array();
    SET_SER_INFO(PG_Unbound_Singular, SERIES_INFO_FROZEN);
    SET_END(ARR_SINGLE(PG_Unbound_Singular));
    Root_Unbound = Init_Block(Alloc_Value(), PG_Unbound_Singular);
    rebLock(Root_Unbound, END);

    // Generic read-only empty array, and locked block containing it.
    //
    PG_Empty_Array = Make_Array_Core(0, SERIES_FLAG_FIXED_SIZE);
    SET_SER_INFO(PG_Empty_Array, SERIES_INFO_FROZEN);
    Root_Empty_Block = Init_Block(Alloc_Value(), PG_Empty_Array);
    rebLock(Root_Empty_Block, END);

    // Note: rebText() can't run yet, review.
    //
    REBSER *nulled_uni = Make_Unicode(1);
    assert(CHR_CODE(UNI_AT(nulled_uni, 0)) == '\0');
    assert(UNI_LEN(nulled_uni) == 0);
    Root_Empty_String = Init_Text(Alloc_Value(), nulled_uni);
    rebLock(Root_Empty_String, END);

    Root_Space_Char = rebChar(' ');
    Root_Newline_Char = rebChar('\n');

    // !!! Putting the stats map in a root object is a temporary solution
    // to allowing a native coded routine to have a static which is guarded
    // by the GC.  While it might seem better to move the stats into a
    // mostly usermode implementation that hooks apply, this could preclude
    // doing performance analysis on boot--when it would be too early for
    // most user code to be running.  It may be that the debug build has
    // this form of mechanism that can diagnose boot, while release builds
    // rely on a usermode stats module.
    //
    Root_Stats_Map = Init_Map(Alloc_Value(), Make_Map(10));

}

static void Shutdown_Root_Vars(void)
{
    rebRelease(Root_Stats_Map);
    Root_Stats_Map = NULL;

    rebRelease(Root_Space_Char);
    Root_Space_Char = NULL;
    rebRelease(Root_Newline_Char);
    Root_Newline_Char = NULL;

    rebRelease(Root_Unbound);
    Root_Unbound = NULL;
    rebRelease(Root_Empty_String);
    Root_Empty_String = NULL;
    rebRelease(Root_Empty_Block);
    Root_Empty_Block = NULL;
}

//
//  Init_System_Object: C
//
// Evaluate the system object and create the global SYSTEM word.  We do not
// BIND_ALL here to keep the internal system words out of the global context.
// (See also N_context() which creates the subobjects of the system object.)
//
static void Init_System_Object(
    REBARR *boot_sysobj_spec,
    REBARR *datatypes_catalog,
    REBARR *natives_catalog,
    REBARR *actions_catalog,
    REBCTX *errors_catalog
) {
    RELVAL *spec_head = ARR_HEAD(boot_sysobj_spec);

    // Create the system object from the sysobj block (defined in %sysobj.r)
    //
    REBCTX *system = Make_Selfish_Context_Detect(
        REB_OBJECT, // type
        spec_head, // scan for toplevel set-words
        NULL // parent
    );

    Bind_Values_Deep(spec_head, Lib_Context);

    // Bind it so CONTEXT native will work (only used at topmost depth)
    //
    Bind_Values_Shallow(spec_head, system);

    // Evaluate the block (will eval CONTEXTs within).  Expects void result.
    //
    DECLARE_LOCAL (result);
    if (Do_At_Throws(result, boot_sysobj_spec, 0, SPECIFIED))
        panic (result);
    if (not IS_VOID(result))
        panic (result);

    // Create a global value for it.  (This is why we are able to say `system`
    // and have it bound in lines like `sys: system/contexts/sys`)
    //
    Init_Object(
        Append_Context(Lib_Context, NULL, Canon(SYM_SYSTEM)),
        system
    );

    // Make the system object a root value, to protect it from GC.  (Someone
    // could say `system: blank` in the Lib_Context, otherwise!)
    //
    Root_System = Init_Object(Alloc_Value(), system);

    // Init_Action_Meta_Shim() made Root_Action_Meta as a bootstrap hack
    // since it needed to make function meta information for natives before
    // %sysobj.r's code could run using those natives.  But make sure what it
    // made is actually identical to the definition in %sysobj.r.
    //
    assert(
        0 == CT_Context(
            Get_System(SYS_STANDARD, STD_ACTION_META),
            Root_Action_Meta,
            1 // "strict equality"
        )
    );

    // Create system/catalog/* for datatypes, natives, actions, errors
    //
    Init_Block(Get_System(SYS_CATALOG, CAT_DATATYPES), datatypes_catalog);
    Init_Block(Get_System(SYS_CATALOG, CAT_NATIVES), natives_catalog);
    Init_Block(Get_System(SYS_CATALOG, CAT_ACTIONS), actions_catalog);
    Init_Object(Get_System(SYS_CATALOG, CAT_ERRORS), errors_catalog);

    // Create system/codecs object
    //
    Init_Object(Get_System(SYS_CODECS, 0), Alloc_Context(REB_OBJECT, 10));

    // The "standard error" template was created as an OBJECT!, because the
    // `make error!` functionality is not ready when %sysobj.r runs.  Fix
    // up its archetype so that it is an actual ERROR!.
    //
    REBVAL *std_error = Get_System(SYS_STANDARD, STD_ERROR);
    assert(IS_OBJECT(std_error));
    VAL_SET_TYPE_BITS(std_error, REB_ERROR);
    VAL_SET_TYPE_BITS(CTX_ARCHETYPE(VAL_CONTEXT(std_error)), REB_ERROR);
    assert(CTX_KEY_SYM(VAL_CONTEXT(std_error), 1) == SYM_SELF);
    VAL_SET_TYPE_BITS(VAL_CONTEXT_VAR(std_error, 1), REB_ERROR);
}

void Shutdown_System_Object(void)
{
    rebRelease(Root_System);
    Root_System = NULL;
}

//
//  Init_Contexts_Object: C
//
// This sets up the system/contexts object.
//
// !!! One of the critical areas in R3-Alpha that was not hammered out
// completely was the question of how the binding process gets started, and
// how contexts might inherit or relate.
//
// However, the basic model for bootstrap is that the "user context" is the
// default area for new code evaluation.  It starts out as a copy of an
// initial state set up in the lib context.  When native routines or other
// content gets overwritten in the user context, it can be borrowed back
// from `system/contexts/lib` (typically aliased as "lib" in the user context).
//
static void Init_Contexts_Object(void)
{
    DROP_GUARD_CONTEXT(Sys_Context);
    Init_Object(Get_System(SYS_CONTEXTS, CTX_SYS), Sys_Context);

    DROP_GUARD_CONTEXT(Lib_Context);
    Init_Object(Get_System(SYS_CONTEXTS, CTX_LIB), Lib_Context);
    Init_Object(Get_System(SYS_CONTEXTS, CTX_USER), Lib_Context);
}

//
//  Startup_Task: C
//
// !!! Prior to the release of R3-Alpha, there had apparently been some amount
// of effort to take single-threaded assumptions and globals, and move to a
// concept where thread-local storage was used for some previously assumed
// globals.  This would be a prerequisite for concurrency but not enough: the
// memory pools would need protection from one thread to share any series with
// others, due to contention between reading and writing.
//
// Ren-C kept the separation, but if threading were to be a priority it would
// likely be approached a different way.  A nearer short-term feature would be
// "isolates", where independent interpreters can be loaded in the same
// process, just not sharing objects with each other.
//
void Startup_Task(void)
{
    Trace_Level = 0;
    Saved_State = 0;

    Eval_Cycles = 0;
    Eval_Dose = EVAL_DOSE;
    Eval_Count = Eval_Dose;
    Eval_Signals = 0;
    Eval_Sigmask = ALL_BITS;
    Eval_Limit = 0;

    Startup_Stacks(STACK_MIN / 4);

    TG_Ballast = MEM_BALLAST;
    TG_Max_Ballast = MEM_BALLAST;

    // The thrown arg is not intended to ever be around long enough to be
    // seen by the GC.
    //
    Prep_Non_Stack_Cell(&TG_Thrown_Arg);
    Init_Unreadable_Blank(&TG_Thrown_Arg);

    Startup_Raw_Print();
    Startup_Scanner();
    Startup_Mold(MIN_COMMON / 4);
    Startup_String();
    Startup_Collector();
}

#if !defined(OS_STACK_GROWS_UP) && !defined(OS_STACK_GROWS_DOWN)
    //
    // This is a naive guess with no guarantees.  If there *is* a "real"
    // answer, it would be fairly nuts:
    //
    // http://stackoverflow.com/a/33222085/211160
    //
    // Prefer using a build configuration #define, if possible (although
    // emscripten doesn't necessarily guarantee up or down):
    //
    // https://github.com/kripken/emscripten/issues/5410
    //
    REBOOL Guess_If_Stack_Grows_Up(int *p) {
        int i;
        if (not p)
            return Guess_If_Stack_Grows_Up(&i); // RECURSION: avoids inlining
        if (p < &i) // !!! this comparison is undefined behavior
            return true; // upward
        return false; // downward
    }
#endif

//
//  Set_Stack_Limit: C
//
// See C_STACK_OVERFLOWING for remarks on this **non-standard** technique of
// stack overflow detection.  Note that each thread would have its own stack
// address limits, so this has to be updated for threading.
//
// Currently, this is called every time PUSH_TRAP() is called when Saved_State
// is NULL, and hopefully only one instance of it per thread will be in effect
// (otherwise, the bounds would add and be useless).
//
void Set_Stack_Limit(void *base) {
    //
    // !!! This could be made configurable.  However, it needs to be
    // initialized early in the boot process.  It may be that some small limit
    // is used enough for boot, that can be expanded by native calls later.
    //
    uintptr_t bounds = cast(uintptr_t, STACK_BOUNDS);

  #if defined(OS_STACK_GROWS_UP)
    TG_Stack_Limit = cast(uintptr_t, base) + bounds;
  #elif defined(OS_STACK_GROWS_DOWN)
    TG_Stack_Limit = cast(uintptr_t, base) - bounds;
  #else
    TG_Stack_Grows_Up = Guess_If_Stack_Grows_Up(NULL);
    if (TG_Stack_Grows_Up)
        TG_Stack_Limit = cast(uintptr_t, base) + bounds;
    else
        TG_Stack_Limit = cast(uintptr_t, base) - bounds;
  #endif
}

static REBVAL *Startup_Mezzanine(BOOT_BLK *boot);

//
//  Startup_Core: C
//
// Initialize the interpreter core.
//
// !!! This will either succeed or "panic".  Panic currently triggers an exit
// to the OS.  The code is not currently written to be able to cleanly shut
// down from a partial initialization.  (It should be.)
//
// The phases of initialization are tracked by PG_Boot_Phase.  Some system
// functions are unavailable at certain phases.
//
// Though most of the initialization is run as C code, some portions are run
// in Rebol.  For instance, ACTION is a function registered very early on in
// the boot process, which is run from within a block to register more
// functions.
//
// At the tail of the initialization, `finish-init-core` is run.  This Rebol
// function lives in %sys-start.r.   It should be "host agnostic" and not
// assume things about command-line switches (or even that there is a command
// line!)  Converting the code that made such assumptions ongoing.
//
void Startup_Core(void)
{

//==//////////////////////////////////////////////////////////////////////==//
//
// INITIALIZE STACK MARKER METRICS
//
//==//////////////////////////////////////////////////////////////////////==//

    // !!! See notes on Set_Stack_Limit() about the dodginess of this
    // approach.  Note also that even with a single evaluator used on multiple
    // threads, you have to trap errors to make sure an attempt is not made
    // to longjmp the state to an address from another thread--hence every
    // thread switch must also be a site of trapping all errors.  (Or the
    // limit must be saved in thread local storage.)

    int dummy; // variable whose address acts as base of stack for below code
    Set_Stack_Limit(&dummy);

//==//////////////////////////////////////////////////////////////////////==//
//
// INITIALIZE BASIC DIAGNOSTICS
//
//==//////////////////////////////////////////////////////////////////////==//

  #if defined(TEST_EARLY_BOOT_PANIC)
    panic ("early panic test"); // should crash
  #elif defined(TEST_EARLY_BOOT_FAIL)
    fail (Error_No_Value_Raw(BLANK_VALUE)); // same as panic (crash)
  #endif

  #ifndef NDEBUG
    PG_Always_Malloc = false;
  #endif

  #ifdef DEBUG_HAS_PROBE
    PG_Probe_Failures = false;
  #endif

    // Globals
    PG_Boot_Phase = BOOT_START;
    PG_Boot_Level = BOOT_LEVEL_FULL;
    PG_Mem_Usage = 0;
    PG_Mem_Limit = 0;
    Reb_Opts = ALLOC(REB_OPTS);
    CLEAR(Reb_Opts, sizeof(REB_OPTS));
    Saved_State = NULL;

    Startup_StdIO();

    Assert_Basics();
    PG_Boot_Time = OS_DELTA_TIME(0);

//==//////////////////////////////////////////////////////////////////////==//
//
// INITIALIZE MEMORY AND ALLOCATORS
//
//==//////////////////////////////////////////////////////////////////////==//

    Startup_Pools(0);          // Memory allocator
    Startup_GC();

//==//////////////////////////////////////////////////////////////////////==//
//
// INITIALIZE API
//
//==//////////////////////////////////////////////////////////////////////==//

    // The API is one means by which variables can be made whose lifetime is
    // indefinite until program shutdown.  In R3-Alpha this was done with
    // boot code that laid out some fixed structure arrays, but it's more
    // general to do it this way.

    Init_Char_Cases();
    Startup_CRC();             // For word hashing
    Set_Random(0);
    Startup_Interning();

    Startup_Api();

//==//////////////////////////////////////////////////////////////////////==//
//
// CREATE GLOBAL OBJECTS
//
//==//////////////////////////////////////////////////////////////////////==//

    Init_Root_Vars();    // Special REBOL values per program

//==//////////////////////////////////////////////////////////////////////==//
//
// INITIALIZE (SINGULAR) TASK
//
//==//////////////////////////////////////////////////////////////////////==//

    Startup_Task();

    Init_Action_Spec_Tags(); // Note: uses BUF_UTF8, not available until here

//==//////////////////////////////////////////////////////////////////////==//
//
// LOAD BOOT BLOCK
//
//==//////////////////////////////////////////////////////////////////////==//

    // The %make-boot.r process takes all the various definitions and
    // mezzanine code and packs it into one compressed string in
    // %tmp-boot-block.c which gets embedded into the executable.  This
    // includes the type list, word list, error message templates, system
    // object, mezzanines, etc.

    REBCNT utf8_size;
    const REBINT max = -1; // trust size in gzip data
    REBYTE *utf8 = rebGunzipAlloc(
        &utf8_size,
        Native_Specs,
        Nat_Compressed_Size,
        max
    );

    REBARR *boot_array = Scan_UTF8_Managed(
        Intern("tmp-boot.r"),
        utf8,
        utf8_size
    );
    PUSH_GUARD_ARRAY(boot_array); // managed, so must be guarded

    rebFree(utf8); // don't need decompressed text after it's scanned

    BOOT_BLK *boot = cast(BOOT_BLK*, VAL_ARRAY_HEAD(ARR_HEAD(boot_array)));

    Startup_Symbols(VAL_ARRAY(&boot->words));

    // STR_SYMBOL(), VAL_WORD_SYM() and Canon(SYM_XXX) now available

    PG_Boot_Phase = BOOT_LOADED;

//==//////////////////////////////////////////////////////////////////////==//
//
// CREATE BASIC VALUES
//
//==//////////////////////////////////////////////////////////////////////==//

    // Before any code can start running (even simple bootstrap code), some
    // basic words need to be defined.  For instance: You can't run %sysobj.r
    // unless `true` and `false` have been added to the Lib_Context--they'd be
    // undefined.  And while analyzing the function specs during the
    // definition of natives, things like the <opt> tag are needed as a basis
    // for comparison to see if a usage matches that.

    // !!! Have MAKE-BOOT compute # of words
    //
    Lib_Context = Alloc_Context(REB_OBJECT, 600);
    MANAGE_ARRAY(CTX_VARLIST(Lib_Context));
    PUSH_GUARD_CONTEXT(Lib_Context);

    Sys_Context = Alloc_Context(REB_OBJECT, 50);
    MANAGE_ARRAY(CTX_VARLIST(Sys_Context));
    PUSH_GUARD_CONTEXT(Sys_Context);

    REBARR *datatypes_catalog = Startup_Datatypes(
        VAL_ARRAY(&boot->types), VAL_ARRAY(&boot->typespecs)
    );
    MANAGE_ARRAY(datatypes_catalog);
    PUSH_GUARD_ARRAY(datatypes_catalog);

    // !!! REVIEW: Startup_Typesets() uses symbols, data stack, and
    // adds words to lib--not available untilthis point in time.
    //
    Startup_Typesets();

    Startup_True_And_False();
    Add_Lib_Keys_R3Alpha_Cant_Make();

//==//////////////////////////////////////////////////////////////////////==//
//
// RUN CODE BEFORE ERROR HANDLING INITIALIZED
//
//==//////////////////////////////////////////////////////////////////////==//

    // Initialize the "Do" handler to the default, Do_Core(), and the "Apply"
    // of an ACTION! handler to Apply_Core().  These routines have no
    // tracing, no debug handling, etc.  If those features are needed, an
    // augmented function must be substituted.
    //
    PG_Do = &Do_Core;
    PG_Apply = &Apply_Core;

    // boot->natives is from the automatically gathered list of natives found
    // by scanning comments in the C sources for `native: ...` declarations.
    //
    REBARR *natives_catalog = Startup_Natives(VAL_ARRAY(&boot->natives));
    MANAGE_ARRAY(natives_catalog);
    PUSH_GUARD_ARRAY(natives_catalog);

    // boot->actions is the list in %actions.r
    //
    REBARR *actions_catalog = Startup_Actions(VAL_ARRAY(&boot->actions));
    MANAGE_ARRAY(actions_catalog);
    PUSH_GUARD_ARRAY(actions_catalog);

    // boot->errors is the error definition list from %errors.r
    //
    REBCTX *errors_catalog = Startup_Errors(VAL_ARRAY(&boot->errors));
    PUSH_GUARD_CONTEXT(errors_catalog);

    Init_System_Object(
        VAL_ARRAY(&boot->sysobj),
        datatypes_catalog,
        natives_catalog,
        actions_catalog,
        errors_catalog
    );

    DROP_GUARD_CONTEXT(errors_catalog);
    DROP_GUARD_ARRAY(actions_catalog);
    DROP_GUARD_ARRAY(natives_catalog);
    DROP_GUARD_ARRAY(datatypes_catalog);

    Init_Contexts_Object();

    PG_Boot_Phase = BOOT_ERRORS;

  #if defined(TEST_MID_BOOT_PANIC)
    panic (EMPTY_ARRAY); // panics should be able to give some details by now
  #elif defined(TEST_MID_BOOT_FAIL)
    fail (Error_No_Value_Raw(BLANK_VALUE)); // DEBUG->assert, RELEASE->panic
  #endif

    // Pre-make the stack overflow error (so it doesn't need to be made
    // during a stack overflow).  Error creation machinery depends heavily
    // on the system object being initialized, so this can't be done until
    // now.
    //
    Startup_Stackoverflow();

//==//////////////////////////////////////////////////////////////////////==//
//
// RUN MEZZANINE CODE NOW THAT ERROR HANDLING IS INITIALIZED
//
//==//////////////////////////////////////////////////////////////////////==//

    PG_Boot_Phase = BOOT_MEZZ;

    assert(DSP == 0 and FS_TOP == NULL);

    REBVAL *error = rebRescue(cast(REBDNG*, &Startup_Mezzanine), boot);
    if (error != NULL) {
        //
        // There is theoretically some level of error recovery that could
        // be done here.  e.g. the evaluator works, it just doesn't have
        // many functions you would expect.  How bad it is depends on
        // whether base and sys ran, so perhaps only errors running "mezz"
        // should be returned.
        //
        // For now, assume any failure to declare the functions in those
        // sections is a critical one.  It may be desirable to tell the
        // caller that the user halted (quitting may not be appropriate if
        // the app is more than just the interpreter)
        //
        // !!! If halt cannot be handled cleanly, it should be set up so
        // that the user isn't even *able* to request a halt at this boot
        // phase.

      #ifdef RETURN_ERRORS_FROM_INIT_CORE
        REBCNT err_num = VAL_ERR_NUM(error);
        Shutdown_Core(); // In good enough state to shutdown cleanly by now
        return err_num;
      #endif

        panic (error);
    }

    assert(DSP == 0 and FS_TOP == NULL);

    DROP_GUARD_ARRAY(boot_array);

    PG_Boot_Phase = BOOT_DONE;

  #if !defined(NDEBUG)
    Check_Memory_Debug(); // old R3-Alpha check, call here to keep it working
    Assert_Pointer_Detection_Working(); // can't be done too early in boot
  #endif

    Recycle(); // necessary?
}

// By this point in the boot, it's possible to trap failures and exit in
// a graceful fashion.  This is the routine protected by rebRescue() so that
// initialization can handle exceptions.
//
static REBVAL *Startup_Mezzanine(BOOT_BLK *boot)
{
    Startup_Base(VAL_ARRAY(&boot->base));

    Startup_Sys(VAL_ARRAY(&boot->sys));

    REBVAL *finish_init = CTX_VAR(Sys_Context, SYS_CTX_FINISH_INIT_CORE);
    assert(IS_ACTION(finish_init));

    // The FINISH-INIT-CORE function should likely do very little.  But right
    // now it is where the user context is created from the lib context (a
    // copy with some omissions), and where the mezzanine definitions are
    // bound to the lib context and DO'd.
    //
    DECLARE_LOCAL (result);
    if (Apply_Only_Throws(
        result,
        true, // fully = true (error if all arguments aren't consumed)
        finish_init, // %sys-start.r function to call
        KNOWN(&boot->mezz), // boot-mezz argument
        END
    )){
        fail (Error_No_Catch_For_Throw(result));
    }

    if (not IS_VOID(result))
        panic (result); // FINISH-INIT-CORE returns void by convention

    return NULL;
}

//
//  Shutdown_Core: C
//
// The goal of Shutdown_Core() is to release all memory and resources that the
// interpreter has accrued since Startup_Core().  This is a good "sanity check"
// that there aren't unaccounted-for leaks (or semantic errors which such
// leaks may indicate).
//
// Also, being able to clean up is important for a library...which might be
// initialized and shut down multiple times in the same program run.  But
// clients wishing a speedy exit may force an exit to the OS instead of doing
// a clean shut down.  (Note: There still might be some system resources
// that need to be waited on, such as asynchronous writes.)
//
// While some leaks are detected by the debug build during shutdown, even more
// can be found with a tool like Valgrind or Address Sanitizer.
//
void Shutdown_Core(void)
{
  #if !defined(NDEBUG)
    Check_Memory_Debug(); // old R3-Alpha check, call here to keep it working
  #endif

    assert(Saved_State == NULL);

    Shutdown_Stacks();

    Shutdown_Stackoverflow();
    Shutdown_System_Object();
    Shutdown_Typesets();

    Shutdown_Action_Meta_Shim();
    Shutdown_Action_Spec_Tags();
    Shutdown_Root_Vars();

    const REBOOL shutdown = true; // go ahead and free all managed series
    Recycle_Core(shutdown, NULL);

    Shutdown_Mold();
    Shutdown_Collector();
    Shutdown_Raw_Print();
    Shutdown_Event_Scheme();
    Shutdown_CRC();
    Shutdown_String();
    Shutdown_Scanner();
    Shutdown_Char_Cases();

    // This calls through the Host_Lib table, which Shutdown_Api() nulls out.
    //
    Shutdown_StdIO();

    Shutdown_Api();
    Shutdown_Symbols();
    Shutdown_Interning();

    Shutdown_GC();

    FREE(REB_OPTS, Reb_Opts);

    // Shutting down the memory manager must be done after all the Free_Mem
    // calls have been made to balance their Alloc_Mem calls.
    //
    Shutdown_Pools();
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<ldswebml type="image" uri="/media-library/images/welfare-humanitarian/general-welfare-and-humanitarian#lds-church-cannery-sorting-peaches-797484" xml:lang="eng" locale="eng" status="publish" xmlns:its="http://www.w3.org/2005/11/its">
  <search-meta>
      <uri-title its:translate="no">lds-church-cannery-sorting-peaches-797484</uri-title>
      <source>lds-church-cannery-sorting-peaches-797484</source>
      <publication-type its:translate="no">image</publication-type>
      <media-type its:translate="no">image</media-type>
      <publication value="ldsorg">LDS.org</publication>
      <publication-date value="2013-04-11">2013-04-11</publication-date>
      <title/>
      <description/>
      <collections>
          <collection its:translate="no">global-search</collection>
          <collection its:translate="no">media</collection>
          <collection its:translate="no">images</collection>
      </collections>
      <subjects>
          <subject>sorting</subject>
          <subject>helping</subject>
          <subject>service</subject>
          <subject>production line</subject>
      </subjects>
  </search-meta>
  <no-search>
      <path>http://media.ldscdn.org/images/media-library/welfare-humanitarian/general-welfare-and-humanitarian/lds-church-cannery-sorting-peaches-797484-gallery.jpg</path>
      <images>
          http://media.ldscdn.org/images/media-library/welfare-humanitarian/general-welfare-and-humanitarian/lds-church-cannery-sorting-peaches-797484-thumbnail.jpg
      </images>
          <download-urls>
              <download-url>
                  Mobile
                  <size>913 KB</size>
                  <path>http://media.ldscdn.org/images/media-library/welfare-humanitarian/general-welfare-and-humanitarian/lds-church-cannery-sorting-peaches-797484-mobile.jpg</path>
              </download-url>
              <download-url>
                  Tablet
                  <size>1.0 MB</size>
                  <path>http://media.ldscdn.org/images/media-library/welfare-humanitarian/general-welfare-and-humanitarian/lds-church-cannery-sorting-peaches-797484-tablet.jpg</path>
              </download-url>
              <download-url>
                  Print
                  <size>2.3 MB</size>
                  <path>http://media.ldscdn.org/images/media-library/welfare-humanitarian/general-welfare-and-humanitarian/lds-church-cannery-sorting-peaches-797484-print.jpg</path>
              </download-url>
              <download-url>
                  Wallpaper
                  <size>4.6 MB</size>
                  <path>http://media.ldscdn.org/images/media-library/welfare-humanitarian/general-welfare-and-humanitarian/lds-church-cannery-sorting-peaches-797484-wallpaper.jpg</path>
              </download-url>
          </download-urls>
  </no-search>
</ldswebml>

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MoonSharp.Interpreter.Interop
{
	/// <summary>
	/// Forces a class member visibility to scripts. Can be used to hide public members or to expose non-public ones.
	/// </summary>
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event, Inherited = false, AllowMultiple = false)]
	public sealed class MoonSharpVisibleAttribute : Attribute
	{
		/// <summary>
		/// Gets a value indicating whether this <see cref="MoonSharpVisibleAttribute"/> is set to "visible".
		/// </summary>
		public bool Visible { get; private set; }

		/// <summary>
		/// Initializes a new instance of the <see cref="MoonSharpVisibleAttribute"/> class.
		/// </summary>
		/// <param name="visible">if set to true the member will be exposed to scripts, if false the member will be hidden.</param>
		public MoonSharpVisibleAttribute(bool visible)
		{
			Visible = visible;
		}
	}
}


text:
import {Component} from '@angular/core';

@Component({
  selector: 'app-root',
  template: `

Library

<router-outlet></router-outlet>
`
})
export class AppComponent {}


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
Copyright 2008 Cyrus Najmabadi

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.-->
<resources>
  <string name="number_in_string">%s: %d </string>
  <string name="dollarstring_dot_string_string_discs_dot">$%s. %s - %s lemez.</string>
  <string name="dollarstring_dot_string_one_disc_dot">$%s. %s - 1 lemez.</string>
  <string name="string_string">%s %s</string>
  <string name="string_paren_string_paren">%s (%s)</string>
  <string name="string_paren_no_online_ticketing_paren">%s (nincs online jegy-eladás)</string>
  <string name="string_aggressively_caches_all_data_locally_on">%s minden adatot helyileg tárol, ezért internet nélkül is használható marad. Egyedül a filmelőzetesek nem töltődnek le előre.</string>
  <string name="string_cannot_open_the_page_because_it_is_not">%s nem tudja megnyitni az oldalt, mert nem kapcsolódik az internetre.</string>
  <string name="string_contains_missingincorrect_translations_dot">%s hibás fordítást tartalmaz. Kijavítanád?</string>
  <string name="string_does_not_store_your_netflix_username_and">%s nem tárolja a Netflix felhasználóneved és jelszavad.\n\nA Netflix honlapján kell bejelentkezned.\n\nWi-fi kapcsolat szükséges, hogy a Netflixet először használd a %s-gel.</string>
  <string name="string_doesnt_list_my_favorite_theater_dot_can_you">%s nem listázza a kedvenc mozijaimat. Hozzá tudnátok adni?</string>
  <string name="string_scores">%s pontok</string>
  <string name="string_dot_string">%s. %s</string>
  <string name="number_string">%d %s</string>
  <string name="number_questions_answers">%d Kérdés-felelet</string>
  <string name="number_hours">%d óra</string>
  <string name="number_minutes">%d perc</string>
  <string name="number_months_ago">%d hónapja</string>
  <string name="number_of_number">%d of %d</string>
  <string name="number_theaters_outside_search_area">%d mozi a keresett területen kívül</string>
  <string name="number_weeks_ago">%d hete</string>
  <string name="number_years_ago">%d évvel ezelött</string>
  <string name="one_hour">1 óra</string>
  <string name="one_kilometer">1 km</string>
  <string name="one_mile">1 mérföld</string>
  <string name="one_minute">1 perc</string>
  <string name="one_month_ago">1 hónapja</string>
  <string name="one_theater_outside_search_area">1 mozi a keresett területen kívül</string>
  <string name="one_week_ago">1 hete</string>
  <string name="one_year_ago">1 éve</string>
  <string name="about">Névjegy</string>
  <string name="account_number">Felhasználó: %d</string>
  <string name="account_colon_string_string">Felhasználó: %s %s</string>
  <string name="accounts">Felhasználók</string>
  <string name="action_adventure">Akció & kaland</string>
  <string name="add_new_account">Új felhasználó</string>
  <string name="add_theater">Új mozi</string>
  <string name="add_to_netflix">Netflixhez adás</string>
  <string name="adding_movie">Film Hozzáadása</string>
  <string name="all">Mind</string>
  <string name="all_paren_number_paren">Mind (%d)</string>
  <string name="an_unknown_error_occurred_dot">Ismeretlen hiba történt.</string>
  <string name="anime_animation">Anime & Animáció</string>
  <string name="apple_does_not_provide_a_mechanism_for_3rd_party">Apple nem engedi, hogy külső fejlesztők megváltoztassák az ikonukat. Amint engedi, lehetőséget adok erre.</string>
  <string name="at_home">Otthon</string>
  <string name="autoupdate_location">Auto-Helykeresés</string>
  <string name="available_now">Most elérhető</string>
  <string name="available_soon">Hamarosan elérhető</string>
  <string name="awaiting_release">Megjelenésre vár</string>
  <string name="bio_colon">Életrajz:</string>
  <string name="bluray">Blu-ray</string>
  <string name="bluray_only">Csak Blue-ray</string>
  <string name="bookmarks">Könyvjelzők</string>
  <string name="call">Tel.</string>
  <string name="can_you_increase_the_maximum_search_distance_for">Meg lehet növelni a maximális keresési távolságot a moziknál?</string>
  <string name="cancel">Mégsem</string>
  <string name="cannot_open_page">Nem megjeleníthető lap</string>
  <string name="cast_colon">Szereplők:</string>
  <string name="category_notifications">Kategória értesítők</string>
  <string name="change_date">Más időpont</string>
  <string name="children_family">Család & Gyerek</string>
  <string name="citystate_or_postal_code">Város/Megye vagy Irányítószám</string>
  <string name="classics">Klasszikus</string>
  <string name="comedy">Vígjáték</string>
  <string name="could_not_change_rating_colon_string">Sikerteln az értékelés módosítása:\n\n%s</string>
  <string name="could_not_connect_to_netflix_dot">Sikertelen kapcsolódás a Netflixhez</string>
  <string name="could_not_find_location_dot">Nem találta a helyet.</string>
  <string name="could_not_find_location_dot_user_denied_use_of_the">Nem sikerült a helymeghatározás.\nFelhasználói tiltás miatt.</string>
  <string name="could_you_add_support_for_blockbuster_movie">Van lehetőség arra, hogy hozzáadd a Blockbuster filmkölcsönzést a Netflix mellé?</string>
  <string name="could_you_provide_an_option_to_let_me_choose_the">Van arra lehetőség, hogy én választhassam meg a %s ikonját?</string>
  <string name="currently_blockbuster_does_not_provided_a">Pillanatnyilag a Blockbusternek nem létezik külső fejlesztők által használható API-ja. Amint lesz, Blockbuster filmkölcsönzés támogatás is lesz.</string>
  <string name="currently_no_dot_however_simply_mark_the_theater">Pillanatnyilag nem. Jelöld meg kedvencnek a mozit (a csillaggal a moziadatok fülnél), így akkor is meg fog jelenni, ha a keresési tartományon kívül van.</string>
  <string name="currently_settings_can_only_be_modified_from">Pillanatnyilag a beállítások csak a Netflix honlapján keresztül módosíthatóak.</string>
  <string name="dvd">DVD</string>
  <string name="dvd_only">Csak DVD</string>
  <string name="dvdbluray">DVD/Blu-ray</string>
  <string name="dvdbluray_details_colon">DVD/Blu-ray adatok</string>
  <string name="data_for_future_dates_may_be_incomplete_dot_reset">Az adatok a jövőbeni időpontokra hiányosak lehetnek. A teljes listához állítsd be a mai napot!</string>
  <string name="definitely_use_the_send_feedback_button_above_to">Természetesen! Használd a Visszajelzése küldése gombot az elérhetőségek felett. Írd meg, hogy mi a baj, és kijavítom a következő verzióig.</string>
  <string name="director_colon">Rendező:</string>
  <string name="directors_colon">Rendezők:</string>
  <string name="disc">lemez</string>
  <string name="disc_paren_number_paren">Lemez (%d)</string>
  <string name="disc_queue">Lemezeim</string>
  <string name="distance">Távolság</string>
  <string name="documentary">Dokumentumfilm</string>
  <string name="downloading_data">Adatok letöltése</string>
  <string name="downloading_image">Plakát letöltése</string>
  <string name="downloading_information_dot">Információk letöltése</string>
  <string name="drama">Dráma</string>
  <string name="due_to_licensing_restrictions_reviews_and_ratings">Licenc problémák miatt kritikák és értékelések nem biztos, hgoy minden filre elérhetőek.</string>
  <string name="email_listings">E-mail</string>
  <string name="enabled">Engedélyezett</string>
  <string name="entire_history">Minden előzmény</string>
  <string name="error_occurred">Hiba történt</string>
  <string name="error_occurred_talking_to_netflix_dot_please_try">Kommunikácóis hiba a Netflix-szel. Próbáld újra később.</string>
  <string name="faith_spirituality">Hit & Spirituális</string>
  <string name="favorites">Kedvencek</string>
  <string name="film_trailers_provided_by_colon">A filmelőzetesek szolgáltatója:</string>
  <string name="force_refresh">Frissítés</string>
  <string name="foreign">Külföldi</string>
  <string name="format_colon">Formátum:</string>
  <string name="gay_lesbian">Meleg & Leszbikus</string>
  <string name="genre_colon">Műfaj:</string>
  <string name="geolocation_services_provided_by_colon">Geolocation szolgáltató:</string>
  <string name="google_maps">Google Térképek</string>
  <string name="graphics_by_david_steinberger">Grafika: David Steinberger</string>
  <string name="graphics_by_jeffrey_nee">Grafikus: Jeffrey Nee</string>
  <string name="help">Súgó</string>
  <string name="horror">Horror</string>
  <string name="i_will_absolutely_try_dot_please_tap_the_add">Teljes mértékben megpróbálom. Kérlek használd az Új mozi funkciót az elérhetőségeimnél. A mozi címére és telefonszámára lesz szükségem. Köszönöm!</string>
  <string name="imdbs_licensing_fees_are_unfortunately_too_high">Az IMDb licencdíjai túl magasak, hogy megengedhessem magamnak. Elnézést.</string>
  <string name="if_string_caches_data_why_do_i_always_see_the">Ha a %s előre letölti az adatokat, akkor miért látom mindig a töltés jelet a plakátokon, amiket már egyszer betöltött?</string>
  <string name="if_you_like_string_please_consider_writing_a_small">Ha tetszik a %s, akkor írj az iTunes store-ban értékelést. Így új felhasználók fedezhetik fel a programot, új funkciókkal bővülhet és reklámmentes maradhat. Köszönöm!</string>
  <string name="independent">Független</string>
  <string name="instant">Azonnali</string>
  <string name="instant_paren_number_paren">Azonnali (%d)</string>
  <string name="instant_queue">Azonnal nézhető filmek</string>
  <string name="instant_watch">Azonnali kezdés</string>
  <string name="international_data">Nemzetközi adatok</string>
  <string name="last_friday">Múlt péntek</string>
  <string name="last_monday">Múlt hétfő</string>
  <string name="last_saturday">Múlt szombat</string>
  <string name="last_sunday">Múlt vasárnap</string>
  <string name="last_thursday">Múlt csütörtök</string>
  <string name="last_tuesday">Múlt kedd</string>
  <string name="last_wednesday">Múlt szerda</string>
  <string name="less_than_number_string_away">Közelebb, mint %d %s</string>
  <string name="less_than_one_string_away">Közelebb, mint 1 %s</string>
  <string name="license">Licenc</string>
  <string name="licensing_restrictions_with_certain_data_providers">Licencmegszoítások miatt négány adatszolgáltató csak részleges adatokat nyújt, így nem minden értékelés és kritika érhető el.</string>
  <string name="like_this_app">Tetszik a program?</string>
  <string name="loading">Töltés</string>
  <string name="loading_indicators">Töltés jelzők</string>
  <string name="loading_image">Plakát betöltése</string>
  <string name="local_results_unavailable">Helyi adatok elérhetetlenek.</string>
  <string name="localized_by_colon">Fordították:</string>
  <string name="location">Hely</string>
  <string name="log_in_to_existing_account">Bejelentkezés meglevő felhasználóként</string>
  <string name="long_wait">Hosszú várakozási idő</string>
  <string name="map">Cím</string>
  <string name="map_theaters">Mozik a térképre</string>
  <string name="most_popular">Legnépszerűbbek</string>
  <string name="movie_rating">film értékelés</string>
  <string name="movie_details_provided_by_colon">Film adatokat szolgáltatja:</string>
  <string name="movie_reviews_provided_by_colon">Filmkritikák szolgáltatója:</string>
  <string name="movies">Filmek</string>
  <string name="movies_paren_number_paren">Filmek (%d)</string>
  <string name="moving_movie">Film Mozgatása</string>
  <string name="music_musicals">Zene & Musical</string>
  <string name="my_other_applications">Egyéb alkalmazásaim</string>
  <string name="name">Név</string>
  <string name="netflix">Netflix</string>
  <string name="network_unavailable">Hálózat elérhetetlen</string>
  <string name="new_instant_watch">Új azonnal nézhető</string>
  <string name="new_dvds">Új DVD-k</string>
  <string name="no_thanks">Nem, kösz.</string>
  <string name="no_biography_available_dot">Nincs elérhető életrajz.</string>
  <string name="no_information_found">Nincs informácio</string>
  <string name="no_listings_found_at_string_on_string">Nincs vetítés itt: %s és ekkor: %s</string>
  <string name="no_listings_found_for_string_at_string_on_string">Nem vetítik a %s-t a %s-ban %s-kor</string>
  <string name="no_listings_found_for_string_on_string">Nem vetítik a %s-t %s napon</string>
  <string name="no_results_found_for_string">Nincs találat: '%s'</string>
  <string name="no_synopsis_available_dot">Nincs elérhető összefoglaló.</string>
  <string name="none">Semmi</string>
  <string name="not_rentable">Nem kölcsönözhető</string>
  <string name="not_yet_rated">Korhatár besorolás alatt.</string>
  <string name="now_playing_feedback">Now Playing visszajelzés</string>
  <string name="ok">OK</string>
  <string name="open_and_authorize">Megnyit és belép</string>
  <string name="options">Beállítások</string>
  <string name="order_tickets_for_string">Jegyrendelés: %s</string>
  <string name="over_quota_try_again_later">Kvóta túllépés - Próbáld máskor</string>
  <string name="play_trailer">Előzetes</string>
  <string name="please_wait">Kérlek várj</string>
  <string name="please_enter_your_location">Adja meg a tartózkodási helyét!</string>
  <string name="please_rate_it_in_the_app_store">Kérlek értékeld a programot az App Store-ban!</string>
  <string name="please_wait_dot_dot_dot">Kérlek várj...</string>
  <string name="preferred_formats">Elsődleges formátum</string>
  <string name="prioritize_bookmarks">Könyvjelzők elöl</string>
  <string name="project_website">Project honlapja</string>
  <string name="rate_it">Értékeld!</string>
  <string name="rated_string">Korhatár: %s</string>
  <string name="rated_colon">Korhatár:</string>
  <string name="read_reviews">Filmkritikák</string>
  <string name="really_close_by">Nagyon közeli</string>
  <string name="really_far_away">Nagyon messze</string>
  <string name="recently_returned">mostanában visszahozott</string>
  <string name="recently_watched">Mostanában megnézett</string>
  <string name="recommendations">Ajánlások</string>
  <string name="release">Megjelenés</string>
  <string name="release_date_colon">Megjelenés időpontja:</string>
  <string name="release_colon_string">Megjelenés: %s</string>
  <string name="remove_account">Felhasználó törlése</string>
  <string name="rental_history">Kölcsönzési előzmények</string>
  <string name="reordering_queue_failed_colon_string">Sikertelen rendelés:\n\n%s</string>
  <string name="requesting_access">Hozzáférés kérés</string>
  <string name="requesting_authorization">Hitelesítés kérés</string>
  <string name="reviews">Kritikák</string>
  <string name="romance">Romantikus</string>
  <string name="running_time_colon">Hossz:</string>
  <string name="safari">Safari</string>
  <string name="save_all_to_photo_library">Mind mentése a Photo Library-ba</string>
  <string name="save_to_photo_library">Mentés a Photo Library-ba</string>
  <string name="saved">Mentve</string>
  <string name="saved_in_string">Elmentve az %s-be</string>
  <string name="saving">Mentés</string>
  <string name="saving_number_of_number">Mentés (%d/%d)</string>
  <string name="scifi_fantasy">Sci-Fi & Fantasy</string>
  <string name="score">Pont</string>
  <string name="screen_rotation">Auto forgatás</string>
  <string name="search_date">Keresett időpont</string>
  <string name="search_distance">Keresési távolság</string>
  <string name="search_netflix">Netflix keresés</string>
  <string name="searching">Keresés...</string>
  <string name="see_the_section_on_imdb_dot">Lásd az IMDb résznél</string>
  <string name="send_feedback">Visszajelzés küldése</string>
  <string name="settings">Beállítások</string>
  <string name="short_wait">Rövid várkazozási idő</string>
  <string name="show_number_hidden_theaters">%d rejtett mozi megjelenítése</string>
  <string name="show_one_hidden_theater">1 rejtett mozi megjelenítése</string>
  <string name="show_both">Mindkettő</string>
  <string name="show_neither">Egyiket sem</string>
  <string name="show_notifications">Figyelmeztetések</string>
  <string name="show_times_retrieved_on_string_dot">Lekérdezés időpontja: %s</string>
  <string name="sign_up_for_new_account">Új felhasználó készítése</string>
  <string name="special_interest">Különleges érdeklődés</string>
  <string name="sports_fitness">Sport & Fitness</string>
  <string name="studio_colon">Stúdió:</string>
  <string name="success_string_was_granted_access_to_your_netflix">Siker! %s hozzáfér a Netflix felhasználódhoz. Most már hozzáadhatsz filmeket, megnézheted, hogy miket ajánlanak neked és még megannyi más!</string>
  <string name="tap_the_send_feedback_button_above_to_contact_me">Válaszd a visszajelzés küldését és lépj velem kapcsolatba bármi miatt, amire szükséged van!</string>
  <string name="tap_to_enter_location">Katt és írd be a helyzeted.</string>
  <string name="television">TV</string>
  <string name="theater_last_reported_show_times_on_string_dot">Moziműsor utoljára frissítve\n%s.</string>
  <string name="theater_providers_often_limit_the_maximum_search">A moziműsor szolgáltatók gyakran maximálják a keresési távolságot. Ilyenkor hiába van nagy távolság beállítva, néhány mozi nem fog megjelenni.</string>
  <string name="theaters">Mozik</string>
  <string name="theaters_paren_number_paren">Mozik (%d)</string>
  <string name="theaters_are_removed_when_they_do_not_provide">A mozik eltűnnek, ha nem adnak friss információkat a műsoruktól. Amint új adat jön, újra megjelennek a %s-ben.</string>
  <string name="this_theater_has_not_yet_reported_its_show_times">Nem elérhető a mozi műsora, amint lehet, a %s automatikusan letölti azokat.</string>
  <string name="thrillers">Thriller</string>
  <string name="ticket_sales_provided_by_colon">Jegyeladó:</string>
  <string name="title">Cím</string>
  <string name="to_make_scrolling_as_fast_and_as_smooth_as">Ahhoz hogy a scrollozás gyors és finom legyen a képek csak akkor jelennek meg, ha már nem scrollozol.</string>
  <string name="today">Ma</string>
  <string name="top_dvds">Legjobb DVD-k</string>
  <string name="top_of_disc_queue">Lemez sor</string>
  <string name="top_of_instant_queue">Azonnali filmek</string>
  <string name="translations">Fordítások</string>
  <string name="unfortunately_movietickets_dot_com_will_not">Sajnos a Movietickets.com nem ad el jegyeket, ha a Fandango.com is elérhető. Én a Fandango.com-os mozikba járok, így ehhez ragaszkodom.</string>
  <string name="unknown_distance">Ismeretlen távolság</string>
  <string name="unknown_release_date">Ismeretlen megjelenési időpont</string>
  <string name="unrated">Korhatár nélküli</string>
  <string name="upcoming">Megjelenések</string>
  <string name="updating">Frissítés</string>
  <string name="updating_listings">Moziműsorok frissítése</string>
  <string name="updating_queue">sor frissítése</string>
  <string name="updating_colon_string">Frissítés: %s</string>
  <string name="use_small_fonts">Kisbetűk használata</string>
  <string name="very_long_wait">Nagyon hossz várakozási idő</string>
  <string name="website">Honlap</string>
  <string name="websites">Honlapok</string>
  <string name="what_can_i_do_if_i_have_a_question_that_hasnt_been">mit tehetek ha van egy megválaszolatlan kérdésem?</string>
  <string name="why_did_my_theater_disappear">M iért tűnt el a mozim?</string>
  <string name="why_doesnt_string_offer_ticketing_through">Miért nem vehetünk jegyet a %s-ben a Movietickets.com-ról úgy, mint a Fandango.com-ról?</string>
  <string name="why_doesnt_string_provide_imdb_user_ratings_and">Miért nem láthatom az IMDb értékeléseket és kritikákat a %s-ben?</string>
  <string name="why_doesnt_string_provide_yahoo_ratings_and">Miért nem láthatom a Yahoo értékeléseket és kritikákat a %s-ben</string>
  <string name="why_dont_i_see_ratings_and_reviews_for_all_movies">Miért nincs minden filmről kritika és értékelés a %s-ben?</string>
  <string name="why_is_string_always_downloading_data_why_doesnt">Miért tölt le mindig a %s? Miért nem tárol minden adatot letölve?</string>
  <string name="write_review">Kritika írása</string>
  <string name="written_by_cyrus_najmabadi">Írta: Cyrus Najmabadi</string>
  <string name="yesterday">Tegnap</string>
  <string name="you_must_first_set_up_an_email_account_on_your">Először állíts be egy email fiókot, hogy visszajelzést küldhess a programról!</string>
  <string name="your_strings_country_is_set_to_colon_string_full">Az %s-od beállított országa: %s\n\nTeljes %s támogatás nemsokára a Te országod is eléri, de néhány funkció már ma is használható! Ha újabb lehetőségek elérhetőek, automatikusan jelezni fogjuk.</string>
  <string name="kilometer">km</string>
  <string name="kilometers">km</string>
  <string name="mile">mérföld</string>
  <string name="miles">mérföld</string>
</resources>


text:
title: codecademy lesson 6
layout: post
author: aidan.meazzo
permalink: /codecademy-lesson-6/
source-id: 1PI-lutUJxQpG_IUaQ3kp1JkwFWrsxzdmkUjnR2Rb2Cc
published: true
---

    Title
    Codecademy lesson 6
    Date
    03/06/17

    Starting point:
    52%, lists and functions

    Target for this lesson?
    To get to 57%

    Did I reach my target?
(add details to "Lesson Review")
    Yes and i did two sections in the battleships

    Lesson Review

    How did I learn? What strategies were effective?

    This lesson I was mainly focused on not missing punctuation which I succeeded in doing. This meant that I worked quicker and achieved my target for the lesson. Also i paid attention to detail so i didn't make as many mistakes

    What limited my learning? Which habits do I need to work on?

    I still need to remember not to be sloppy with my typing especially looking out for typing errors and missing capital letters. This can lead to less work being completed. Also I cannot get distracted by others members of the class messing around because that will lead to me completing less work in the lesson. This means that I will fall behind in the homework leaving me with more to do next lesson.

    What will I change for next time? How will I improve my learning?

    I will improve my typing so that I work quicker and I will also not get distracted by my peers which will lead to me learning more.


text:
<!doctype html>

  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Moshi</title>
  <link rel="stylesheet" href="stylesheets/app.css" />

Welcome to Moshi

This is H2

This is H3

This is H4

This is H5

This is H6

    This is a nice panel
    let's try to add stuff to this nice panel:

How About some forms and usefull stuff:

    <form>

      Input Label
      <input type="text" placeholder="placeholding stuff" />

      Select Box
      <select>
        <option value="husker">Huskar</option>
        <option value="starbuck">Pudge</option>
        <option value="hotdog">Phantom Cancer</option>
        <option value="apollo">Drow Cancer</option>
      </select>

      Radio Buttons
      <input type="radio" name="radio" id="checked" checked>Checked
      <input type="radio" name="radio" id="default">Default
      <input type="radio" name="radio" id="disabled" disabled>Disabled

      Check these out
      <input id="C_checked" type="checkbox" checked>Checked
      <input id="C_default" type="checkbox">Default
      <input id="C_disabled" type="checkbox" disabled>Disabled

      Textarea Label
      <textarea placeholder="placeholder" style="width: 500px;"></textarea>
      <button class="button-base">Submit!</button>
    </form>

      Time for some Badges !

      Regular : 99
                75
                69
                50
                25

      Oval : 99
                75
                69
                50
                25

    This is a paragraph!
    This page is shamelessly "inspired" by Zurb's Foundation kitchen sink

  more to come [soon(tm)] here is a spinner for you:


text:
/*
 * Start/Restart/Stop mongodb service (daemon)
 * Setup robust MongoDB connection using native driver
 * NOTE default port = 27727 (option in `config.modules.supromongod.port`)
 */
(function MongoDB(require, module){

/* ,-< Stop mongod Processes >-
 * |
 * |In a clean shutdown a mongod completes all pending operations,
 * |flushes all data to data files, and closes all data files.
 * |Other shutdowns are unclean and can compromise the validity the data files.
 * |
 * `-<http://docs.mongodb.org/manual/tutorial/manage-mongodb-processes/>
 *
 * Our Clean shutdown stratery is to run
 * > db.admin.command({ shutdown: 1 })
 *
 * on shutdown event `mongod` will finish all pending requests (as per docs)
 * and then close event of `db` will free everything in the driver
 * no need of internal accounting and/or checking of
 * `serverStatus.metrics.cursor.open.total` on db.close()
 */

var mongodb = require('mongodb')
// module data
var mongod// spawned daemon
var db, api, cfg
var colls_cache = { }// collections which may have additional dynamic fields

/* == API for Mongodb access ==
 *
 * launch/connect MongoDB binary with provided config then try to connect to it
 * @param {hash} app_api glue hash connecting all used internal parts
 * @param {hash} config db setup and connection settings
 * Example:
  require('./mongodb').launch/connect(api,{
    //TODO (see db_admin()): callback: runSocketIO,

    dbpath: [__dirname + /]'.data/',
    bin: '/usr/local/bin/mongod'
  });
  // finally
  api.db -- is MongoClient connected to specified database
 */
var mongodbAPI = {
        client: null,// TODO?: setter, getter
        // methods
        launch: launch_daemon,
        connect: mongodb_connect
    }
    log('^ Mongodb driver version:', mongodb.version)

    return module.exports = mongodbAPI

function launch_daemon(app_api, config){
var cwd, d

    if(!config || !app_api) throw new Error('!Undefined arguments')

    cfg = config
    api = app_api

    if(cfg.stop_on_restart) throw new Error('!Not implementd: "config.stop_on_restart"')

    cwd = cfg.dbpath = __dirname + '/../../../' + cfg.dbpath
    try {
        d = require('fs').statSync(cwd)
    } catch(ex){
        return require('mkdirp').mkdirp(cwd,
        function mkdirp_data_dir(err){
            if(err) throw err

            return spawn_mongod()
        })
    }
    if(!d.isDirectory()){
        throw new Error('Is not a directory: ' + cwd)
    }
    return spawn_mongod()
}

function pad(n){
    return n < 10 ? '0' + n : n
}

function spawn_mongod(){
var cmd, cp, fs

    fs = require('fs')
    cp = require('child_process')

    cmd = new Date
    cfg.log_filename = cfg.dbpath + cmd.getUTCFullYear()
                                   + '-' + pad(cmd.getUTCMonth() + 1) + '.txt'

    cmd = {// check and apply defaults
        bin: cfg.bin,
        // needed options go first, then optional `cfg.cmd_launch` or default
        arg:('--dbpath .' + ' --port ' + (cfg.port || '27727') +
            (cfg.cmd_launch ||
            // optimizations (optional)
            ' --noprealloc --smallfiles ' +
            // basic
            '--journal --directoryperdb --rest --httpinterface --quiet ' +
            // localhost only connection
            '--bind_ip 127.0.0.1')
        ).split(' '),
        opt:{
            cwd: cfg.dbpath,
            detached: true,
            stdio:[
                'ignore'
                ,fs.openSync(cfg.log_filename,'a+')
                ,fs.openSync(cfg.log_filename,'a+')
            ]
        }
    }
    mongod = cp.spawn(cmd.bin, cmd.arg, cmd.opt)
    if(!mongod.pid || mongod.exitCode){
        throw new Error('!FATAL spawn `mongod` exit code: ' + mongod.exitCode)
    }
    mongod.on('close',
    function on_mongod_close(code){
        if(100 == code){// maybe `mongod` is running(lock), or try to restart
            //!!!dev return respawn_mongod_main(cwd)
        } else if(0 != code){// unhandled
            throw new Error('!FATAL close `mongod` exit code: ' + code)
        }
        mongod = void 0// release and flag daemon shutdown
        log('$ `mongod` stop, code: ' + code)
        // `api.db` must receive 'close' event and clean up stuff
        return code
    })
    log('^ `mongod` start pid:', mongod.pid)
    // connect `app` with `db`
    return mongodb_connect()
}

function respawn_mongod_main(){
    throw new Error(
        '!Restart is not impemented. Stop `mongod` manually. Then restart Application.'
    )
}

function mongodb_connect(app_api, config){
   /* Any data in SUPRO transport is being copied globally on every object
    * (or node) of the system, thus `_id`s on every side may collide with
    * locally generated data.
    *
    * So _id's are generated on Mongod's server side and play role only inside
    * local MongoDB.
    *
    * * NOTE: fatal errors and/or crashes inside DB callbacks can not use
    * *       `res.json()` to report UI and that. Timeout will fire in UI
    * *        and `bufferMaxEntries: 0` here
    * */

    if(db){
        return log('Already connected')// permanent `db` setup for app
    }

    if(config && app_api){
        cfg = config
        api = app_api
    }
    // set defaults if needed
    if(!cfg.options) cfg.options = {
        db:{
            forceServerObjectId: true
           ,bufferMaxEntries: 0
           ,journal: true
        }
       ,server:{
            auto_reconnect: true
           /*,socketOptions:{ connectTimeoutMS: 512, socketTimeoutMS: 512 }???*/
        }
    }
    if(!cfg.url) cfg.url = 'mongodb://'+ (cfg.host ||'127.0.0.1') +':'+ (cfg.port ||'27727') +'/'
    if(!cfg.db) cfg.db = 'supro_GLOB'

    if(!cfg.extjs) cfg.extjs = { mongodb_port: 0 }
    if(!cfg.extjs.mongodb_port) cfg.extjs.mongodb_port = cfg.port || 27727// for link
    config = cfg.url + cfg.db
    log('^ db connect:', config)

    return mongodb.MongoClient.connect(
        config, cfg.options, on_connect_app
    )
}//mongodb_connect

function on_connect_app(err ,newdb){
    if(err || !newdb){
        log('!db error MongoClient.connect:', err || '!`newdb`')
        if(!mongod){
            log(
'!db MongoDB damon is not running, it may be db lock, or no free space, etc.\n'+
'see log file: ' + cfg.log_filename
            )
        }
        return setTimeout(mongodb_connect, 4096)
    }

    db = mongodbAPI.client = newdb
    db.on('error', function on_db_err(err){// see NOTE in mongodb_connect()
        db.status = ''
        err && log('!db error: ', err.stack || err)
    })
    db.on('timeout', function on_db_timeout(conn){
        db.status = ''
        conn && log('$ db timeout: ' + conn.host + ':' + conn.port)
    })
    db.on('close', function on_db_close(conn){
        db.status = ''
        conn && log('$ db close: ' + conn.host + ':' + conn.port)
    })

    db.on('reconnect', function on_db_close(conn){
        db_admin()
    })

    // `collection` from the driver is not the only thing we need here
    // there can be other info stored inside this objects e.g. `meta`
    db.getCollection = function getCollection(name){// using cache
        if(!colls_cache[name]){// name is `collectionName`
            colls_cache[name] = db.collection(name)
        }
        return colls_cache[name]
    }
    db.ObjectId = mongodb.ObjectID

    return db_admin()

    function db_admin(){
        return db.admin(function on_admin(aerr ,a){
            if(aerr){
                log('db.admin():', aerr)
                return on_connect_app()// reconnect
            }
            return a.command({ buildInfo: 1 } ,function(e ,d){
                if(e){
                    log('db.admin.command():', e)
                    return on_connect_app()// reconnect
                }
                db.status = "MongoDB v" + d.documents[0]['version']
                log('Connected to ' + db.status)

                api.ctl_on_done && api.ctl_on_done(end_with_mongodb)

                return api.db = db// finally provide `db`
                // TODO: maybe add `callback` for chained setups
                //       now if there is no db due to reconnection or other things
                //       `api.db` checks in API calls/urls just fail
            })
        })//cb admin
    }
}

function end_with_mongodb(next){
    // clean database shutdown and thus app db connection
    if(!api.db){
        log('$ end_with_mongodb(): no `api.db`')
        return next()
    }

    return api.db.admin(
    function get_admin(aerr, a){
        if(aerr){
            log(a = '!mongo db.admin(): ' + aerr)

            return next(aerr)
        }
        return a.command({ shutdown: 1 },
        function on_mongod_shutdown(err, data){
            log('$ MongoDB shutdown data:', data ? data : err ? err : 'nothing')
            // `mongod` shuts down, thus it is not an error:
            //"! MongoDB shutdown command error: [Error: connection closed]"
            return next(err && err.message != 'connection closed' ? err : void 0);
        })
    })
}

})(require, module)


text:
html,
body {
    height: 100%;
}

.wrapper .container {
    background: #ffedcd url(../img/bg.png) 0 0 no-repeat;
    width: 31.25rem;
    background-size: 31.25rem 42.25rem;
}

.wrapper .container .top-filter {
    background-color: #EC5455;
    text-align: center;
    padding: 0.625rem 0 0 2.5rem;
}

.wrapper .container .top-filter li {
    float: left;
    font-size: 1.5rem;
    color: #606060;
    margin-right: 1.25rem;
}

.wrapper .container .top-filter li.active {
    color: #fafafa;
    border-bottom: 0.20833333rem solid #fafafa;
}

.wrapper .container .introduce {
    font-size: 1.25rem;
    padding-bottom: 4.16666667rem;
}

.wrapper .container .introduce dl {
    padding: 2.70833333rem 0 0 2.08333333rem;
}

.wrapper .container .introduce dl dt {
    color: #323232;
    margin: 0 0 2.08333333rem 0;
}

.wrapper .container .introduce dl dt label {
    color: #eb8f1f;
    display: inline-block;
    margin-right: 0.625rem;
}

.wrapper .container .introduce dl dt:last-child {
    width: 26.25rem;
    margin-left: 0;
    line-height: 2.5;
    margin-top: -1.04166667rem;
}

.wrapper .container .award {
    color: #fafafa;
    font-size: 1.5rem;
    position: relative;
    height: 59rem;
}

.wrapper .container .award .top-info {
    position: absolute;
    top: 17rem;
    left: 1.875rem;
}

.wrapper .container .award .top-info:before,
.wrapper .container .award .top-info:after {
    content: " ";
    display: table;
}

.wrapper .container .award .top-info:after {
    clear: both;
}

.wrapper .container .award .top-info label {
    font-size: 1.25rem;
    color: #e73119;
    display: inline-block;
    float: right;
    margin-right: 0.625rem;
}

.wrapper .container .award .top-info span {
    display: inline-block;
    line-height: 1.5;
}

.wrapper .container .award .award-detail {
    position: absolute;
    line-height: 1.5;
    top: 24.58333333rem;
    left: 1.66666667rem;
}

.wrapper .container .award .award-detail table {
    margin-left: 0.83333333rem;
    width: 100%;
}

.wrapper .container .award .award-detail table tr td:first-child {
    text-align: right;
}

.wrapper .container .award .award-detail table tr td {
    text-align: left;
}

.wrapper .container .rule {
    line-height: 1.3;
    font-size: 1.25rem;
    color: #343434;
    padding: 1.91666667rem 0 0 2.25rem;
}

.wrapper .container .rule .sign-up {
    margin-top: 1.04166667rem;
    font-size: 1.25rem;
}

.wrapper .container .rule .sign-up .sign-detail {
    margin: 0.83333333rem 0 0 0.83333333rem;
    padding-bottom: 0.41666667rem;
    width: 27.08333333rem;
}

.wrapper .container .rule .sign-up .sign-detail .star {
    font-style: normal;
    display: inline-block;
    margin-left: 0.20833333rem;
    display: inline-block;
    float: left;
}

.wrapper .container .rule .sign-up .sign-detail .num {
    color: #343434;
    font-style: normal;
    display: inline-block;
    float: left;
    margin-right: 0.41666667rem;
}

.wrapper .container .rule .sign-up .sign-detail span {
    display: inline-block;
    margin: 0.41666667rem 0 0.41666667rem 0;
}

.wrapper .container .rule .sign-up .sign-detail span:before,
.wrapper .container .rule .sign-up .sign-detail span:after {
    content: " ";
    display: table;
}

.wrapper .container .rule .sign-up .sign-detail span:after {
    clear: both;
}

.wrapper .container .rule .sign-up .sign-detail span.tip {
    margin-left: 0;
}

.wrapper .container .rule .sign-up .sign-detail span.tip label {
    width: 26.25rem;
}

.wrapper .container .rule .sign-up .sign-detail span label {
    color: #343434;
    display: inline-block;
    width: 24.125rem;
}

.wrapper .container .rule .prides {
    margin-top: 1.04166667rem;
    font-size: 1.25rem;
    padding-bottom: 4.16666667rem;
}

.wrapper .container .rule .prides .prides-result {
    padding: 1.08333333rem 0.83333333rem 0 0.83333333rem;
}

.wrapper .container .rule .vote {
    font-size: 1.25rem;
    margin-bottom: 0.58333333rem;
}

.wrapper .container .rule .vote .vote-rule {
    padding: 1.08333333rem 0.83333333rem 0 0.83333333rem;
}

.wrapper .container .rule .withdraw {
    font-size: 1.25rem;
    line-height: 1.3;
}

.wrapper .container .rule .withdraw .withdraw-detail {
    padding: 1.08333333rem 0.83333333rem 0 0.83333333rem;
}

.wrapper .container .rule .withdraw .withdraw-detail .star {
    margin-right: 0.25rem;
    font-style: normal;
}

.wrapper .container .pride-introduce {
    color: #fafafa;
    padding: 2.91666667rem 3.125rem 5rem;
}

.wrapper .container .pride-introduce .pride-all {
    text-align: left;
}

.wrapper .container .pride-introduce .pride-all .titles {
    text-align: center;
}

.wrapper .container .pride-introduce .pride-all .title-big {
    font-size: 1.5rem;
}

.wrapper .container .pride-introduce .pride-all .cont-small {
    font-size: 1.25rem;
    margin-top: 1.25rem;
    line-height: 1.24;
}

.wrapper .container .pride-introduce .rank-pride {
    font-size: 1.25rem;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

.wrapper .container .pride-introduce .rank-pride table:last-child {
    margin-top: 1.25rem;
}

.wrapper .container .pride-introduce .rank-pride table {
    width: 100%;
}

.wrapper .container .pride-introduce .rank-pride table tr:first-child td {
    text-align: center;
    width: 100%;
}

.wrapper .container .pride-introduce .rank-pride tr td:first-child {
    text-align: right;
    width: 40%;
}

.wrapper .container .pride-introduce .rank-pride tr td:last-child {
    text-align: left;
}

.wrapper .container .pride-introduce .rank-pride td {
    line-height: 1.12;
}

.wrapper .container .pride-introduce .title-normal {
    font-size: 1.5rem;
    line-height: 1;
}

.wrapper .container .pride-introduce .attend-pride {
    margin-top: 6.25rem;
}

.wrapper .container .pride-introduce .attend-pride .title-normal {
    font-size: 2rem;
}

.wrapper .container .pride-introduce .attend-pride p {
    font-size: 1.5rem;
    margin-top: 1.25rem;
    line-height: 2rem;
    margin-bottom: 0.41666667rem;
}

.wrapper .container .pride-introduce .attend-pride .countdown {
    color: #333;
    margin-top: 2.16666667rem;
}

.wrapper .container .pride-introduce .attend-pride .green-btn {
    display: inline-block;
    background-color: #77B652;
    font-size: 1.5rem;
    line-height: 2.5rem;
    color: #fafafa;
    border: none;
    border-radius: 0.41666667rem;
    -webkit-appearance: none;
    width: 8.29166667rem;
    height: 2.5rem;
}

.wrapper .container .pride-introduce .tip {
    margin-top: 0.625rem;
    text-align: center;
}

.wrapper .container .pride-introduce .tip .notice {
    color: #fee49a;
    font-size: 1.25rem;
    text-decoration: underline;
}

.wrapper .container .title {
    background: url(../img/title.png) 0 0 no-repeat;
    width: 8.75rem;
    height: 2.33333333rem;
    background-size: cover;
    font-size: 1.25rem;
    line-height: 1.25rem;
    color: #fff;
    text-align: center;
}

.wrapper .container .title span {
    display: inline-block;
    margin-top: 0.58333333rem;
    margin-left: 0;
}

.wrapper .rule-container {
    background: #FFEDCD url(../img/bg.png) 0 4.58333333rem no-repeat;
    width: 31.25rem;
    background-size: 31.25rem 42.25rem;
}

.wrapper .pride-container {
    background: #FFEDCD url(../img/activity-pride.jpg) 0 2.75rem no-repeat;
    width: 31.25rem;
    background-size: 31.25rem 72.16666667rem;
}

.wrapper .award-container {
    background: #FBC40F url(../img/award-bg.jpg) 0 2.33333333rem no-repeat;
    width: 31.25rem;
    background-size: 31.25rem 50.66666667rem;
}