Files
whetstone_DSL/docs/BuildCacheExample.md

16 lines
373 B
Markdown
Raw Normal View History

2026-02-06 19:31:38 -07:00
# Building a Cache - Whetstone AST (Canonical Form)
```
Function: getOrCreate
@deref(???)
Parameter: cache -> Map<string, Widget>
Parameter: key -> string
Body:
IfStatement:
condition: key in cache
then: Return cache[key]
else:
Assignment: widget = Widget.create(key)
Assignment: cache[key] = widget
Return: widget
```