Glowscript 3.1 and 3.2 bug

17 views
Skip to first unread message

Kevin Goldstein

unread,
Sep 22, 2022, 3:17:43 AM9/22/22
to Glowscript Users
I seem to be getting a strange bug with functions involving vectors with Glowscript 3.1 and 3.2 

See this code

In the code, the function involving vectors produces the output
[object Promise]
when printed.

If I run the same code under  Glowscript 3.0 


I get the expected output, so this seems to be a Glowscript 3.1 and 3.2 issue.


Joe Heafner

unread,
Sep 22, 2022, 6:15:49 AM9/22/22
to glowscri...@googlegroups.com
Note that dot() is already defined internally. Do you get the same error if you don’t try redefining it?

Joe Heafner
Sent from my iPhone

On Sep 22, 2022, at 03:17, Kevin Goldstein <parkto...@gmail.com> wrote:

I seem to be getting a strange bug with functions involving vectors with Glowscript 3.1 and 3.2 
--

---
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 on the web visit https://groups.google.com/d/msgid/glowscript-users/3a0ba835-a76d-4419-b5a0-c1ba9314c14en%40googlegroups.com.

Kevin Goldstein

unread,
Sep 22, 2022, 6:49:39 AM9/22/22
to glowscri...@googlegroups.com
Great - thank you - I hadn't realised that dot was internally implemented.
If I call the function something else, the error disappears.
> To view this discussion on the web visit https://groups.google.com/d/msgid/glowscript-users/F0F728CA-0794-4B24-99CB-83E64BBDFFB6%40gmail.com.

Joe Heafner

unread,
Sep 22, 2022, 2:52:54 PM9/22/22
to glowscri...@googlegroups.com
Excellent. The Help facility documents pre-existing functions such as dot() and cross().

Joe Heafner
Sent from my iPad

> On Sep 22, 2022, at 06:49, Kevin Goldstein <Kevin.G...@wits.ac.za> wrote:
>
> Great - thank you - I hadn't realised that dot was internally implemented.
> To view this discussion on the web visit https://groups.google.com/d/msgid/glowscript-users/CAL_sXd634q9hinGpus9j2aww%2BzUaicev9VbRApWJvgBv%3DHd_Jg%40mail.gmail.com.

Bruce Sherwood

unread,
Sep 22, 2022, 2:57:27 PM9/22/22
to Glowscript Users
In most cases it's fine to redefine a function, but the vector dot() function is used internally as well as being available externally.

Bruce

Reply all
Reply to author
Forward
0 new messages