Rename foreplay#eval to foreplay#eval_pr_str

Goal is to rename foreplay#evalparse to foreplay#eval.
This commit is contained in:
Tim Pope 2013-02-08 00:34:08 -05:00
parent b94a694254
commit a6012b5032

View File

@ -476,7 +476,7 @@ function! s:qfhistory() abort
return list return list
endfunction endfunction
function! foreplay#eval(expr) abort function! foreplay#eval_pr_str(expr) abort
let response = s:eval(a:expr, {'session': 1}) let response = s:eval(a:expr, {'session': 1})
if !empty(get(response, 'value', '')) if !empty(get(response, 'value', ''))
@ -510,9 +510,13 @@ function! foreplay#eval(expr) abort
throw err throw err
endfunction endfunction
function! foreplay#eval(expr) abort
return foreplay#eval_pr_str(a:expr)
endfunction
function! foreplay#eval_prn(expr) abort function! foreplay#eval_prn(expr) abort
try try
echo foreplay#eval(a:expr) echo foreplay#eval_pr_str(a:expr)
catch /^Clojure:/ catch /^Clojure:/
endtry endtry
return '' return ''
@ -583,7 +587,7 @@ function! s:filterop(type) abort
let reg_save = @@ let reg_save = @@
try try
let expr = s:opfunc(a:type) let expr = s:opfunc(a:type)
let @@ = matchstr(expr, '^\n\+').foreplay#eval(expr).matchstr(expr, '\n\+$') let @@ = matchstr(expr, '^\n\+').foreplay#eval_pr_str(expr).matchstr(expr, '\n\+$')
if @@ !~# '^\n*$' if @@ !~# '^\n*$'
normal! gvp normal! gvp
endif endif
@ -634,7 +638,7 @@ function! s:Eval(bang, line1, line2, count, args) abort
endif endif
if a:bang if a:bang
try try
let result = foreplay#eval(expr) let result = foreplay#eval_pr_str(expr)
if a:args !=# '' if a:args !=# ''
call append(a:line1, result) call append(a:line1, result)
exe a:line1 exe a:line1
@ -702,7 +706,7 @@ function! s:recall() abort
if input =~# '^(\=$' if input =~# '^(\=$'
return '' return ''
else else
return foreplay#eval(input) return foreplay#eval_pr_str(input)
endif endif
catch /^Clojure:/ catch /^Clojure:/
return '' return ''
@ -807,7 +811,7 @@ function! s:Require(bang, ns)
let cmd = ('(require '.s:qsym(a:ns ==# '' ? foreplay#ns() : a:ns).' :reload'.(a:bang ? '-all' : '').')') let cmd = ('(require '.s:qsym(a:ns ==# '' ? foreplay#ns() : a:ns).' :reload'.(a:bang ? '-all' : '').')')
echo cmd echo cmd
try try
call foreplay#eval(cmd) call foreplay#eval_pr_str(cmd)
return '' return ''
catch /^Clojure:.*/ catch /^Clojure:.*/
return '' return ''
@ -1000,7 +1004,7 @@ endfunction
function! s:Lookup(ns, macro, arg) abort function! s:Lookup(ns, macro, arg) abort
" doc is in clojure.core in older Clojure versions " doc is in clojure.core in older Clojure versions
try try
call foreplay#eval("(require '".a:ns.") (clojure.core/eval (list (if (ns-resolve 'clojure.core '".a:macro.") 'clojure.core/".a:macro." '".a:ns.'/'.a:macro.") '".a:arg.'))') call foreplay#eval_pr_str("(require '".a:ns.") (clojure.core/eval (list (if (ns-resolve 'clojure.core '".a:macro.") 'clojure.core/".a:macro." '".a:ns.'/'.a:macro.") '".a:arg.'))')
catch /^Clojure:/ catch /^Clojure:/
catch /.*/ catch /.*/
echohl ErrorMSG echohl ErrorMSG