Missing Documentation : Scope Example


Wasn't sure how to make Fabric personnel aware of a problem with the docs, so I decided I'd post it to the section the documentation pertains to.


In this section, there's a mention of a scopes example, but the section is entirely blank. I don't know if it just didn't make it from the previous version or if it's in the low priority TODO list, but I figured I'd let folks know that it's missing.



  • pzionpzion Moderator, Fabric Employee Posts: 118 Fabric Employee

    Hi Benjamin,

    Thanks for the catch -- it's a formatting error in the documentation source. I'll push a fix and this will become part of the 2.6.1 build. For reference, here is the example (which you can just run through kl/kl.exe to see the output):

      struct T {
        String s;
      function T(String s) {
        this.s = s;
        report("created T; s = " + this.s);
      function ~T() {
        report("destroying T; s = " + this.s);
      function foo(T t) {
        report("start of foo; t is now " + t);
        T t("fooT");
        report("declared t in foo; t is now " + t);
        for (Index i=0; i<3; ++i) {
          report("top of loop body; t is now " + t);
          T t("loopT:" + i);
          report("declared t in loop; t is now " + t);
        report("after loop; t is now " + t);
      const Float32 t = 2.75;
      operator entry() {
        report("top of entry; t is now " + t);
        T t("entryT");
        report("declared t in entry; t is now " + t);
        report("came back from foo; t is now " + t);

    Peter Zion
    Fabric Engine

Sign In or Register to comment.