Updates to demos

This commit is contained in:
2025-04-16 14:23:53 -05:00
parent 25bfe139e8
commit b8e2743103
7 changed files with 61 additions and 39 deletions

View File

@ -18,22 +18,22 @@ main = toSource not?
sourceLeaf = t (head "t")
-- Stem case
sourceStem = (convert : (a rest :
sourceStem = convert : (a rest :
t (head "(") -- Start with a left parenthesis "(".
(t (head "t") -- Add a "t"
(t (head " ") -- Add a space.
(convert a -- Recursively convert the argument.
(t (head ")") rest)))))) -- Close with ")" and append the rest.
(t (head ")") rest))))) -- Close with ")" and append the rest.
-- Fork case
sourceFork = (convert : (a b rest :
sourceFork = convert : (a b rest :
t (head "(") -- Start with a left parenthesis "(".
(t (head "t") -- Add a "t"
(t (head " ") -- Add a space.
(convert a -- Recursively convert the first arg.
(t (head " ") -- Add another space.
(convert b -- Recursively convert the second arg.
(t (head ")") rest)))))))) -- Close with ")" and append the rest.
(t (head ")") rest))))))) -- Close with ")" and append the rest.
-- Wrapper around triage
toSource_ = y (self arg :