diff options
author | Soumith Chintala <soumith@fb.com> | 2015-03-16 22:13:06 +0300 |
---|---|---|
committer | Soumith Chintala <soumith@fb.com> | 2015-03-16 22:13:06 +0300 |
commit | 6eb66884bdb5416cf6ae3675a1c4a3ebac2f8758 (patch) | |
tree | b4310b86f87daa349bcb2a6e2cbea7d26991db3d | |
parent | 6c14b137a77488384b37f4e423b219cd48dbf4a3 (diff) |
pcall and load dok by the start
-rw-r--r-- | init.lua | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -19,6 +19,8 @@ pcall(require,'torch') pcall(require,'paths') pcall(require,'sys') pcall(require,'xlua') +local dok_loaded_ok = pcall(require,'dok') + -- Colors: local colors = require 'trepl.colors' @@ -550,8 +552,7 @@ function repl() -- Shortcut to get help: if line and line:find('^%s-?') then - local ok = pcall(require,'dok') - if ok then + if dok_loaded_ok then line = 'help(' .. line:gsub('^%s-?','') .. ')' else print('error: could not load help backend') |