enkimute / ganja.js

:triangular_ruler: Javascript Geometric Algebra Generator for Javascript, c++, c#, rust, python. (with operator overloading and algebraic literals) -
MIT License
1.52k stars 107 forks source link

Non-vanilla algebra specification breaks the "run" button in the editor #134

Closed skydog23 closed 3 years ago

skydog23 commented 3 years ago

There is a standard syntax for specifying an algebra in ganja.js, e.g., "Algebra(2,0,1,()=>{...}) )".

I've noticed that non-standard algebra specifications, for example, this one for the 3-sphere

"Algebra({p:4,basis:Algebra(4,0,0).describe().basis},()=>{...})"

cause the "run" button in the ganja editor to break. The result is that the graphics window is replaced by text beginning:

"class Element extends generator { ..."

The work-around is to re-load the webpage rather than use the "run" button.

Example code: https://enkimute.github.io/ganja.js/examples/coffeeshop.html#7h5EXCzVd

enkimute commented 3 years ago

Resolved in https://github.com/enkimute/ganja.js/commit/39d0ccb4a958b5f817501b00100fd10b40f3e6fc