Julia Programming Language
Is there a way to determine whether code is toplevel?
General Usage
yuyichao
May 22, 2020, 3:25pm
2
Yes, you can set a
gensym
variable and test if it is indeed set on
__module__
.
Should macros get an `__istoplevel__` or `__scope__` argument?
show post in topic
Related topics
Topic
Replies
Views
Activity
How to tell if code is being run in global scope?
General Usage
macros
,
scope
1
420
January 15, 2023
Returning module from a macro: why do we need :toplevel?
General Usage
macros
,
metaprogramming
0
77
June 30, 2025
How to know if top-level
General Usage
3
490
April 8, 2022
Should macros get an `__istoplevel__` or `__scope__` argument?
Internals & Design
5
670
August 13, 2020
Check whether a variable is defined
New to Julia
7
14644
September 14, 2023