Init.m considerations and good practices

前端 未结 3 1997
孤城傲影
孤城傲影 2021-02-02 03:08

As I never found (or perhaps I never search for it enough) a good article about how to manage the init.m files, I ended up developing my own \"standard\", but I wonder how bad I

3条回答
  •  情歌与酒
    2021-02-02 03:17

    My Kernel/init.m looks like this:

    AppendTo[$Path, Environment["MMA_LIB"]]
    Needs["WRUtil`"]
    

    WRUtil contains all of my little utilities and performs other initialization that takes into account the platform and Mathematica version. MMA_LIB is an environment variable that points to a directory full of Mathematica packages. That directory is kept under version control and can be shared by multiple Mathematica instances. I like to keep init.m short so that moving into a new Mathematica installation is as simple as typing two lines that I have committed to memory -- it is surprising how often I seem to have to do this.

提交回复
热议问题