Search found 2408 matches

by pgimeno
Fri Jan 15, 2021 1:34 pm
Forum: Support and Development
Topic: Master tables
Replies: 6
Views: 203

Re: Master tables

I've written sort of a tutorial on metatables: https://codeberg.org/pgimeno/Gists/src/ ... e-tutorial

It covers most of the fine details of how metatables work, including some advanced aspects.
by pgimeno
Wed Jan 13, 2021 5:33 pm
Forum: Support and Development
Topic: Master tables
Replies: 6
Views: 203

Re: Master tables

MrFariator wrote:
Wed Jan 13, 2021 5:22 pm

Code: Select all

  __call = function(master, child) end
Are you sure that's correct? You're defining __call as a global. I haven't seen the OP's code though, so maybe it makes more sense in the context of the program.
by pgimeno
Wed Jan 13, 2021 5:25 pm
Forum: Libraries and Tools
Topic: LuaPreprocess
Replies: 23
Views: 20189

Re: LuaPreprocess

I see, thanks for the clarification.
by pgimeno
Wed Jan 13, 2021 1:36 pm
Forum: Libraries and Tools
Topic: LuaPreprocess
Replies: 23
Views: 20189

Re: LuaPreprocess

I don't understand the difference between these two:

Code: Select all

!!local TWO_PI = 2 * math.pi

local TWO_PI = !(2 * math.pi)
Can you explain? I'm having trouble understanding why !! is necessary or convenient.
by pgimeno
Wed Jan 13, 2021 2:21 am
Forum: Games and Creations
Topic: Flatland: Another Perspective
Replies: 7
Views: 665

Re: Flatland: Another Perspective

I mean that I've changed line 19 of Pane.lua, adding this before: print("ok", width*canvasScale, height*canvasScale) and this after: print("ok2") As you can see above, for the last line the "ok" is printed but the "ok2" is not, meaning that the canvas creation line is the line where it is crashing. ...
by pgimeno
Tue Jan 12, 2021 3:25 pm
Forum: Games and Creations
Topic: Flatland: Another Perspective
Replies: 7
Views: 665

Re: Flatland: Another Perspective

You can run .exe files as if they were .love files; just run: love FlatlandAnotherPerspective_PREALPHAx32.exe In my case, it aborts with no errors when creating a canvas, in Pane.lua line 19. If I surround it with prints, the first print comes out but the second one doesn't. I've printed the sizes, ...
by pgimeno
Tue Jan 12, 2021 11:57 am
Forum: Libraries and Tools
Topic: SUPER STRICT for LUA
Replies: 20
Views: 1121

Re: SUPER STRICT for LUA

This turns out to be a difficult issue. I don't know if we can catch these cases using pattern matching. The parser can now handle up to 3 equal signs but we will need a better solution in the long term. They need special separate treatment. For example: local startstring, laststart = script:find("...
by pgimeno
Tue Jan 12, 2021 11:23 am
Forum: Support and Development
Topic: is socket.http slow?
Replies: 2
Views: 135

Re: is socket.http slow?

I get a pretty stable 334 ms when querying http://example.com. By the way, socket includes a gettime() function with sub-second precision: local url = 'http://example.com' local gettime = require 'socket'.gettime local conn = require 'socket.http' local start = gettime() local r, s = conn.request(ur...
by pgimeno
Mon Jan 11, 2021 9:27 pm
Forum: Libraries and Tools
Topic: SUPER STRICT for LUA
Replies: 20
Views: 1121

Re: SUPER STRICT for LUA

I have changed the following patterns: hexp = "0x%x+[Pp][%-%+]?%x" float = "%d*%.%d+[Ii]?" The x can also be upper and lower case (same as in integers, by the way). The exponent can only be decimal digits. The pattern does not support decimal point in the mantissa, or more than one digit in the exp...
by pgimeno
Mon Jan 11, 2021 9:09 pm
Forum: Support and Development
Topic: Do memory pools actually work in love2D
Replies: 10
Views: 836

Re: Do memory pools actually work in love2D

It is normal that it fluctuates if you generate garbage. It isn't normal if you don't. We can't know if you do or you don't, but it seems you do, judging by the snippet I've posted above.