I’m porting a library of VPython functions to GlowScript and have discovered that apparently I can’t use arguments with default values in function definitions. Look at the following program:
http://www.glowscript.org/#/user/heafnerj/folder/My_Programs/program/mandipy3
If I write MakeCoordAxesAt() it works. If I write MakeCoordAxesAt(ctr=vector(1,1,1)) I get a popup error message
TypeError: undefined is not a function
Line 51:
Called from line 71:
But I can write MakeCoordAxesAt(vector(1,1,1)) to get the desired behavior. An obvious problem is that now I can’t supply non-default values for arguments because I can’t name the arguments in a function call. I also can’t specify any value for any argument beyond the first.
Am I overlooking anything?
Joe Heafner
Sent from one of my Macs