Search found 76 matches

by spir
Sun Nov 18, 2012 11:58 pm
Forum: Support and Development
Topic: [solved] Error: attempt to yield across ...
Replies: 4
Views: 2687

Re: Error: attempt to yield across metamethod/C-call boundar

bartbes wrote:Well, the error basically says what you're doing wrong, you're trying to yield from within a function called from c++ (a physics callback?) or from within a metamethod (like __index).
Found my error, was a wrong usage of the coroutine. Thank you for the help,
Denis
by spir
Sun Nov 18, 2012 11:54 pm
Forum: Support and Development
Topic: [solved] Error: attempt to yield across ...
Replies: 4
Views: 2687

Re: Error: attempt to yield across metamethod/C-call boundar

Well, the error basically says what you're doing wrong, you're trying to yield from within a function called from c++ (a physics callback?) or from within a metamethod (like __index). Right, but isn't everything called from C when I use Löve? The yielding func in question does about nothing (i redu...
by spir
Sun Nov 18, 2012 8:47 pm
Forum: Support and Development
Topic: [solved] Error: attempt to yield across ...
Replies: 4
Views: 2687

[solved] Error: attempt to yield across ...

Is it at all possible to use coroutines with Löve? (I was trying a coooool way to manage processes / sequences of actions that still need to be controlled by events, without loads of state everywhere). I cannot succeed in running (or rather come back from) even the simplest co. I need to know whethe...
by spir
Sat Nov 17, 2012 11:59 am
Forum: Support and Development
Topic: Share your favourite helper functions
Replies: 48
Views: 16384

Re: true escaped quoted string?

So: I think your function string.quoted is really useful, and if you write a function that writes out tables, be sure to use string.quoted on string keys and values, but you shouldn't change the behaviour of standard library functions (especially not one as basic as tostring). Yo, I understand your...
by spir
Sat Nov 17, 2012 10:11 am
Forum: Support and Development
Topic: Share your favourite helper functions
Replies: 48
Views: 16384

Re: Share your favourite helper functions

So, implementing round(x) as floor(x+0.5) is wrong. Not necessarily . There are a lot of different rules for tie-breaking, and one is not necessarily "right" or "wrong". Thank you to bring the subject on the table, Robin. Can one point to a doc where is explained the reason for ...
by spir
Sat Nov 17, 2012 9:47 am
Forum: Support and Development
Topic: Share your favourite helper functions
Replies: 48
Views: 16384

Re: Share your favourite helper functions

EDIT2: But my dream tool func is rather: local x = 1 note(x) --> "x : 1" --> not just "1" Option: add in parens the func name and line number of the "note" statement: f = function (x) local x = 1 note(x) --> "x : 1 (f, 333)" end Those two aren't really possib...
by spir
Sat Nov 17, 2012 9:43 am
Forum: Support and Development
Topic: Share your favourite helper functions
Replies: 48
Views: 16384

Re: Share your favourite helper functions

So, implementing round(x) as floor(x+0.5) is wrong. Not necessarily . There are a lot of different rules for tie-breaking, and one is not necessarily "right" or "wrong". Thank you to bring the subject on the table, Robin. Can one point to a doc where is explained the reason for ...
by spir
Sat Nov 17, 2012 9:38 am
Forum: Support and Development
Topic: Share your favourite helper functions
Replies: 48
Views: 16384

Re: Share your favourite helper functions

That implementation of math.round on https://love2d.org/wiki/Additional_math is incorrect. Round(-1.5) == -2, as seen here: http://www.wolframalpha.com/input/?i=round%28-1.5%29 Floor(-1.5+0.5) == -1, as seen here: http://www.wolframalpha.com/input/?i=floor%28-1.5+%2B+0.5%29 So, implementing round(x...
by spir
Sat Nov 17, 2012 9:25 am
Forum: Support and Development
Topic: Share your favourite helper functions
Replies: 48
Views: 16384

Re: true escaped quoted string?

Your string.quoted looks good to me, although I don't know how efficient gsub over "." is. Yo, I'll change that (with a gsub mapping special chars, and another for the rest of those < 0x20). Two things: elseif c == '"' then return '\\"' You don't need the backslash there, and in...
by spir
Fri Nov 16, 2012 7:14 pm
Forum: Support and Development
Topic: tutorial on lua tables & data structures
Replies: 6
Views: 4043

objects....

Posted start of part about objects, with section on objects properly: source there (tutorial text still in wiki lang; and there is now a mini Löve app).

Denis