How to use the do.while function in do

To help you get started, we’ve selected a few do examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thisandagain / logo / lib / language.js View on Github external
};

    function checkevalblock(block) {
        block = block();
        if (Type(block) === 'list') { return block; }
        throw new Error(__("Expected block"));
    }

    self.routines["do.while"] = function(block, tf) {
        block = checkevalblock(block);

        do {
          self.execute(block);
      } while (tf());
    };
    self.routines["do.while"].noeval = true;

    self.routines["while"] = function(tf, block) {
        block = checkevalblock(block);

        while (tf()) {
          self.execute(block);
      }
    };
    self.routines["while"].noeval = true;

    self.routines["do.until"] = function(block, tf) {
        block = checkevalblock(block);

        do {
          self.execute(block);
      } while (!tf());
github thisandagain / turtle / lib / language.js View on Github external
};

    function checkevalblock(block) {
        block = block();
        if (Type(block) === 'list') { return block; }
        throw new Error(__("Expected block"));
    }

    self.routines["do.while"] = function(block, tf) {
        block = checkevalblock(block);

        do {
          self.execute(block);
      } while (tf());
    };
    self.routines["do.while"].noeval = true;

    self.routines["while"] = function(tf, block) {
        block = checkevalblock(block);

        while (tf()) {
          self.execute(block);
      }
    };
    self.routines["while"].noeval = true;

    self.routines["do.until"] = function(block, tf) {
        block = checkevalblock(block);

        do {
          self.execute(block);
      } while (!tf());
github thisandagain / turtle / lib / language.js View on Github external
last = self.execute(statements);

          step = (control.length) ? aexpr(self.evaluateExpression(control.slice())) : sign(limit - start);
          current += step;
      }

      return last;
    };

    function checkevalblock(block) {
        block = block();
        if (Type(block) === 'list') { return block; }
        throw new Error(__("Expected block"));
    }

    self.routines["do.while"] = function(block, tf) {
        block = checkevalblock(block);

        do {
          self.execute(block);
      } while (tf());
    };
    self.routines["do.while"].noeval = true;

    self.routines["while"] = function(tf, block) {
        block = checkevalblock(block);

        while (tf()) {
          self.execute(block);
      }
    };
    self.routines["while"].noeval = true;
github thisandagain / logo / lib / language.js View on Github external
last = self.execute(statements);

          step = (control.length) ? aexpr(self.evaluateExpression(control.slice())) : sign(limit - start);
          current += step;
      }

      return last;
    };

    function checkevalblock(block) {
        block = block();
        if (Type(block) === 'list') { return block; }
        throw new Error(__("Expected block"));
    }

    self.routines["do.while"] = function(block, tf) {
        block = checkevalblock(block);

        do {
          self.execute(block);
      } while (tf());
    };
    self.routines["do.while"].noeval = true;

    self.routines["while"] = function(tf, block) {
        block = checkevalblock(block);

        while (tf()) {
          self.execute(block);
      }
    };
    self.routines["while"].noeval = true;

do

The simplest way to manage asynchronicity

MIT
Latest version published 12 months ago

Package Health Score

59 / 100
Full package analysis