requires: {#Terminal. #ConsoleLineEditor}. provides: {#REPL}. prototypes addPrototype: #REPL derivedFrom: {ConsoleLineEditor}. REPL addSlot: #parser valued: Syntax Parser clone. REPL addSlot: #printer valued: String writer. REPL addSlot: #namespace valued: lobby. REPL addSlot: #lineCount valued: 0. REPL basePrompt: '> '. repl@(REPL traits) prompt [ 'Slate ' ; repl lineCount print ; repl basePrompt ]. repl@(REPL traits) on: resource "Re-target the REPL to the specified resource." [ repl parser: (repl parser newOn: resource reader). repl printer: resource writer. repl ]. repl@(REPL traits) enter [ [(repl parser next evaluateIn: repl namespace) printOn: repl printer. repl printer newLine. repl printer flush] loop ]. repl@(REPL traits) complete: word "TODO: Consult the Symbol table or recent literal frames for names with the given string as a prefix. Collect the results and return them." [ ]. repl@(REPL traits) enterBoot [ [(Syntax Block newFor: repl parser next) compileAndRun printOn: repl printer. repl printer newLine. repl printer flush] loop ]. _@lobby repl "Enter a new REPL instance." [| repl | repl: (REPL newOn: Console). repl enter. ].