@Simeon, sorry, I was away for two days at a wedding. I’m cleaning up the project a bit, and when that is done, I’ll email you a zip file of the project, hopefully tomorrow.
@Simeon, Okay, never mind. I figured it out… and, as my 50 years has taught me, no, it’s not a compiler bug (“black box” syndrome is my name for it, when people get frustrated, they eventually decide the bug must be in the “black box”, i.e. whatever part of the software they can’t open and examine).
What happened is that I would call:
Operation(operator, stack:pop(), stack:pop() )
for a binary operator, or
Operation(operator, stack:pop() )
for an unary operator (expecting the third parameter, which is the second compiled operand, to be nil).
My stack:pop() method actually returns two values (for my convenience), the popped item, and then whatever item is the new top-of-stack. This way, I could do something like popped, tos = stack:pop(). But when I call Operation(operator, stack:pop()) with two or more items on the stack, it is in fact returning and then passing both values to Operation:init(), even though my code makes it look like it is one, so what I’m really passing is the operator, the popped item, and the new top of stack, i.e. the top two items on the stack. This is fine if the stack only has one item on it, because then the second item is nil (no new top of stack value).
So I “outsmarted myself” by returning two values (for different purposes), rather than using a straightforward, two statement popped = stack:pop() then tos = stack:peek() approach.
Of course, I also got the right values in my two pop call… because Lua only packs multi-value returns into the last parameter in a parameter list, so the extra values are (accidentally) ignored in the two-pop case.
It always helps to understand how a language works, but Lua is odd in that it’s really, really necessary because it has so many special constructs and edge cases in behaviors around those constructs.
Sorry for the alarm and confusion.
@blacatena that’s a subtle bug! Thanks for sharing your discovery. Agree that the explicit stack:pop / peek is probably the safer route
@Simeon I love the in-project asset viewer and I love that it does the thing @dave1707 suggested and the copy-asset-name thing works great on iPad.
It doesn’t seem to work on iPhone though—did you want it to?
@UberGoober I tried the copy/paste on my iPhone 8 SE and it worked OK. I was able to paste it without any problems.
Hm maybe I’m missing an update.
@Simeon there seems to a janky interaction between the icons created by the icon button and Craft. In attached screenshot you can see that the icon has rendered itself almost totally white.
I’m unable to add images into my project’s assets folder. It looks like it’s loading them, because the window appears where I can type a name in, but when I tap ‘done’ it is nowhere to be seen.
@UberGoober thanks for the report! Will check the adding to project folder one first as that seems like the worse bug
@UberGoober - saw the icon issue whilst saving one in this version. In my case looks like only partially bleached out. Almost like a layer problem.
But the icon itself, in my project list, is fine. So @Simeon is right - only minor issue but needs adding to the list.
@Simeon everything seems to work nicely now. Say, since you’re working on the contextual menu in the assets list right now, any chance we could get a “rename” option in it?
@skar the latest beta allows you to create subfolders within assets in a project. Let me know how it goes for you
@Simeon Version 300. Creating a sub folder within a project folder works, but I can’t seem to add a sprite to that sub folder. Whenever I select a sprite and select add-to and select the project folder, it adds it there and doesn’t give me a chance to select the subfolder.
@Simeon - version 3 hung up on me. Couldn’t get the run button to work, project just froze on me.
@dave1707 did you go into the folder (tap on it) then create the sprite inside the folder?
@Bri_G is it doing this consistently? All projects or just a specific one?
@Simeon Here are the steps I’m trying to do to add a sprite to a subfolder.
create a project
tapped Assets from Do list
tapped on the Project Assets folder
created a new Folder
tapped on Assets (upper left of screen)
selected Planet Cute from list of assets
tapped edit (top of screen)
selected a sprit (shows a checkmark)
hide the keyboard
tapped on Add To (bottom of screen)
tapped on the Project Assets folder
list of sprites is shown again
at this point, the sprite was added to the Project folder.
there is no way to get to the subfolder to add it there.
is there another way this is supposed to be done.
Ah I see, good point @dave1707
I’m not sure which direction to go here, the “Add To” UI is pretty clunky and old fashioned. Perhaps we should get rid of it all together. I wonder if just supporting drag-and-drop to copy / move assets would be the way to go. Alternatively I could update the “Add To” UI to support browsing sub-folders. I’ll think on it some more
At this time the only way to add a sprite to a folder is to import it from within the folder
@Simeon - I’ve seen the issue in other recent updates to Codea, but can’t remember what I was coding in then. I suspect it’s the same project though and am wondering if it’s related to calling socket for timing. Will see if I can reproduce and feed back later.
@Simeon I wish I could reproduce this bug, but I can’t, but it just happened to me a couple times in a row: when trying to use voice-to-text to put a comment in my code, it kind of freaked out. Voice-to-text crashed and went back to the normal keyboard, some weird combination of what I had dictated and the line below it got inserted in place of my code, and the cursor jumped to the very top of the file.
@Simeon - reported a crash after playing with my lates NoNo, then losing the magnetic cover on my iPad whilst Codea running. Then opened cover later and Codea crashed. Just after dragged up to see if still present and Codea window scrolled up and off. Is Codea set up for the magnetic catch iPad sleep mode?