We tried moving into and out of the Lambda Talk evaluator which worked ok but proved unnecessary.
Here we move the actual drawing code to a separate Code item making some room on our page for this explanation: the call tree of our and library code.
{def stroke {lambda {:w :c} fill="transparent" stroke=":c" stroke-width=":w"}} {svg {@ width="380px" height="380px" style="box-shadow:0 0 8px #888;"} {path {@ d="M {turtle 10 10 0 {left 11.5 5}}" {stroke 4 #0cc}}} }
digraph { rankdir=LR path turtle node [style=filled fillcolor=bisque] {rank=same left -> right -> left} svg -> path -> turtle -> left left -> stroke right -> stroke }
We can place the definitions after the call now because we concatenate all Code blocks before evaluating.
{def left {lambda {:d :n} {if {< :n 1} then else T90 {right :d {- :n 1}} M:d T-90 {left :d {- :n 1}} M:d {left :d {- :n 1}} T-90 M:d {right :d {- :n 1}} T90}}} {def right {lambda {:d :n} {if {< :n 1} then else T-90 {left :d {- :n 1}} M:d T90 {right :d {- :n 1}} M:d {right :d {- :n 1}} T90 M:d {left :d {- :n 1}} T-90}}}
A quirk of this rearrangement has the definition names echoed both before and after the Hilbert curve is drawn.
http://code.fed.wiki/assets/pages/lambda-talk-in-a-frame/repl.html HEIGHT 400