differences between 2.7 and 3.0

29 views
Skip to first unread message

Michael Burns-Kaurin

unread,
Apr 28, 2025, 10:53:30 AMApr 28
to Glowscript Users
I ran across an old program written in 2.5, works okay in 2.7, but not 3.0.  Is there a list of changes for 3.0?

Thanks.

Michael Burns-Kaurin

Bruce Sherwood

unread,
Apr 28, 2025, 12:49:36 PMApr 28
to Glowscript Users
It would be difficult at this late date to figure out what the difference is between 2.7 and 3.0, but it might be possible to deduce something if we see the program.

Bruce

Michael Burns-Kaurin

unread,
Apr 28, 2025, 3:40:26 PMApr 28
to glowscri...@googlegroups.com

On Mon, Apr 28, 2025 at 12:49 PM Bruce Sherwood <bruce.s...@gmail.com> wrote:
It would be difficult at this late date to figure out what the difference is between 2.7 and 3.0, but it might be possible to deduce something if we see the program.

Bruce

--

---
You received this message because you are subscribed to the Google Groups "Glowscript Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glowscript-use...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/glowscript-users/9146035d-0098-4e53-b868-d8139056037cn%40googlegroups.com.

Max DeMarr

unread,
Apr 29, 2025, 8:04:36 AMApr 29
to Glowscript Users
This was indeed a difficult change to pinpoint. I have found that there is an issue with how RapydScript is handling stored function pointers and promise returns. However, I am not super familiar with promises in JavaScript, so I can only suggest a workaround. Your "funcKnotList = [sheet_bend]" on line 225 and how you are using it in the code for the start button is perfectly Pythonic and would work in regular Python environments. Instead of properly returning the path list as it should, from the "sheet_bend" method, it now returns some kind of Promise.

As a cheap band-aid solution, you can simply write the "path" variable as a global variable, as you do with some others. You will need to initialize "path = [ ]" somewhere and implement the following changes:

add "global path" to line 35
remove the "path" parameter being passed in the "sheet_bend" method on line 34.
on line 172, simply call "funcKnotList[selected]()" without passing "path" to the method. 

Best,
- Maximillian

Michael Burns-Kaurin

unread,
Apr 29, 2025, 8:15:40 AMApr 29
to glowscri...@googlegroups.com
Wow, thanks.  I'll try that out, it should be fairly straightforward.  Not sure in fact why I did what I did.

Michael Burns-Kaurin

unread,
Apr 29, 2025, 9:11:28 AMApr 29
to glowscri...@googlegroups.com
I also had to eliminate having path passed out of sheet_bend and simply call funcKnotList[selected]() without having path = to its left (which was implied in what you said).  Now the trimmed version works, time to test in the full program.

Thanks again.

Harlan Gilbert

unread,
Apr 29, 2025, 10:47:48 AMApr 29
to glowscri...@googlegroups.com
There are other threads where problems between asynchronous functions are being noted.



--
Harlan Gilbert, Ph.D.
High School Math, Physics, Computer Science, and Philosophy Teacher
Collegium Chair
Green Meadow Waldorf High School
Chestnut Ridge, NY 10977
Reply all
Reply to author
Forward
0 new messages