SquidDev, on 03 July 2015 - 05:11 PM, said:
Yeah ik i was just lazy.. I'm not an objective c person.. its hard for me to understand
There have been 18 items by TechMasterGeneral (Search limited from 10-February 22)
Posted by
TechMasterGeneral
on 03 July 2015 - 07:51 PM
in
Programs
Posted by
TechMasterGeneral
on 03 July 2015 - 04:07 PM
in
Ask a Pro
Lupus590, on 03 July 2015 - 03:17 PM, said:
TechMasterGeneral, on 03 July 2015 - 12:43 PM, said:
Posted by
TechMasterGeneral
on 03 July 2015 - 03:15 PM
in
Programs
ElvishJerricco, on 09 September 2013 - 05:01 PM, said:
grin-get install Team-CC-Corp/LuaLuaThen reboot your computer. Now any loaded code will use the LuaLua compiler.
local function (myFunction) -- Creates local function myFunction
print("Hello, World!")
end
|@ myFunction| -- Calls myFunction
local function (doSomething:some withThing:thing) print(some, thing) end |@ doSomething:"dog" withThing:"frisbee"|
local function (thisIsA:vararg func: a,b,c, ... ) print(...) end |@ thisIsA:"vararg" func: 1,2,3,4,5,6,7,8,9|
thisIsA:func:
@"someGlobalName?can#have^anything)in*it." = 4
local function (someFunction:param secondParam:param2) return param + param2 end local x = @"someFunction:secondParam:"(firstParam, secondParam)
somethingThatTakesAFunction(\(p1, p2, ...) print(...) end)
local @class MyClass : LuaObject
function (init)
|super init|
print("MyClass initializing")
return self
end
function (myMethod:param)
print(param)
end
end
local obj = ||MyClass new| init|
|obj myMethod:"method!"|
local t = {}
for i = 1, 100 do
t[i] = @class : LuaObject
function (test)
end
end
end
local @class MyClass : LuaObject @static
-- static class stuff
local numberOfInstances = 0
function (new)
numberOfInstances = numberOfInstances + 1
return |super new|
end
function (printNumInstances)
print(numberOfInstances)
end
end -- end static class
-- instance object stuff
function (instanceMethod)
print("instance!")
end
end -- end instance class
|MyClass printNumInstances| -- prints 0
local obj = |MyClass new|
|MyClass printNumInstances| -- prints 1
|obj instanceMethod| -- prints instance!
local MyClass = |LuaObject subclassWithClassInstantiator:function(self, super)
-- static class stuff
local numberOfInstances = 0
function (new)
numberOfInstances = numberOfInstances + 1
return |super new|
end
function (printNumInstances)
print(numberOfInstances)
end
end andObjectInstantiator:function(self, super)
-- instance object stuff
function (instanceMethod)
print("instance!")
end
end|
@class MyClass : LuaObject @property myProp function init() |super init| |@ setMyProp:3| print(|@ getMyProp|) -- prints 3 return self end end
@class MyClass : LuaObject @property myProp = myLocalName function init() |super init| |@ setMyProp:3| myLocalName = 4 print(|@ getMyProp|) -- prints 4 return self end end
@property a -- equivalent to do local _a |@ setProperty:"a" withGetter:function() return _a end named:"getA" andSetter:function(v) _a = v end named:"setA"| end
local @class A:LuaObject @property(setter=setMe,getter=getMe) prop = _prop function (setMe:v) print(v) _prop = v end function getMe() print(_prop) return _prop end end local obj = ||A new| init| obj.prop = 3 -- prints 3 print(obj.prop) -- prints 3 twice
local @class A:LuaObject @property a function init() |super init| a = 4 -- equivalent to self.a = 4 return self end end
-- MyClass.lua
local @class MyClass : LuaObject
function (test)
print("test")
end
end
return MyClass
-- program.lua
local MyClass = require("MyClass.lua")
local obj = ||MyClass new| init|
|obj test|
folder | program.lua | subfolder | | MyClass.lua
Posted by
TechMasterGeneral
on 03 July 2015 - 12:43 PM
in
Ask a Pro
Lupus590, on 03 July 2015 - 12:39 PM, said:
TechMasterGeneral, on 03 July 2015 - 12:32 PM, said:
valithor, on 03 July 2015 - 05:38 AM, said:
Posted by
TechMasterGeneral
on 03 July 2015 - 12:32 PM
in
Ask a Pro
valithor, on 03 July 2015 - 05:38 AM, said:
Posted by
TechMasterGeneral
on 03 July 2015 - 12:26 PM
in
Ask a Pro
Posted by
TechMasterGeneral
on 03 July 2015 - 03:19 AM
in
Ask a Pro
Posted by
TechMasterGeneral
on 25 April 2015 - 12:35 AM
in
Peripheral Help and Discussion
Posted by
TechMasterGeneral
on 23 April 2015 - 03:13 AM
in
Peripheral Help and Discussion
theoriginalbit, on 22 April 2015 - 11:19 PM, said:
@Override
public String[] getMethodNames() {
return new String[]{ "generateUUID" };
}
will create a new string array of the size required and add the supplied elements into it.
Posted by
TechMasterGeneral
on 22 April 2015 - 11:17 PM
in
Peripheral Help and Discussion
Lyqyd, on 22 April 2015 - 06:29 PM, said:
Posted by
TechMasterGeneral
on 22 April 2015 - 06:20 PM
in
Peripheral Help and Discussion
Posted by
TechMasterGeneral
on 13 January 2015 - 03:21 PM
in
General
GravityScore, on 21 June 2013 - 08:13 PM, said:
theoriginalbit, on 21 June 2013 - 11:09 AM, said:
jesusthekiller, on 21 June 2013 - 10:42 AM, said:
Posted by
TechMasterGeneral
on 13 January 2015 - 03:13 PM
in
General
Posted by
TechMasterGeneral
on 13 January 2015 - 02:41 AM
in
Peripherals and Turtle Upgrades
Posted by
TechMasterGeneral
on 11 January 2015 - 03:29 PM
in
Peripherals and Turtle Upgrades
Posted by
TechMasterGeneral
on 09 January 2015 - 10:22 PM
in
Forum Games
Posted by
TechMasterGeneral
on 09 January 2015 - 07:01 PM
in
Forum Games
Posted by
TechMasterGeneral
on 09 January 2015 - 06:52 PM
in
Forum Games
