<commit_before><% content_for(:head) do %>
    <title>Lazy.js ES6 Generators Demo</title>
    <%= stylesheet_link_tag("lib/codemirror") %>
    <%= stylesheet_link_tag("demos/generators") %>
    <%= javascript_include_tag("lib/lazy") %>
    <%= javascript_include_tag("lib/lazy.es6") %>
    <%= javascript_include_tag("lib/codemirror") %>
    <%= javascript_include_tag("lib/codemirror/javascript") %>
    <%= javascript_include_tag("demos/generators") %>
<% end %>

<% content_for(:body) do %>
    <div id="input">
        <header>
            <h1>Lazy.js ES6 Generators Demo</h1>
        </header>

        <p>
            In the <code>&lt;textarea&gt;</code> on the left, define an ES6
            generator. In the middle, you can wrap this generator using
            <code>Lazy(generator)</code> and then <code>map</code>,
            <code>filter</code>, etc. to your heart's content. The resulting
            sequence will be evaluated and shown on the right.
        </p>

        <p>
            For more info on generators, see the
            <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generators.3A_a_better_way_to_build_Iterators">MDN article</a>.
        </p>

        <div id="workspace">
            <div id="generator-wrapper">
                <textarea id="generator">function *fibonacci() {
  var x = 1, y = 1, z;

  while (true) {
    yield x;
    z = x + y;
    x = y;
    y = z;
  };

}</textarea>
            </div>
<commit_msg>added warning to generator demo<commit_after><% content_for(:head) do %>
    <title>Lazy.js ES6 Generators Demo</title>
    <%= stylesheet_link_tag("lib/codemirror") %>
    <%= stylesheet_link_tag("demos/generators") %>
    <%= javascript_include_tag("lib/lazy") %>
    <%= javascript_include_tag("lib/lazy.es6") %>
    <%= javascript_include_tag("lib/codemirror") %>
    <%= javascript_include_tag("lib/codemirror/javascript") %>
    <%= javascript_include_tag("demos/generators") %>
<% end %>

<% content_for(:body) do %>
    <div id="input">
        <header>
            <h1>Lazy.js ES6 Generators Demo</h1>
        </header>

        <p>
            In the <code>&lt;textarea&gt;</code> on the left, define an ES6
            generator. In the middle, you can wrap this generator using
            <code>Lazy(generator)</code> and then <code>map</code>,
            <code>filter</code>, etc. to your heart's content. The resulting
            sequence will be evaluated and shown on the right.
        </p>

        <p>
            Don't do anything stupid, because I'm not doing a whole lot of
            validation here (so an ill-advised infinite loop may lock up your
            browser).
        </p>

        <p>
            For more info on generators, see the
            <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generators.3A_a_better_way_to_build_Iterators">MDN article</a>.
        </p>

        <div id="workspace">
            <div id="generator-wrapper">
                <textarea id="generator">function *fibonacci() {
  var x = 1, y = 1, z;

  while (true) {
    yield x;
    z = x + y;
    x = y;
    y = z;
  };

}</textarea>
            </div>

{'fraction_non_alphanumeric': 0.14555589965933727, 'fraction_numerical': 0.005574481263549086, 'mean_word_length': 2.4107708553326295, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 77, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3822334', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1024, 'n_words': 240}