Search found 326 matches

by grump
Mon May 21, 2018 3:45 pm
Forum: General
Topic: Getting a project to work with moonscript 0.5.0-1
Replies: 11
Views: 248

Re: Getting a project to work with moonscript 0.5.0-1

Looks like there is an api to convert errors back. When you use moonscript's loadstring it actually populates a translation table, so in your error handler you can call the rewrite_traceback function from the moonscript.errors module . Thanks for the hint. rewrite_traceback returns nothing but nil....
by grump
Mon May 21, 2018 11:38 am
Forum: General
Topic: Getting a project to work with moonscript 0.5.0-1
Replies: 11
Views: 248

Re: Getting a project to work with moonscript 0.5.0-1

bartbes wrote:
Mon May 21, 2018 11:14 am
You can pass a filename (or any name) as second argument to loadstring.
Right, that kind of works - it's still printing bogus line numbers though. It's the line numbers from the transpiled file, not the source line numbers. Right back to square one, sigh.
by grump
Mon May 21, 2018 10:55 am
Forum: General
Topic: Getting a project to work with moonscript 0.5.0-1
Replies: 11
Views: 248

Re: Getting a project to work with moonscript 0.5.0-1

I can now successfully use moonscript with love, with the downside that I still don't getter proper error locations, because by using loadstring there are no filenames associated with error messages; all errors are shown as moonscript.loadstring as the error location. That makes debugging even more ...
by grump
Mon May 21, 2018 9:19 am
Forum: General
Topic: Getting a project to work with moonscript 0.5.0-1
Replies: 11
Views: 248

Re: Getting a project to work with moonscript 0.5.0-1

bartbes wrote:
Mon May 21, 2018 9:06 am
That kinds of makes me wonder what 'love11' refers to...
It's the 11.1-AppImage that I use so I can have both 11.1 and 0.10.2 installed.

Thank you for your help, I got it working now with the loader you provided.
by grump
Mon May 21, 2018 8:02 am
Forum: General
Topic: Getting a project to work with moonscript 0.5.0-1
Replies: 11
Views: 248

Re: Getting a project to work with moonscript 0.5.0-1

-- main.lua require('moonscript') require('game') -- game.moon package.path = package.path .. ';./?/init.moon' -- this seems to be required to make modules work require('module') love.draw = -> fn('hello') -- module/init.moon export fn = (x) -> love.graphics.print(x, 0, 0) Also, is your capitalizat...
by grump
Sun May 20, 2018 2:23 pm
Forum: Support and Development
Topic: get set vs properties, whether they are a good idea
Replies: 9
Views: 246

Re: get set vs properties, whether they are a good idea

I made a class implementation that supports properties via metatables. local Node = class { [...] alpha = class.property({ get = function(self) return self._color[4] / 255 end, set = function(self, value) self._color[4] = math.max(0, math.min(255, math.ceil(value * 255))) self:_invalidateColor() end...
by grump
Sun May 20, 2018 1:56 pm
Forum: Support and Development
Topic: [Solved]Stack overflow when detecting regions of a big tiled map.
Replies: 2
Views: 78

Re: Stack overflow when detecting regions of a big tiled map.

Stack space is limited. Running a recursive algorithm this many times can easily exhaust that space. AFAIK, LuaJIT does tail call optimization. Read up on that for a possible solution to your problem. I don't know whether it is applicable or not in your case though.

See here for more information.
by grump
Sun May 20, 2018 1:48 pm
Forum: General
Topic: Getting a project to work with moonscript 0.5.0-1
Replies: 11
Views: 248

Getting a project to work with moonscript 0.5.0-1

Anyone here know how to use moonscript with love? I have trouble getting a simple moonscript project to work. I've attached a zip file with two identical versions of example code: one is written in plain Lua, the other written in moonscript with a main.lua file that is supposed to bootstrap the moon...
by grump
Sat May 19, 2018 7:49 pm
Forum: General
Topic: Status of Multiplayer Mobile Networking
Replies: 19
Views: 469

Re: Status of Multiplayer Mobile Networking

Correct me if i'm wrong, since i don't do much android or ios development but, doesn't all officially supported löve platforms include all 3rd party libs? Enet and luasocket both should exist on the mobile platforms. One problem you have to deal with on mobile platforms, but not so much on PC, is r...
by grump
Sat May 19, 2018 6:48 am
Forum: Support and Development
Topic: Is asking for code review here in bad taste?
Replies: 6
Views: 244

Re: Is asking for code review here in bad taste?

I privately asked two experienced forum members for a review of ~200 LOC, and was pleasantly surprised by their willingness to help. They provided mostly suggestions to improve performance, semantics and style. Some bugs were missed by them, but that's understandable - a thorough code review takes t...