diff options
author | Preston Pan <preston@nullring.xyz> | 2024-01-26 15:09:04 -0800 |
---|---|---|
committer | Preston Pan <preston@nullring.xyz> | 2024-01-26 15:09:04 -0800 |
commit | 183bfb0798623d6a196d59156b4e8978bab17564 (patch) | |
tree | c672dbca99fbba546ba7bc9313d286279ed83ccc /blog/stem.org | |
parent | ce62963379b700b2327cb7f1cde80e0423c8e713 (diff) |
exports both
Diffstat (limited to 'blog/stem.org')
-rw-r--r-- | blog/stem.org | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/blog/stem.org b/blog/stem.org index adec880..bd530cb 100644 --- a/blog/stem.org +++ b/blog/stem.org @@ -329,7 +329,7 @@ dupt [ [ [ dup ] dip ] dip ] def which duplicates the second and third value on the stack respectively. However, we might want to define ~dupn~ for any n, which takes in an integer and computes ~dup~ ~n~ values down. We can do that with metaprogramming, or less abstractly, we can do it by repeatedly putting quotes inside quotes, and then we can ~eval~ the resultant quote. Here is the code that programs ~dipn~ in its entirety, without any sugarcoating: -#+begin_src stem +#+begin_src stem :exports both # dsc simply discards the top object on the stack dsc2 [ dsc dsc ] def dupd [ [ dup ] dip ] def |