diff runtime/doc/eval.txt @ 16103:518f44125207 v8.1.1056

patch 8.1.1056: no eval function for Ruby commit https://github.com/vim/vim/commit/e99be0e6d28fad96efd2b2be23fa38e7559e80e1 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Mar 26 22:51:09 2019 +0100 patch 8.1.1056: no eval function for Ruby Problem: No eval function for Ruby. Solution: Add rubyeval(). (Ozaki Kiichi, closes https://github.com/vim/vim/issues/4152)
author Bram Moolenaar <Bram@vim.org>
date Tue, 26 Mar 2019 23:00:07 +0100
parents bd7461db24b3
children 0375e54f0adc
line wrap: on
line diff
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2521,6 +2521,7 @@ repeat({expr}, {count})		String	repeat {
 resolve({filename})		String	get filename a shortcut points to
 reverse({list})			List	reverse {list} in-place
 round({expr})			Float	round off {expr}
+rubyeval({expr})		any	evaluate |Ruby| expression
 screenattr({row}, {col})	Number	attribute at screen position
 screenchar({row}, {col})	Number	character at screen position
 screencol()			Number	current cursor column
@@ -7432,6 +7433,17 @@ round({expr})							*round()*
 <			-5.0
 		{only available when compiled with the |+float| feature}
 
+rubyeval({expr})					*rubyeval()*
+		Evaluate Ruby expression {expr} and return its result
+		converted to Vim data structures.
+		Numbers, floats and strings are returned as they are (strings
+		are copied though).
+		Arrays are represented as Vim |List| type.
+		Hashes are represented as Vim |Dictionary| type.
+		Other objects are represented as strings resulted from their
+		"Object#to_s" method.
+		{only available when compiled with the |+ruby| feature}
+
 screenattr({row}, {col})					*screenattr()*
 		Like |screenchar()|, but return the attribute.  This is a rather
 		arbitrary number that can only be used to compare to the