Put interpreter on pages.
This commit is contained in:
@@ -5,8 +5,10 @@
|
||||
<title>BigNums in Joy</title>
|
||||
<link rel="stylesheet" href="/css/fonts.css">
|
||||
<link rel="stylesheet" href="/css/site.css">
|
||||
<script src="/Joy.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="joy_interpreter"></div>
|
||||
<h1>BigNums in Joy</h1>
|
||||
<p>Most of the implementations of Thun support
|
||||
<a href="https://en.wikipedia.org/wiki/BigNum">BigNums</a>, either built-in or as
|
||||
@@ -887,6 +889,8 @@ sub-digits′ == [both-empty] [one-empty] [both-non-empty] list-combiner-genrec
|
||||
[both-non-empty]
|
||||
[i cons]
|
||||
genrec
|
||||
|
||||
sub-digits′ == [either-or-both-null] [[both-null] [both-empty] [ditch-empty-list sub-carry-from-digits] ifte] [uncons-two [sub-with-carry] dipd] [i cons] genrec
|
||||
</code></pre>
|
||||
<p>We just need to define the pieces.</p>
|
||||
<h3>≡ <code>sub-with-carry</code></h3>
|
||||
@@ -1140,5 +1144,6 @@ inscribe
|
||||
both? == boolii &
|
||||
one-of? == boolii |
|
||||
</code></pre>
|
||||
<script>var joy_interpreter = Elm.Main.init({node: document.getElementById('joy_interpreter')});</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
<title>Generator Programs</title>
|
||||
<link rel="stylesheet" href="/css/fonts.css">
|
||||
<link rel="stylesheet" href="/css/site.css">
|
||||
<script src="/Joy.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="joy_interpreter"></div>
|
||||
<h1>Generator Programs</h1>
|
||||
<h2>Using <code>x</code> to Generate Values</h2>
|
||||
<p>Cf. <a href="https://www.kevinalbrecht.com/code/joy-mirror/jp-reprod.html">Self-reproducing and reproducing programs</a> by Manfred von Thun</p>
|
||||
@@ -418,5 +420,6 @@ joy? x
|
||||
<p>And so it goes...</p>
|
||||
<h2>Conclusion</h2>
|
||||
<p>Generator programs like these are fun and interesting.</p>
|
||||
<script>var joy_interpreter = Elm.Main.init({node: document.getElementById('joy_interpreter')});</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -16,13 +16,14 @@ I'm in the process of rewriting them to use the Joy kernel.</p>
|
||||
<li><a href="/notebooks/1._Basic_Use_of_Joy_in_a_Notebook.html">1. Basic Use of Joy in a Notebook</a></li>
|
||||
<li><a href="/notebooks/2._Library_Examples.html">2. Library Examples</a></li>
|
||||
<li><a href="/notebooks/3._Developing_a_Program.html">3. Developing a Program</a></li>
|
||||
<li><a href="/notebooks/Developing_a_Program.html">Developing a Program</a></li>
|
||||
<li><a href="/notebooks/Advent_of_Code_2017_December_1st.html">Advent of Code 2017 December 1st</a></li>
|
||||
<li><a href="/notebooks/Advent_of_Code_2017_December_2nd.html">Advent of Code 2017 December 2nd</a></li>
|
||||
<li><a href="/notebooks/Advent_of_Code_2017_December_3rd.html">Advent of Code 2017 December 3rd</a></li>
|
||||
<li><a href="/notebooks/Advent_of_Code_2017_December_4th.html">Advent of Code 2017 December 4th</a></li>
|
||||
<li><a href="/notebooks/Advent_of_Code_2017_December_5th.html">Advent of Code 2017 December 5th</a></li>
|
||||
<li><a href="/notebooks/Advent_of_Code_2017_December_6th.html">Advent of Code 2017 December 6th</a></li>
|
||||
<li><a href="/notebooks/BigInts.html">BigInts</a></li>
|
||||
<li><a href="/notebooks/BigInts.html">BigNums</a></li>
|
||||
<li><a href="/notebooks/Compiling_Joy.html">Compiling Joy</a></li>
|
||||
<li><a href="/notebooks/Correcet_Programming.html">Correcet Programming</a></li>
|
||||
<li><a href="/notebooks/Derivatives_of_Regular_Expressions.html">Derivatives of Regular Expressions</a></li>
|
||||
|
||||
Reference in New Issue
Block a user