Comments (4)
The reason is because luerl:init()
just returns the state not wrapped with a {ok,...}
. So you should call it like
State = luerl:init(),
It maybe should wrap the result but now it just crashes on an error so I thought it wasn't necessary. The messy dump is github.
There is a relatively newly formed google group which might be easier to use if you want to discuss matters, https://groups.google.com/forum/?hl=en&fromgroups#!forum/luerl
Robert
from luerl.
Hi Robert,
Yes, I noticed that the State is returned just as the State after I
submitted the ticket.
But, the issue remains. I don't get luerl's State, even if I try to run it
as it is in the docs.
Eshell V5.9.3.1 (abort with ^G)
1> State = luerl:init().
{luerl,{array,7,10,undefined,
{{table,{array,0,10,nil,10},
{{{{empty,<<"_G">>,
{tref,0},
empty,<<"_VERSION">>,<<"Lua 5.2">>,empty},
<<"assert">>,
{function,#Fun<luerl_basic.1.43970411>},
{empty,<<"collectgarbage">>,
{function,#Fun<luerl_basic.2.43970411>},
empty}},
<<"dofile">>,
{function,#Fun<luerl_basic.3.43970411>},
{{empty,<<"eprint">>,
{function,#Fun<luerl_basic.4.43970411>},
empty},
<<"error">>,
{function,#Fun<luerl_basic.0.43970411>},
{empty,<<"getmetatable">>,
{function,#Fun<luerl_basic.5.43970411>},
empty,<<"io">>,
{tref,2},
empty}}},
<<"ipairs">>,
{function,#Fun<luerl_basic.6.43970411>},
{{{empty,<<"load">>,
{function,#Fun<luerl_basic.7.43970411>},
empty},
<<"loadfile">>,
{function,#Fun<luerl_basic.8.43970411>},
{empty,<<"math">>,{tref,1},empty},
<<"next">>,
{function,#Fun<luerl_basic.9.43970411>},
{empty,<<"os">>,{tref,3},empty}},
<<"pairs">>,
{function,#Fun<luerl_basic.10.43970411>},
{{empty,<<"pcall">>,
{function,#Fun<luerl_basic.11.43970411>},
empty},
<<"print">>,
{function,#Fun<luerl_basic.12.43970411>},
{empty,<<"rawequal">>,
{function,#Fun<luerl_basic.13.43970411>},
empty}}},
<<"rawget">>,
{function,#Fun<luerl_basic.14.43970411>},
{{{empty,<<"rawlen">>,
{function,#Fun<luerl_basic.15.43970411>},
empty},
<<"rawset">>,
{function,#Fun<luerl_basic.16.43970411>},
{empty,<<"select">>,
{function,#Fun<luerl_basic.17.43970411>},
empty}},
<<"setmetatable">>,
{function,#Fun<luerl_basic.18.43970411>},
{{empty,<<"string">>,{tref,4},empty},
<<"table">>,
{tref,6},
{empty,<<"tonu"...>>,{...},...},
<<"tostring">>,
{function,...},
{...}}}},
nil},
{table,{array,0,10,nil,10},
{{{{empty,<<"abs">>,
{function,#Fun<luerl_math.2.36130362>},
empty},
<<"acos">>,
{function,#Fun<luerl_math.3.36130362>},
{empty,<<"asin">>,
{function,#Fun<luerl_math.4.36130362>},
empty}},
<<"atan">>,
{function,#Fun<luerl_math.5.36130362>},
{{empty,<<"atan2">>,
{function,#Fun<luerl_math.6.36130362>},
empty},
<<"ceil">>,
{function,#Fun<luerl_math.7.36130362>},
{empty,<<"cos">>,
{function,#Fun<luerl_math.8.36130362>},
empty}}},
<<"cosh">>,
{function,#Fun<luerl_math.9.36130362>},
{{{empty,<<"deg">>,
{function,#Fun<luerl_math.10.36130362>},
empty},
<<"exp">>,
{function,#Fun<luerl_math.11.36130362>},
{empty,<<"floor">>,
{function,#Fun<luerl_math.12.36130362>},
empty}},
<<"fmod">>,
{function,#Fun<luerl_math.13.36130362>},
{{empty,<<"frexp">>,
{function,#Fun<luerl_math.14.36130362>},
empty},
<<"huge">>,1.7976931348623157e308,
{empty,<<"ldexp">>,
{function,#Fun<luerl_math.15.36130362>},
empty}}},
<<"log">>,
{function,#Fun<luerl_math.16.36130362>},
{{{empty,<<"log10">>,
{function,#Fun<luerl_math.17.36130362>},
empty},
<<"max">>,
{function,#Fun<luerl_math.0.36130362>},
{empty,<<"min">>,
{function,#Fun<luerl_math.1.36130362>},
empty}},
<<"modf">>,
{function,#Fun<luerl_math.18.36130362>},
{{empty,<<"pi">>,3.141592653589793,empty},
<<"pow">>,
{function,#Fun<luerl_math.19.36130362>},
{empty,<<...>>,...}},
<<"random">>,
{function,#Fun<luerl_math.21.36130362>},
{{empty,<<...>>,...},<<"sin">>,{...},...}}},
nil},
{table,{array,0,10,nil,10},
{empty,<<"flush">>,
{function,#Fun<luerl_io.0.115329101>},
empty,<<"write">>,
{function,#Fun<luerl_io.1.115329101>},
empty},
nil},
{table,{array,0,10,nil,10},
{{empty,<<"clock">>,
{function,#Fun<luerl_os.0.53974525>},
empty},
<<"date">>,
{function,#Fun<luerl_os.1.53974525>},
{empty,<<"difftime">>,
{function,#Fun<luerl_os.2.53974525>},
empty},
<<"getenv">>,
{function,#Fun<luerl_os.3.53974525>},
{empty,<<"time">>,
{function,#Fun<luerl_os.4.53974525>},
empty}},
nil},
{table,{array,0,10,nil,10},
{{{empty,<<"byte">>,
{function,#Fun<luerl_string.0.115339544>},
empty},
<<"char">>,
{function,#Fun<luerl_string.1.115339544>},
{empty,<<"find">>,
{function,#Fun<luerl_string.2.115339544>},
empty}},
<<"format">>,
{function,#Fun<luerl_string.3.115339544>},
{{empty,<<"gmatch">>,
{function,#Fun<luerl_string.4.115339544>},
empty},
<<"gsub">>,
{function,#Fun<luerl_string.5.115339544>},
{empty,<<"len">>,
{function,#Fun<luerl_string.6.115339544>},
empty}},
<<"lower">>,
{function,#Fun<luerl_string.7.115339544>},
{{empty,<<"match">>,
{function,#Fun<luerl_string.8.115339544>},
empty},
<<"rep">>,
{function,#Fun<luerl_string.9.115339544>},
{empty,<<"reve"...>>,{...},...},
<<"sub">>,
{function,...},
{...}}},
nil},
{table,{array,0,10,nil,10},
{empty,<<"__index">>,{tref,4},empty},
nil},
{table,{array,0,10,nil,10},
{{empty,<<"concat">>,
{function,#Fun<luerl_table.0.123621961>},
empty},
<<"insert">>,
{function,#Fun<luerl_table.1.123621961>},
{empty,<<"pack">>,
{function,#Fun<luerl_table.2.123621961>},
empty},
<<"remove">>,
{function,#Fun<luerl_table.3.123621961>},
{empty,<<"sort">>,
{function,#Fun<luerl_table.4.123621961>},
empty,<<...>>,...}},
nil},
undefined,undefined,undefined}},
[],7,
{meta,nil,{tref,5},nil},
[{tref,0}],
false,#Ref<0.0.0.222>}
2>
P.S.: I am the "other" guy from you-know-who who'd like to invite you to
you-know-who, San Francisco, after the conference. :)
--Kai
On Tue, Mar 5, 2013 at 8:47 PM, Robert Virding [email protected]:
The reason is because luerl:init() just returns the state not wrapped
with a {ok,...}. So you should call it likeState = luerl:init(),
It maybe should wrap the result but now it just crashes on an error so I
thought it wasn't necessary. The messy dump is github.There is a relatively newly formed google group which might be easier to
use if you want to discuss matters,
https://groups.google.com/forum/?hl=en&fromgroups#!forum/luerlRobert
�
Reply to this email directly or view it on GitHubhttps://github.com//issues/21#issuecomment-14479580
.
from luerl.
That IS luerl's state. It is a record with the following definition:
-record(luerl, {tabs,free,next, %Table structure
meta=[], %Data type metatables
env, %Environment
locf=false, %Started local function
tag %Unique tag
}).
The new-engine, which is soon to be released, has a bigger state with fields especially for global stack frames. These are now kept as tables.
I will come by after the conference and talk languages.
from luerl.
Fantastic, I guess the amount of "empty" in the State were a bit confusing.
But, all is good as long as it works.
--Kai
P.S.> Good to hear that you can make it! That is fantastic news!
from luerl.
Related Issues (20)
- luerl.do returns raw table reference instead of decoded value HOT 3
- Persistent data structures HOT 15
- os.time and os.date API incorrectly implemented HOT 3
- 5.3 converting hex string to decimal error
- The collectgarbage() function is for now a no-op HOT 2
- Release request: 5.3 beta version HOT 3
- Loading third-party library redis failed HOT 3
- Whether to support multi-lua script file parsing HOT 3
- What the 'Reductions' meaning in sandbox? HOT 2
- ability to run lua program line-by-line / pause execution and return to caller HOT 4
- failed to add "require" to the lua script
- string.format crash and inconsistency HOT 4
- Update luerl in hex.pm HOT 4
- more documentation for Mod:install in load_module
- pcall and division by zero HOT 6
- Executing a Lua function from within Elixir does not return the mutated state HOT 5
- Garbage collector removes environment for functions stored in a table in _G HOT 3
- store/retrieve luerl_state
- string.gmatch HOT 1
- load function regression failure in 1.0 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from luerl.