From 82307232cc1cae8eefffdcb91b4cd66adf7c42e1 Mon Sep 17 00:00:00 2001 From: Mathieu Gagnon Date: Mon, 8 Feb 2016 08:34:56 -0500 Subject: [PATCH] Update wrenInterpret doc/site/embedding-api --- doc/site/embedding-api.markdown | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/doc/site/embedding-api.markdown b/doc/site/embedding-api.markdown index 061b5ac3..0476e37b 100644 --- a/doc/site/embedding-api.markdown +++ b/doc/site/embedding-api.markdown @@ -77,16 +77,9 @@ VM, waiting to run some code! You can tell the VM to execute a string of Wren source code like so: :::c - WrenInterpretResult result = wrenInterpret(vm, - "", - "System.print(\"Hi!\")"); + WrenInterpretResult result = wrenInterpret(vm, "System.print(\"Hi!\")"); -The first string parameter is a "source path". It's just an arbitrary string -that describes where the source code is from. It's what shows up in stack traces -if a runtime error occurs in the code. It can be whatever you want as long as -it's not `NULL`. - -The other string is the chunk of code to execute—a series of one or more +The first string is the chunk of code to execute—a series of one or more statements separated by newlines. Wren runs this code in a special "main" module. Each time you call this, the code is run in the same module. This way, top-level names defined in one call can be accessed in later ones.