C# Interactive : applying #define'd symbols in following #load'ed files. #7630
Unanswered
JDiLenarda
asked this question in
Language Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What brings me to make this suggestion is the impossibility to declare a namespace in a c# script, which forbid to load a source code file having one (see dotnet/roslyn/#4478).
Whatever, I was hoping that using preprocessor directives could help :
Then execute this as a script or in the REPL :
Unfortunately, it results as
error CS7021: You cannot declare namespace in script code
.For contrast, F# doesn't have
#define
directive, but F# Interactive embeds anINTERACTIVE
symbol that can be use in compilable files through conditional precompiler directives.If there is way to work this, please consider this suggestion as a question.
Beta Was this translation helpful? Give feedback.
All reactions