@@ -25,20 +25,14 @@ access to other languages.
25
25
26
26
## Running Ruby code from another language
27
27
28
- When you ` eval ` Ruby code from the Polyglot API in another language and mark
29
- the source as interactive, the same interactive top-level binding is used each
30
- time. This means that if you set a local variable in one ` eval ` , you will be
31
- able to use it from the next.
32
-
33
- Not that parsing Ruby is dependent on the current state of the top-level
34
- binding. If you parse an interactive source with the binding at one point in
35
- time, and then execute against the binding after it has been modified, the
36
- code will not be re-parsed with the modified binding. You may even find that
37
- you create a race condition, or parse against a binding in a state during the
38
- execution of another source.
39
-
40
- To complicate this - Ruby parsing in TruffleRuby is lazy. Your code won't be
41
- parsed until it is executed for the first time.
28
+ When you ` eval ` Ruby code from the [ Context API] ( https://www.graalvm.org/sdk/javadoc/org/graalvm/polyglot/Context.html )
29
+ in another language and mark the ` Source ` as interactive, the same interactive
30
+ top-level binding is used each time. This means that if you set a local variable
31
+ in one ` eval ` , you will be able to use it from the next.
32
+
33
+ The semantics are the same as the Ruby semantics of calling
34
+ ` INTERACTIVE_BINDING.eval(code) ` for every ` Context.eval() ` call with an
35
+ interactive ` Source ` . This is similar to most REPL semantics.
42
36
43
37
## Loading code written in foreign languages
44
38
0 commit comments