Is there a ready or idiomatic way of declaring an entry point in a Julia program (i.e. the equivalent of main
in C or the if __name__ == "__main__"
construct in Python)?
This seems to be an important functionality in order to write larger pieces of structured code that won't be used in interactive mode but I couldn't find any hints as to how this is accomplished in Julia, if at all (a possible escape route could be writing an arbitrary function to serve as main
and then calling it once on the top level at the end of the main module but that's not elegant and maybe not even efficient). TIA.
@__FILE__()
? – Sitsang