[0.9.0] Added limited table support to Channel:push?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
[0.9.0] Added limited table support to Channel:push?
What does limited table support mean in regards to capabilities?
- slime
- Solid Snayke
- Posts: 3144
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: [0.9.0] Added limited table support to Channel:push?
Simple tables can be copied (not referenced) between threads.
Keys and values which are numbers, strings, booleans, or references to love objects will be copied. Functions and tables inside tables won't.
Keys and values which are numbers, strings, booleans, or references to love objects will be copied. Functions and tables inside tables won't.
Re: [0.9.0] Added limited table support to Channel:push?
Why not use recursion on tables inside tables and assume the user will treat it gently, i.e. not use table loops or other shenanigans?slime wrote:Simple tables can be copied (not referenced) between threads.
Keys and values which are numbers, strings, booleans, or references to love objects will be copied. Functions and tables inside tables won't.
Other than that it sounds awesome
Re: [0.9.0] Added limited table support to Channel:push?
In the event that some asshole decides to do something like this:
That'll be a nice loop you can sort yourself out of there.
EDIT: I'm joking, for the record.
Code: Select all
tab = {}
tab[tab] = tab
EDIT: I'm joking, for the record.
Last edited by Kingdaro on Sat Jul 20, 2013 7:25 am, edited 1 time in total.
Re: [0.9.0] Added limited table support to Channel:push?
Why not just let those assholes deal with them being assholes to themselves? Regular people don't do this kind of crap and therefore won't encounter looped references in tables. I mean, who cares about those retards who do that. Besides, you can make some degree of foolproofing (though that goes against Lua's philosophy), but idiotproofing is meaningless: idiot can always find a way to break it.
Like I said, why bothering over getting invalid code to run if you don't expect it to run in the first place?
Like I said, why bothering over getting invalid code to run if you don't expect it to run in the first place?
Re: [0.9.0] Added limited table support to Channel:push?
But having storing a table within itself is not invalid code in any other LÖVE context, so why should it be one here?raidho36 wrote:Why not just let those assholes deal with them being assholes to themselves? Regular people don't do this kind of crap and therefore won't encounter looped references in tables. I mean, who cares about those retards who do that. Besides, you can make some degree of foolproofing (though that goes against Lua's philosophy), but idiotproofing is meaningless: idiot can always find a way to break it.
Like I said, why bothering over getting invalid code to run if you don't expect it to run in the first place?
I'm actually sort of against any table support that isn't complete, mostly because the rules it places on those tables has to be a bit arbitrary, which can be confusing. It doesn't feel very "clean".
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Re: [0.9.0] Added limited table support to Channel:push?
Because that's how it works? Really though, tables should be referenced rather than copied.But having storing a table within itself is not invalid code in any other LÖVE context, so why should it be one here?
Then think of them as arrays of data rather than actually a tables.It doesn't feel very "clean".
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: [0.9.0] Added limited table support to Channel:push?
It's trivial to write a deepcopy that deals with cycles in Lua. It might not be that simple to write an implementation that does the same trick across threads.
Who knows, maybe full table support to Channel:push for 0.9.1? I might implement it myself*, and finally contribute something substantial to el engine.
* Hah, as if!
Who knows, maybe full table support to Channel:push for 0.9.1? I might implement it myself*, and finally contribute something substantial to el engine.
* Hah, as if!
Help us help you: attach a .love.
Re: [0.9.0] Added limited table support to Channel:push?
raidho36 wrote:Why not just let those assholes deal with them being assholes to themselves? Regular people don't do this kind of crap and therefore won't encounter looped references in tables. I mean, who cares about those retards who do that.
Code: Select all
_G._G
Re: [0.9.0] Added limited table support to Channel:push?
Good one, Xgoff. Not that anyone would pass root table to the thread, which would mean copying entire thing minus locals.
Who is online
Users browsing this forum: No registered users and 1 guest