-
Notifications
You must be signed in to change notification settings - Fork 336
NEW: for..of iterator for CPDictionary #3113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NEW: for..of iterator for CPDictionary #3113
Conversation
daboe01
commented
Jun 11, 2025
|
Milestone: Someday. Label: #new. What's next? A reviewer should examine this issue. |
|
Excellent work! I have some suggestions. As you place the iterator on the I propose something like the following: This will use Lastly we should have some test cases in CFDictionaryTest.j |
|
Milestone: Someday. Labels: #needs-review, Objective-J. What's next? This issue is pending an architectural or implementation design decision and should be discussed or voted on. |
|
Milestone: Someday. Labels: #ready-to-commit, Objective-J. What's next? The changes for this issue are ready to be committed by a member of the core team. |
|
This is good now but I think we should have the iterator in CFDictionary. That means we need to add it in the Objective-J library in the runtime too. I will check how we can do this. I would like to just have one source for the Objective-J library but that might have to wait. |
|
Milestone: Someday. Labels: #needs-improvement, Objective-J. What's next? The code for this issue has problems with formatting or fails a capp_lint check, has bugs, or has non-optimal logic or algorithms. It should be improved upon. |
|
@mrcarlberg CFDictionary lives in another repo, so IMHO we can merge this now and fix it in the other repo independently. |
should i copy the function into Objective-J/CFDictionary.js (in this repo)? |
|
My understanding is that the Objective-J is made for the Browser in the Cappuccino project. If you don't add the function you will not be able to use it when running in the Browser. The Objective-J in the obj-runtime is only for NodeJS. This is not perfect as we have it in two places but as it is right now. |
have a look at #3126 |
|
Yes, but where is the Browser version of the Objective-J framework built? It is not built in the obj-runtime as it will only build the NodeJS version. I believe that If you don't add the generator function here you will not be able to use it in the Browser. It is added in the obj-runtime so the automatic test will work now. |
excellent point! i will test this and let you know. |
|
in this branch, CPDictionary works in the browser |
|
Yes, because you have added the generator function in the |
|
i am not surprised by this observation as cappuccino still 100% works in the browser without all the stuff in the Objective-J directory (see #3126). The source of the runtime for the browser must be located somewhere else (IMHO). |
|
could it be that the 'real' stuff is in node_modules/@objj/runtime/Objective-J/Browser ? if so, where is this coming from? |
|
For me this is working! I get the three alerts when I run your Regarding #3126, I don't believe that your assumptions are correct. The only place the Browser version of the Objective-J framework is built is in the Cappuccino project. |
|
|
|
jake install gives me fresh files in cappuccino/dist/cappuccino/Frameworks and cappuccino/dist/objective-j/Frameworks/Objective-J however, when running jake install in the branch from this PR, cappuccino/dist/objective-j/Frameworks/Objective-J/Objective-J.js does not contain "function*" (as it shoud from the changes in Objective-J/CFDictionary.js in this PR) |
|
I searched for "Symbol.iterator" and I found it on |
|
indeed, it is in dist/objective-j/Frameworks/Debug/Objective-J/Objective-J.js |
|
It is in my
|
|
mine is ...Symbol&&(et[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===w.eof,value:t}}}}),et.nextToken... |
|
I have that function too in my file but I also have the generator function for You can also check the file in the build folder: Should be here: |
|
daboe01@MacBook-Pro-9 cappuccino % ls -la dist/objective-j/Frameworks/Objective-J/Objective-J.js both Debug/Objective-J/Objective-J.js and Objective-J/Objective-J.js seem to be updated at the same time. |
|
this is how my build log looks like: daboe01@MacBook-Pro-9 cappuccino % jake install |
|
It is very strange that your build folder is not updated. Have you tried to delete the build folder and rebuild? |
|
excellent suggestion! removing Build followed by jake install makes this PR eventually work for me :-) |
|
from my side this is ready now. |
|
I have one minor issue left. The function just above your iterator generator function is a |
|
Thanks! Excellent! Merged! |