Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
poopyguy7
|
  |
| Joined: 30 Jan 2010 |
| Total Posts: 283 |
|
| |
|
|
| 14 Jul 2011 04:28 PM |
| I made this with _G.incldue and _G.create (I think). Although, I like yours better :D |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
camo2
|
  |
| Joined: 15 Oct 2006 |
| Total Posts: 443 |
|
|
| 14 Jul 2011 04:30 PM |
| I wouldn't need it, but this seems pretty nice. |
|
|
| Report Abuse |
|
|
Camoy
|
  |
| Joined: 21 May 2009 |
| Total Posts: 6207 |
|
|
| 14 Jul 2011 04:36 PM |
Would be better if you didn't need to litter the global environment with those definitions. Should put it in another closure.
_G.export('myLib', function() fn = function() return 'hi' end end)
_G.import('myLib') print(fn())
OR
_G.import('myLib', function() fn() end) |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 14 Jul 2011 04:40 PM |
Camoy, that's exactly like mine: _G.create("myLibrary", {function blarg() print("HI") end})
_G.RemoveG() include("myLibrary") blarg()
>HI |
|
|
| Report Abuse |
|
|
Camoy
|
  |
| Joined: 21 May 2009 |
| Total Posts: 6207 |
|
|
| 14 Jul 2011 04:40 PM |
| I think one call with a closure would be better. :3 |
|
|
| Report Abuse |
|
|
Camoy
|
  |
| Joined: 21 May 2009 |
| Total Posts: 6207 |
|
|
| 14 Jul 2011 04:41 PM |
@Merlin Don't worry, we all have them. I have one (REALLY OLD) named "Include Classes". I wonder if I posted it on here :/ |
|
|
| Report Abuse |
|
|
|
| 14 Jul 2011 04:41 PM |
| actually that line might be blarg=function() |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
Camoy
|
  |
| Joined: 21 May 2009 |
| Total Posts: 6207 |
|
|
| 14 Jul 2011 04:43 PM |
Yeah, I found the thread. http://www.roblox.com/Forum/ShowPost.aspx?PostID=27770901
Back when we had global *sadfaic* |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
Camoy
|
  |
| Joined: 21 May 2009 |
| Total Posts: 6207 |
|
|
| 14 Jul 2011 04:45 PM |
| Well "I" have global, you guys have _G. Ha :P |
|
|
| Report Abuse |
|
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
Camoy
|
  |
| Joined: 21 May 2009 |
| Total Posts: 6207 |
|
|
| 14 Jul 2011 04:47 PM |
| Whoops did I say that out loud. |
|
|
| Report Abuse |
|
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
Ozzypig
|
  |
| Joined: 27 Mar 2008 |
| Total Posts: 4906 |
|
|
| 14 Jul 2011 04:50 PM |
I had implemented something like this in jrLua, only it's a library system. After you included jrLua in a script (using shared.jrlua() or _G.jrlua()) then you could load/create libraries based on rules.
shared.jrlua() lib("KK") Song.new(Song.parse(...))
Of course, it's hard to give a good example when most of the existing libraries are made for practical reasons.
Check it out if you haven't, because it works great and maybe you could make a system that improves it. http://www.roblox.com/jrLua-2-0-0-Public-item?id=55760188
~Ozzy |
|
|
| Report Abuse |
|
|
Camoy
|
  |
| Joined: 21 May 2009 |
| Total Posts: 6207 |
|
|
| 14 Jul 2011 04:58 PM |
This are pretty funny: http://www.roblox.com/Forum/ShowPost.aspx?PostID=270293 http://www.roblox.com/Forum/ShowPost.aspx?PostID=286326
--
On a side note, why does it say Zuka is online ._. http://www.roblox.com/Forum/ShowPost.aspx?PostID=231619 |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 15 Jul 2011 09:20 AM |
@Camoy
You don't want to know why Zuka is online. |
|
|
| Report Abuse |
|
|