# \#context

**URL:** https://racket.discourse.group/tag/context/62.md

[Latest](https://racket.discourse.group/latest.md) · [Categories](https://racket.discourse.group/categories.md) · [Tags](https://racket.discourse.group/tags.md)

---

## [Writing a macro that behaves differently depending on context](https://racket.discourse.group/t/writing-a-macro-that-behaves-differently-depending-on-context/536)

<div class="topic-metadata">

**Author:** [@dimaugh](https://racket.discourse.group/u/dimaugh)\
**Replies:** 2\
**Last updated:** [January 8, 2022, 10:51am UTC](https://racket.discourse.group/t/writing-a-macro-that-behaves-differently-depending-on-context/536 "2022-01-08T10:51:57Z")

</div>

I'm trying to define a macro 'def' which behaves differently depending on where it appears. If it appears in the top-level, it expands to a normal 'define' and adds the definition to a hash. If it appears in a local cont…
