Lua - How could I edit the Registry?









up vote
1
down vote

favorite












I wanted to know how I could edit the Lua registry?



https://www.lua.org/pil/27.3.1.html
This registry, should include all of the functions, userdata, booleans, and tables.










share|improve this question

















  • 1




    "I" being who in this case? If you're in a Lua script, you can't touch the registry, period. If you're in C code, then you have complete control over the registry and can do whatever you want with it. So it's not clear what you mean here.
    – Nicol Bolas
    Nov 11 at 6:34










  • The registry doesn't store everything, it is a hidden table useful for native code to store references to Lua objects. You don't need it in Lua.
    – IllidanS4
    Nov 11 at 11:32














up vote
1
down vote

favorite












I wanted to know how I could edit the Lua registry?



https://www.lua.org/pil/27.3.1.html
This registry, should include all of the functions, userdata, booleans, and tables.










share|improve this question

















  • 1




    "I" being who in this case? If you're in a Lua script, you can't touch the registry, period. If you're in C code, then you have complete control over the registry and can do whatever you want with it. So it's not clear what you mean here.
    – Nicol Bolas
    Nov 11 at 6:34










  • The registry doesn't store everything, it is a hidden table useful for native code to store references to Lua objects. You don't need it in Lua.
    – IllidanS4
    Nov 11 at 11:32












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I wanted to know how I could edit the Lua registry?



https://www.lua.org/pil/27.3.1.html
This registry, should include all of the functions, userdata, booleans, and tables.










share|improve this question













I wanted to know how I could edit the Lua registry?



https://www.lua.org/pil/27.3.1.html
This registry, should include all of the functions, userdata, booleans, and tables.







lua registry






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 11 at 1:59









James

303




303







  • 1




    "I" being who in this case? If you're in a Lua script, you can't touch the registry, period. If you're in C code, then you have complete control over the registry and can do whatever you want with it. So it's not clear what you mean here.
    – Nicol Bolas
    Nov 11 at 6:34










  • The registry doesn't store everything, it is a hidden table useful for native code to store references to Lua objects. You don't need it in Lua.
    – IllidanS4
    Nov 11 at 11:32












  • 1




    "I" being who in this case? If you're in a Lua script, you can't touch the registry, period. If you're in C code, then you have complete control over the registry and can do whatever you want with it. So it's not clear what you mean here.
    – Nicol Bolas
    Nov 11 at 6:34










  • The registry doesn't store everything, it is a hidden table useful for native code to store references to Lua objects. You don't need it in Lua.
    – IllidanS4
    Nov 11 at 11:32







1




1




"I" being who in this case? If you're in a Lua script, you can't touch the registry, period. If you're in C code, then you have complete control over the registry and can do whatever you want with it. So it's not clear what you mean here.
– Nicol Bolas
Nov 11 at 6:34




"I" being who in this case? If you're in a Lua script, you can't touch the registry, period. If you're in C code, then you have complete control over the registry and can do whatever you want with it. So it's not clear what you mean here.
– Nicol Bolas
Nov 11 at 6:34












The registry doesn't store everything, it is a hidden table useful for native code to store references to Lua objects. You don't need it in Lua.
– IllidanS4
Nov 11 at 11:32




The registry doesn't store everything, it is a hidden table useful for native code to store references to Lua objects. You don't need it in Lua.
– IllidanS4
Nov 11 at 11:32












1 Answer
1






active

oldest

votes

















up vote
2
down vote



accepted










Lua registry is just regular Lua table. There just no reference to it from global scope.
You can e.g. use debug.getregistry() function to get it.
But be sure you know what you are doing.
And of course not all libraries stores its data in registry. Some of them use e.g. upvalues or uservalues to store some internal structure. Also any library can change its internals in any time. And most of them I think didn't expect that their data will be changed outside.






share|improve this answer




















  • Thanks, I will look into that
    – James
    Nov 12 at 16:44










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245204%2flua-how-could-i-edit-the-registry%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote



accepted










Lua registry is just regular Lua table. There just no reference to it from global scope.
You can e.g. use debug.getregistry() function to get it.
But be sure you know what you are doing.
And of course not all libraries stores its data in registry. Some of them use e.g. upvalues or uservalues to store some internal structure. Also any library can change its internals in any time. And most of them I think didn't expect that their data will be changed outside.






share|improve this answer




















  • Thanks, I will look into that
    – James
    Nov 12 at 16:44














up vote
2
down vote



accepted










Lua registry is just regular Lua table. There just no reference to it from global scope.
You can e.g. use debug.getregistry() function to get it.
But be sure you know what you are doing.
And of course not all libraries stores its data in registry. Some of them use e.g. upvalues or uservalues to store some internal structure. Also any library can change its internals in any time. And most of them I think didn't expect that their data will be changed outside.






share|improve this answer




















  • Thanks, I will look into that
    – James
    Nov 12 at 16:44












up vote
2
down vote



accepted







up vote
2
down vote



accepted






Lua registry is just regular Lua table. There just no reference to it from global scope.
You can e.g. use debug.getregistry() function to get it.
But be sure you know what you are doing.
And of course not all libraries stores its data in registry. Some of them use e.g. upvalues or uservalues to store some internal structure. Also any library can change its internals in any time. And most of them I think didn't expect that their data will be changed outside.






share|improve this answer












Lua registry is just regular Lua table. There just no reference to it from global scope.
You can e.g. use debug.getregistry() function to get it.
But be sure you know what you are doing.
And of course not all libraries stores its data in registry. Some of them use e.g. upvalues or uservalues to store some internal structure. Also any library can change its internals in any time. And most of them I think didn't expect that their data will be changed outside.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 11 at 11:14









moteus

1,8961715




1,8961715











  • Thanks, I will look into that
    – James
    Nov 12 at 16:44
















  • Thanks, I will look into that
    – James
    Nov 12 at 16:44















Thanks, I will look into that
– James
Nov 12 at 16:44




Thanks, I will look into that
– James
Nov 12 at 16:44

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245204%2flua-how-could-i-edit-the-registry%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

ReactJS Fetched API data displays live - need Data displayed static

政党