Giter VIP home page Giter VIP logo

ploop's People

Contributors

kurapica avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ploop's Issues

No require check when using table constructor

Using latest version in Wow Classic

Example class:

PLoop(function(_ENV)
    class "Announcement" (function(_ENV)
        property "title" { Require = true, Type = String }
        property "created" { Require = true, Type = String }
        property "author" { Require = true, Type = String }
        property "body" { Require = true, Type = String }
    end)
end)

// OK
test = Announcement{ title = 'title', created = 'created', author = 'author', body = 'body' }

// OK (Error: title must be string )
test = Announcement{ title = 1, created = 'created', author = 'author', body = 'body' }

// OK (Error: title cannot be nil)

test = Announcement{ title = 'title', created = 'created', author = 'author', body = 'body'  }
test.title = nil

// Problem (no error thrown)
test = Announcement{ title = nil, created = 'created', author = 'author', body = 'body' }

Am i doing something wrong?

A sudden flash of a console

I can see a sudden flash of a Console when I launch my Unity3d project with "require('PLoop.init')" under a Framework called xLua~
I can not figure out what causes this~

Why List element'value is error?

Hello kurapica,I'm using PLoop in my project. But why my list element's value is error? By the way,the element is a predefined struct.

`require("3rd.PLoop.init");

do
import "System" -- import a namespace
import "System.Collections"

struct "FieldDes"
{
    { name = "field_order", type = System.Number },
    { name = "field_type", type = System.String },
    { name = "field_value", type = System.Any },
}

struct "Person"
{
    { name = "name", type = Struct },
    { name = "age", type = List },

    __init = function(p)
        p.name = FieldDes(1 , "c32" , "a");
        p.age = List(3,FieldDes(2 , "H" , "c"));
    end,
}

local o = Person()
o.age[1].field_value = "a";
o.age[2].field_value = "b";
---print "b",that's not my ecpected,it should be "a"
print(o.age[1].field_value);
print(o.name.field_value)

end`

Implement true access modifiers

Implement the access modifiers private, protected, and public. This would replace all your identifiers such as __private_variable.

private can be implemented using closures:

function get_x = (function()
    local x = -- Variable x is protected by a closure
    return function()
        return x
    end
end)()

Without access modifiers, you can't have true objects.

Install

Install What?
I can not find a zip-file~

Logo contribution

I want to contribute voluntarily to the project. I want to give you a logo. What do you say?

Performance question

Hi, I've come across your library some time ago but haven't had the opportunity to test it yet. I'm really glad it is still actively maintained, you have done an enormous amount of impressive work so far, especially with the full, clean documentation!

I'm now considering using PLoop in one of my projects, but I'm concerned about performance because in this specific environment we're talking about multiple (tens to hundreds) "resources" which are actually separate Lua virtual machines embedded in the game. Almost all of them are started at once when the gameplay starts (with minor exceptions). Each of these resources would of course need to require() PLoop on its own, I don't think it's possible to share anything between these VMs.

I've seen your comment in this issue #7 :

That doesn't mean the PLoop is slower than normal lua codes, the PLoop is heavy in the definition phase, but will be the same like common Lua during the runtime phase.

What exactly do you mean by "heavy"? What numbers are we speaking of (microseconds, miliseconds?). Do you maybe have some benchmarks that you could present to illustrate the total impact of including this wonderful library in some existing project?

Thanks in advance, keep up the great work!

documentation is missing

Today, I have wanted to view the online documentation, and I seen that it is missing. Only the home page exists, and click on a link redirect to the home page...

An Exception on Mac

Yes, it's me!
________Mac OS v10.13.2
I find new issue, ehhhh, i am not sure it is caused by PLoop, but i'd like put it forward (Maybe you can improve PLoop in some way~~~~)
here is the stack:

LuaException: /Users/yi/Workspace/Neo/Assets/StreamingAssets/LuaScripts/./PLoop/System/IO/Path.lua:20: 'popen' not supported
stack traceback:
	[C]: in function 'error'
	/Users/yi/Workspace/Neo/Assets/StreamingAssets/LuaScripts/./PLoop/Core.lua:3685: in metamethod '__newindex'
	/Users/yi/Workspace/Neo/Assets/StreamingAssets/LuaScripts/./PLoop/System/IO/Path.lua:20: in function </Users/yi/Workspace/Neo/Assets/StreamingAssets/LuaScripts/./PLoop/System/IO/Path.lua:15>
	(...tail calls...)
	/Users/yi/Workspace/Neo/Assets/StreamingAssets/LuaScripts/./PLoop/Core.lua:3699: in function </Users/yi/Workspace/Neo/Assets/StreamingAssets/LuaScripts/./PLoop/Core.lua:3698>
	/Users/yi/Workspace/Neo/Assets/StreamingAssets/LuaScripts/./PLoop/System/IO/Path.lua:15: in main chunk
	[C]: in function 'require'
	/Users/yi/Workspace/Neo/Assets/StreamingAssets/LuaScripts/./PLoop/init.lua:28: in main chunk
	[C]: in function 'require'
	[string "UI.SceneLogin"]:6: in main chunk
XLua.LuaEnv.ThrowExceptionFromError (System.Int32 oldTop) (at Assets/XLua/Src/LuaEnv.cs:429)
XLua.LuaEnv.DoString (System.Byte[] chunk, System.String chunkName, XLua.LuaTable env) (at Assets/XLua/Src/LuaEnv.cs:262)
XLua.LuaEnv.DoString (System.String chunk, System.String chunkName, XLua.LuaTable env) (at Assets/XLua/Src/LuaEnv.cs:276)
Bingo.Lua.LuaManager.DoFile (System.String fileName, XLua.LuaTable env) (at Assets/Scripts/Lua/LuaManager.cs:152)
Bingo.Lua.LuaBehaviour.Awake () (at Assets/Scripts/Lua/LuaBehaviour.cs:56)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.