docs: remove placeholder application-lifecycle page and complete first draft of embedding docs

- Delete the empty "Application Lifecycle" page (was just a TODO placeholder)
- Expand "Storing C Data" from stub to full documentation covering foreign classes, initialization, access, and finalization
- Add note that VM is not re-entrant; warn against calling wrenCall/wrenInterpret from foreign methods
- Fix broken cross-reference links (configuring-the-vm.html, wren.hpp include)
- Clarify slot API usage: remove confusing sentence about implicit return of receiver
- Fix grammar: "each VM them differently" → "each VM differently", "is only be called" → "is only called"
- Improve phrasing throughout for clarity and consistency
This commit is contained in:
Bob Nystrom
2017-10-17 15:26:06 +00:00
parent 8bd5b85df5
commit 4018d42c39
8 changed files with 388 additions and 104 deletions
+4 -9
View File
@@ -92,15 +92,10 @@ have to explicitly link to.
[libm]: https://en.wikipedia.org/wiki/C_mathematical_functions#libm
If your program is in C++ but you are linking to the Wren library compiled as C,
then you'll need to handle the calling convention differences like so:
this header handles the differences in calling conventions between C and C++:
:::c
extern "C" {
#include "wren.h"
}
(Wren's source can be compiled as either C or C++, so you can skip this by
compiling the whole thing yourself as C++. Whatever floats your boat.)
#include "wren.hpp"
## Creating a Wren VM
@@ -115,7 +110,7 @@ This gives you a basic configuration that has reasonable defaults for
everything. If you don't need to tweak stuff, you can leave it at that. We'll
[learn more][configuration] about what you can configure later.
[configuration]: configuration.html
[configuration]: configuring-the-vm.html
With this ready, you can create the VM:
@@ -128,7 +123,7 @@ a WrenVM. You can have multiple Wren VMs running independently of each other
without any problems, even concurrently on different threads.
`wrenNewVM()` stores its own copy of the configuration, so after calling it, you
can discard the `WrenConfiguration` struct you filled in. Now you have a live
can discard the WrenConfiguration struct you filled in. Now you have a live
VM, waiting to run some code!
## Executing Wren code