# \#metaprogramming

**URL:** https://forum.snap.berkeley.edu/tag/metaprogramming/683.md

[Latest](https://forum.snap.berkeley.edu/latest.md) · [Categories](https://forum.snap.berkeley.edu/categories.md) · [Tags](https://forum.snap.berkeley.edu/tags.md)

---

## [Tie input names to rings](https://forum.snap.berkeley.edu/t/tie-input-names-to-rings/22852)

<div class="topic-metadata">

**Author:** [@gplb2718](https://forum.snap.berkeley.edu/u/gplb2718)\
**Replies:** 18\
**Last updated:** [November 28, 2026, 8:04pm UTC](https://forum.snap.berkeley.edu/t/tie-input-names-to-rings/22852 "2026-11-28T20:04:10Z")

</div>

a custom block i made: ties a list of variable names to a ring: Made so I could add input names to a c-input in a custom block if there are any weird issues, let me know edit: the context was messed up so heres a…

---

## [Metaprogramming stuff i made](https://forum.snap.berkeley.edu/t/metaprogramming-stuff-i-made/22837)

<div class="topic-metadata">

**Author:** [@cybercube](https://forum.snap.berkeley.edu/u/cybercube)\
**Replies:** 12\
**Last updated:** [November 26, 2026, 5:18am UTC](https://forum.snap.berkeley.edu/t/metaprogramming-stuff-i-made/22837 "2026-11-26T05:18:18Z")

</div>

So, I made some metaprogramming block cause metaprogramming is kind of cool. The “turn (( )\>) into \[command\]” is used for turning a block type into another type. the “mix (( )\>) category” mixes the block to a ra…

---

## [Blocks for programmatic script building](https://forum.snap.berkeley.edu/t/blocks-for-programmatic-script-building/21552)

<div class="topic-metadata">

**Author:** [@mctx\_studios](https://forum.snap.berkeley.edu/u/mctx_studios)\
**Replies:** 6\
**Last updated:** [May 12, 2026, 8:41pm UTC](https://forum.snap.berkeley.edu/t/blocks-for-programmatic-script-building/21552 "2026-05-12T20:41:24Z")

</div>

by request of @sathvikrias, here’s the full list of my blocks for building scripts. these are relatively old, so don’t expect them to work perfectly or be efficient in any way. as always, feedback is appreciated!

---

## [For loop ...with effort!](https://forum.snap.berkeley.edu/t/for-loop-with-effort/21804)

<div class="topic-metadata">

**Author:** [@onu032001](https://forum.snap.berkeley.edu/u/onu032001)\
**Replies:** 2\
**Last updated:** [May 6, 2026, 1:52am UTC](https://forum.snap.berkeley.edu/t/for-loop-with-effort/21804 "2026-05-06T01:52:05Z")

</div>

Project - For loop …with effort! This is the example for the block for tries and decimal tests. Instructions How to use the block You need to declare the variable to the object containing the following keys to set t…

---

## [Please add block variable metaprogramming to snap!](https://forum.snap.berkeley.edu/t/please-add-block-variable-metaprogramming-to-snap/19467)

<div class="topic-metadata">

**Author:** [@askofep1](https://forum.snap.berkeley.edu/u/askofep1)\
**Replies:** 2\
**Last updated:** [May 18, 2025, 6:36pm UTC](https://forum.snap.berkeley.edu/t/please-add-block-variable-metaprogramming-to-snap/19467 "2025-05-18T18:36:49Z")

</div>

set \[variables V\] of block ({...} @\>) to (list @\>

---

## [Metaprogramming library](https://forum.snap.berkeley.edu/t/metaprogramming-library/17927)

<div class="topic-metadata">

**Author:** [@qw23](https://forum.snap.berkeley.edu/u/qw23)\
**Replies:** 10\
**Last updated:** [September 18, 2024, 9:02am UTC](https://forum.snap.berkeley.edu/t/metaprogramming-library/17927 "2024-09-18T09:02:44Z")

</div>

The current Metaprogramming library (introduced in Snap! 10 IIRC) though useful is also kind of basic: … and (from a user POV) undocumented: for starters, none of these blocks have any help text. The same applies fo…

---

## [Reorder custom blocks within palette](https://forum.snap.berkeley.edu/t/reorder-custom-blocks-within-palette/16345)

<div class="topic-metadata">

**Author:** [@qw23](https://forum.snap.berkeley.edu/u/qw23)\
**Replies:** 4\
**Last updated:** [March 25, 2024, 9:15pm UTC](https://forum.snap.berkeley.edu/t/reorder-custom-blocks-within-palette/16345 "2024-03-25T21:15:30Z")

</div>

Though this subject was discussed before - a.o. in a long-standing feature request - I’m raising it again: not as a feature request but as a request to the community: can we write code, using current Snap! features, to h…

---

## [A converter-to-memoized for recursive functions (with any number of parameters)](https://forum.snap.berkeley.edu/t/a-converter-to-memoized-for-recursive-functions-with-any-number-of-parameters/14436)

<div class="topic-metadata">

**Author:** [@qw23](https://forum.snap.berkeley.edu/u/qw23)\
**Replies:** 0\
**Last updated:** [June 14, 2023, 12:47pm UTC](https://forum.snap.berkeley.edu/t/a-converter-to-memoized-for-recursive-functions-with-any-number-of-parameters/14436 "2023-06-14T12:47:15Z")

</div>

I created a function that will automatically memoize other (esp. recursive) functions. In other words: users don't need to modify any code by themselves. Even though it's working now, I consider it still under developme…

---

## [Some metaprogramming issues](https://forum.snap.berkeley.edu/t/some-metaprogramming-issues/14404)

<div class="topic-metadata">

**Author:** [@qw23](https://forum.snap.berkeley.edu/u/qw23)\
**Replies:** 14\
**Last updated:** [June 13, 2023, 9:58am UTC](https://forum.snap.berkeley.edu/t/some-metaprogramming-issues/14404 "2023-06-13T09:58:06Z")

</div>

I’ve been trying to implement memoizing existing recursive functions without the user needing to change the function’s definition. So for example: , with the original definition: . Some background on memoization Memo…

---

## [Some questions concerning DEFINE (block)](https://forum.snap.berkeley.edu/t/some-questions-concerning-define-block/14397)

<div class="topic-metadata">

**Author:** [@qw23](https://forum.snap.berkeley.edu/u/qw23)\
**Replies:** 6\
**Last updated:** [June 3, 2023, 9:59pm UTC](https://forum.snap.berkeley.edu/t/some-questions-concerning-define-block/14397 "2023-06-03T21:59:15Z")

</div>

What did I do wrong to obtain this result? DEFINE () () () won't let you specify block variables. Is there any way to do this using metaprogramming?
