537 posts
Location
Copenhagen, Denmark
Posted 30 March 2012 - 07:20 PM
Hi! I think it would be awesome, if we could use require <filename>, just like normal.
This would open alot of new possibilities, and make life a whole lot easier for many people. :o/>/>
Hope a developer of CC sees this xD
454 posts
Location
London
Posted 30 March 2012 - 07:23 PM
require() was actually removed.
You can use loadfile().
537 posts
Location
Copenhagen, Denmark
Posted 30 March 2012 - 07:33 PM
Are they 100% identical?
454 posts
Location
London
Posted 30 March 2012 - 07:37 PM
Do they HAVE to be?
You can create your own require() if you really want it that much.
14 posts
Posted 08 April 2012 - 01:09 AM
Why not return a pseudo-object (table) with dofile?
510 posts
Posted 08 April 2012 - 11:17 AM
dofile should behave as specified in the lua api.
but a cc require function could look through a library path and than load the searched api. Currently, APIs are loaded on startup only, and to load it later you have to know the full path. A package library inplementation would be definetely a good thing. it could also search in local paths if the library isn't found in the rom path.