Comments (10)
Original comment by Bart van Strien (Bitbucket: bartbes, GitHub: bartbes).
Hmm, interesting...
from love.
Original comment by Robin Wellner (Bitbucket: gvx, GitHub: gvx).
So, here is a patch, to show how easy it would be:
diff -r 8c524628753e src/scripts/boot.lua
--- a/src/scripts/boot.lua Sat Jun 26 19:10:58 2010 +0200
+++ b/src/scripts/boot.lua Tue Jul 27 11:57:31 2010 +0200
@@ -246,13 +246,13 @@
-- If config file exists, load it and allow it to update config table.
if not love.conf and love.filesystem and love.filesystem.exists("conf.lua") then
- require("conf.lua")
+ love.conf = setfenv(love.filesystem.load("conf.lua"), c)
end
-- Yes, conf.lua might not exist, but there are other ways of making
-- love.conf appear, so we should check for it anyway.
if love.conf then
- local ok, err = pcall(love.conf, c)
+ local ok, err = pcall(love.conf)
if not ok then
print(err)
-- continue
The second change could even be left alone if you want.
Also, this doesn't check for errors in loading conf.lua, but then again, the previous version doesn't either.
from love.
Original comment by Bill Meltsner (Bitbucket: bmelts, GitHub: bmelts).
I don't know how forward-thinking we want to be here, but Lua 5.2 has deprecated setfenv, and assuming that we want to upgrade at some point, it might be prudent to try and figure out an alternative. Maybe.
from love.
Original comment by Bart van Strien (Bitbucket: bartbes, GitHub: bartbes).
It still has some form of function environments, forgot how to do it, but they're no going to remove the setfenv functionality.. I think.
from love.
Original comment by Robin Wellner (Bitbucket: gvx, GitHub: gvx).
IIRC 5.2 has the local _ENV for the environment, so it'll have to set that in some way.
from love.
Original comment by Robin Wellner (Bitbucket: gvx, GitHub: gvx).
Also, I think setfenv is kept in the debug library (which has to be required anyway for the error handler).
from love.
Original comment by Bart van Strien (Bitbucket: bartbes, GitHub: bartbes).
You'd remove some (as far as I know unused) functionality, and lose backwards-compatibility, so, what is the big gain here?
from love.
Original comment by Robin Wellner (Bitbucket: gvx, GitHub: gvx).
Simplicity and easy for lovers.
from love.
Original comment by Bart van Strien (Bitbucket: bartbes, GitHub: bartbes).
On IRC we came to conclusion that we'd leave it how it is. (or at least, I came to that conclusion :P)
from love.
Original comment by Luiji Maryo (Bitbucket: luiji, GitHub: luiji).
Could you please post more information onto why you came to this conclusion, Bartbes?
from love.
Related Issues (20)
- Joysticks rapidly disconnect and reconnect on 11.5, but not on 11.4 HOT 4
- Both key and scankey has some problems on AZERTY keyboards HOT 4
- "No game" screen in folder with "main.lua" file present HOT 1
- love.data.unpack arg #3 default is no 1 HOT 1
- love.data.hash container output typed for love 12.0 HOT 1
- Request: MeshDrawMode: lines HOT 3
- Keyboard and mouse button states are lost when love.window.setMode() is called (11.5 on Windows) HOT 3
- Request: Add x and y params to filedropped() and directorydropped() event callbacks HOT 3
- Multithreaded job/task system HOT 3
- Request: ability to bind a texture to a shader at specific mipmap level HOT 6
- Request: Love2D Android app ability to import and store .love files in its own directory (similar to iOS version) HOT 6
- Feature request: love.filesystem.newTempFile HOT 7
- Bug: File:read() returns empty string instead of nil when past end of file HOT 2
- Low FPS on certain monitor HOT 6
- love.data.compress causes a segfault on macOS Big Sur (LOVE 11.5) HOT 9
- Regression 11.5: key events not triggered when an IME language is active (windows) HOT 12
- [12.0] C++ exception with newShader() and Vulkan renderer
- (Android/IOS) Display rotation control HOT 1
- [Linux] Add better packaging/distribution options HOT 20
- Brew install fails on macOS with: Error : SHA256 mismatch HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from love.