thi-ng / umbrella

⛱ Broadly scoped ecosystem & mono-repository of 199 TypeScript projects (and ~180 examples) for general purpose, functional, data driven development
https://thi.ng
Apache License 2.0
3.38k stars 150 forks source link

@thi.ng/shader-ast-stdlib The `worley2` HOF doesn't provide a way to change the name in generated code #399

Closed JeffreyPalmer closed 1 year ago

JeffreyPalmer commented 1 year ago

I'd like to be able to use both worleyDist and WorleyDistManhattan in the same program, but when I attempt to do so the generated code results in this error:

Uncaught Error: WebGL: Error compiling shader:
line 76: 'worley2' : function already has a body

I see that the additive HOF provides a way to override the name used in the generated code - perhaps we could do the same here?

(If there's a technique to avoid this, please let me know.)

postspectacular commented 1 year ago

Thanks @JeffreyPalmer - I updated all higher order functions in this package and will do a new release later today...

postspectacular commented 1 year ago

Just a heads up, @JeffreyPalmer that I did release the fix last night. Let me know if this helps and thanks again for reporting! :)

JeffreyPalmer commented 1 year ago

Thanks @postspectacular! I saw that and have already incorporated the change in my code. Everything is working perfectly. 🙏