Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
lua/test/test.lua
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
19 lines (14 sloc)
515 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local sharetable = require "sharetable" | |
| local multivm = require "multivm" | |
| local vm = multivm.new() | |
| local testp, tablep = vm:dostring [[ | |
| local sharetable = require "sharetable" | |
| _G.test = { "Hello", "World" } | |
| local testp = sharetable.mark_shared(_G.test) | |
| local tablep = sharetable.mark_shared(_G.table) | |
| return testp, tablep | |
| ]] | |
| local shared_test = sharetable.clone(testp) | |
| local shared_table = sharetable.clone(tablep) | |
| -- Use table.unpack in vm to unpack _G.test in vm. | |
| print(shared_table.unpack(shared_test)) |