|
Goombert
|
|
Reply #1 Posted on: October 07, 2014, 08:29:31 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Can you show me a code example sorlok? I am a tad confused by what you mean.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|
Goombert
|
|
Reply #3 Posted on: October 07, 2014, 08:38:14 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Oh wow, I am not sure you'll have to ask Josh about that one. I'll forward this to him.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|
Josh @ Dreamland
|
|
Reply #5 Posted on: October 08, 2014, 06:27:15 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
When I wrote var, I had the sense to want to keep the matrix kernel modular, but lacked the sense to do it right. It uses placement new so that the main var class doesn't have to know anything about the type it's storing, which is itself just a pointer. You could easily refactor it so that the lua_table just works with the values data pointer directly, instead of pretending to own it. At this point, I don't even really care if you want to just move the lua_table code into var. If you want to do that refactoring, feel freeāit might even speed up var arithmetic because the compiler will be more confident in its optimizations.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
Josh @ Dreamland
|
|
Reply #7 Posted on: October 11, 2014, 08:48:25 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
The arrays problem in ENIGMA is that variables of type var, when accessed using [], must be encoded using (), because otherwise 2-D access using commas is not supported. Basically, [snip=edl]my_var[1,2][/snip] goes in, [snip=cpp]my_var(1,2)[/snip] comes out. ENIGMA's current type coercion is woefully inadequate, and as a consequence, this ends up happening for all arrays. So only var arrays work. A quick band-aid on this is to only make that replacement when a comma is detected outside of parentheses inside the brackets.
The lua_table implementation is fine. All it does is keep a dense portion and a sparse portion of an array of whatever object type you give it. It's pretty inefficient for one-dimensional access... I should do something about it.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
|