-
-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SILE.scratch.headers
shouldn't be declared only in twoside
?
#2086
Comments
Also: "scratch" variables ought to get killed :) |
Wow, so the refactoring is bigger than I thought... What's going to be in its place? Can't we do anything with them for now?
I'll take a look over this. |
Package A or class C tinkering with scratch variables from package B breaks all separation of concerns and deeply ties the implementations, making the scratch variable a part of the public API of a package, that any "equivalent" replacement would have to honor (beyond just providing commands). So the concept is somewhat defective by design.
Aside note: I have (partly) solved some of my concerns with my resilient.book class and my resilient.headers package -- though I know they still have some of above-mentioned issues regarding proper separation of concerns. |
Now I got it, but what's going to replace all those scratch variables? |
I'm afraid it's a case by case basis, due to the different use cases for them, and the lack of global styling approach in the core distribution. |
See also #1417 In many cases indeed, private members of the package might be a better approach. |
Yes, all Taking steps towards that by only defining variables where they are used is good, and it's only a short step from there to properly scoped variables that go with the class/package/document/whatever. We still have some setting scope stuff to deal with, but class and package scopes that have getters and setters on anything that needs external access and internal local variables for everything else covers most use cases I've run into. |
Just now I got:
Error: runtime error: /usr/local/share/sile/packages/twoside/init.lua:123: attempt to index field 'headers' (a nil value)
Well, since this table is only used by
twoside
dependents, it should be declared there instead of having to declare whenever one creates a new class/package that relies on it.The text was updated successfully, but these errors were encountered: