bairui

Evaluate a nested expression

Oct 11th, 2011
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 0.12 KB | None | 0 0
  1. function! Evaluate(s)
  2.   return type(a:s) == type('1') ? a:s : eval(a:s[0] . a:s[1] . Evaluate(a:s[2]))
  3. endfunction
  4.  
  5.  
Advertisement
Add Comment
Please, Sign In to add comment