-
Notifications
You must be signed in to change notification settings - Fork 4
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
IE-0014: Inter names for rulebooks #14
Conversation
Possible alternative (since I just encountered some examples while hacking at Flexible Windows): In 9.3, given a kind of object and a property declared for that kind of object in the I7 source text, you could mix the two in a relatively nice way:
(Things were less nice for "either-or properties", since they'd already been hidden behind a function.) In v10, these things no longer work -- the (On that note, I was expecting But why? Why not detect these property read/write patterns and compile them to the needed internal function call without cluttering the source text with such details? Why require explicitly specifying an I6 identifier to "translate" or be "accessed" instead of just letting it pick something automatic from the I7 name? Why can't we have the 9.3 syntax back? Especially now that the I6 code is also compiled to Inter, it seems like it ought to be easy to detect a property read/write and translate it to a function call if that's needed. Alternatively, perhaps moving things even further to the I7 syntax -- the above could be rewritten as something like:
(Though the caveat with this last option is that the I6 has lost some of the value kind metadata, but perhaps there could be some kind of annotation for that.) |
I'm getting an error when trying to make a rule which is defined in I7 accessible to Inter.
Also it seems like there's no "accessible to Inter" option for phrases, is that correct? |
I think there are two different requests here. One is to make rule definitions accessible. That may be possible. The other, to do with phrases, probably isn't. (For named phrases, it might be.) The trouble is that phrases have all manner of implementations under the hood: some are inlined, some are polymorphic and are represented by multiple functions at runtime depending on the kinds of value they are applied to. So there's no such thing, exactly, as "the value at runtime of a phrase". |
Oh, I hadn't thought of polymorphism. That does complicate matters. But hopefully not too much, hopefully there's a subset of phrases which can be made accessible. Sometimes it's just much better to author code in I7, but we need to call that code from I6. If we absolutely needed to do that at present I guess we could make a rulebook with a single rule in it, but that's a little bloated, and restricts you to one parameter. (We could get around that restriction if necessary by setting global variables. Which should work fine enough, unless the code wants to be recursive...) If named phrases with no generic parameters could be made accessible I think those would be acceptable restrictions. As an example, Flexible Windows in 6M62 has this I6 function, which then invokes a bunch of quite involved I7 code, which would be much less elegant if it had to be converted to I6 code.
The handling an unscheduled construction phrase could be converted to I6 easily enough (especially now with kit defined enums), but the open up and calibrate phrases use one of those most beautiful I7 features, descriptions. They would be real hard to convert to I6. |
Summary
A purely additive change to the
translates into Inter as...
sentence syntax,allowing explicit Inter identifier names to be assigned to be rulebooks and
activities created in source text. In particular, this allows kits to access
rulebooks and activities created in extensions.