Skip to content
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

Public API incomplete - test case provided #40

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

@Vithanco
Copy link

@Vithanco Vithanco commented Mar 27, 2020

Hi John, Hi Contributors,

great framework. Thanks a lot.

I intend to create a DSL for SVG, to be used in my software (Vithanco). I don't think that we want to have all new DSLs to be part of the Plot code itself. So, I am creating a separate plotSVG library which is using and extending Plot.

However, it looks like that the Public API is incomplete (clearly, my understanding is still growing). The public API doesn't seem to allow me to create the root element The inbuilt DSLs are using an internal API, based on the internal data type AnyNode, by instantiating the struct Element directly. For the public API the static func named is available, but for some odd reason Node<Context> cannot be converted to Node<Any> (See as well: https://stackoverflow.com/questions/60876187/how-to-convert-from-nodexxx-to-nodeany).

I am not yet ready to create a solution myself, but I believe that I could capture the problem in a few lines of code that are now part of the test case that is part of this pull request. I hope it makes sense.

Cheers,
Klaus

@Vithanco
Copy link
Author

@Vithanco Vithanco commented Mar 27, 2020

Test fails - the public API is incomplete therefore the tests have to fail.

@Vithanco
Copy link
Author

@Vithanco Vithanco commented Apr 22, 2020

I suggest to change the Element function to
static func named<C>(_ name: String, nodes: [Node<C>]) -> Element { Element(name: name, nodes: nodes) }
However, it breaks some formatting test cases.

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