Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/trepl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@fb.com>2015-03-16 22:13:06 +0300
committerSoumith Chintala <soumith@fb.com>2015-03-16 22:13:06 +0300
commit6eb66884bdb5416cf6ae3675a1c4a3ebac2f8758 (patch)
treeb4310b86f87daa349bcb2a6e2cbea7d26991db3d
parent6c14b137a77488384b37f4e423b219cd48dbf4a3 (diff)
pcall and load dok by the start
-rw-r--r--init.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index 1944cda..9310918 100644
--- a/init.lua
+++ b/init.lua
@@ -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')