Educoder SML compiler environment set up under the title line of programming

background

Recent "serial and parallel data structure and algorithm design," the teacher arranged on educoder some SML programming problem, although there are online compilation feature on the site, but still online compiler debugging convenient, special record build environment as follows (I use GVIM but Notepad ++, Visual Studio Code editor, etc. and so on)

Step 1: Install the compiler

Download ML of New Standard (Jersey https://www.smlnj.org/ ), downloaded directly installed on the line all the way, the environment variable has been automatically a good job.

Step Two: Configure GVIM

Open the configuration file _vimrc under GVIM directory, add

func Run()
    exec 'w'
    if &filetype == 'sml'
        exec '!sml < %'
    endif
endfunc
map <C-F5> :call Run() <CR>

Meaning of this passage is to press Ctrl + GVIM save the current file after F5, then if the current file type is SML then execute the command "sml <sml current file", the current contents of the file redirect to sml sml interactive command line program carried out.

Operation before the writing process: Step

First copy the website title editor to input and output template to GVIM, because the standard input sml interactive command-line program has been accounted for our sml file, so the standard read function can not be used, so we need to add in the first line of the program

val input = TextIO.openIn("input.txt");

Then replace all TextIO.stdIn program to input, store after the establishment of a input.txt sample input in the same directory as the program, then you can write your own content in the template begin and end there. When post the code as long as the program begin and end in which you write the content posted to the site between the title editor inside begin and end on the line.

Guess you like

Origin www.cnblogs.com/YuanZiming/p/11568989.html