Skip to content

Conversation

nrc
Copy link
Contributor

@nrc nrc commented Sep 11, 2025

This is a WIP progress, the basic shape is there, but there are some issues to resolve. Essentially a function value in memory gets a Vec of function definitions rather than a single one.

The motivation is to have a nice way to handle functions like line and arc for both sketch mode 1 and 2. In theory, which you get could depend on the sketch if that was the first argument, but in practice an even easier overloading is that we distinguish between there being an input argument and there not being one (sketch mode 1 has one, v2 does not).

The complications are: handling multiple function definitions in our docs and for IDE stuff like hover and autocomplete, also since we're doing mutation of the value in memory, we need to interact with the epoch systems of program memory and check that function is defined at the point of call. These are both definitely solvable, but make this solution harder than otherwise.

I think, on balance, it is probably not worth finishing this work and a more ad-hoc versioning thing might be easier (e.g., special-casing the sketch2 module inside sketch blocks). But I'm sharing this branch in case y'all decide this is the best approach.

Signed-off-by: Nick Cameron <[email protected]>
Copy link

vercel bot commented Sep 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
modeling-app Error Error Sep 11, 2025 9:19pm

@nrc
Copy link
Contributor Author

nrc commented Sep 11, 2025

cc @jtran @adamchalmers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant