1 MalReadline
:= Object clone do (
3 historyFile
:= (System
getEnvironmentVariable("HOME")) .. "/.mal-history"
6 if(File exists(historyFile
), ReadLine
loadHistory(historyFile
))
10 readLine
:= method(prompt
,
11 if(historyLoaded not
, loadHistory
)
12 line
:= ReadLine
readLine(prompt
)
13 if(line
isNil, return(nil
))
14 if(line isEmpty
, return(line
))
15 ReadLine
addHistory(line
)
16 ReadLine
saveHistory(historyFile
)