Model interface
See original GitHub issueIn order to make the query API much more awesome, I would like to introduce the following interface to ceylon.language.meta.model
:
shared interface Model<Parent,Result>
given Result<T> {
shared Result<Type> get<Type>(Attribute<Parent,Type> attribute);
}
Then, we would change the typechecker so that any member expression like person.name
where person
is a Model<Person,Expression>
would be desugared to:
person.get(`Person.name`)
(In the query API, I would declare From<T>
to satisfy Model<T,Expression>
.)
As a second phase, we can also figure out some way to support basic operators like ==
, !=
, <
, >
, <=
, >=
, &&
, ||
, !
, +
, -
, *
, /
at the Model
level.
There is one big problem with this otherwise-rather-simple proposal: the JVM backend doesn’t yet support type constructors, which is, AFAICT, essential to this proposal.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Spring MVC Model Interface - Javatpoint
In Spring MVC, the model works a container that contains the data of the application. Here, a data can be in any form...
Read more >Spring MVC - Model Interface - GeeksforGeeks
Spring Framework provides an Interface called Model(I) to work with the data. It defines a placeholder for model attributes and is primarily ...
Read more >Overview: Creating model interfaces - isee systems
A model interface allows your model's users to interact with the model by changing model inputs, running the simulation, and viewing its output....
Read more >Model (Spring Framework 6.0.2 API)
Interface that defines a holder for model attributes. Primarily designed for adding attributes to the model. Allows for accessing the overall model as...
Read more >Open Model Interface Provides Standard for Advanced SPICE ...
OMI allows circuit designers to simulate and analyze such important physical effects as self-heating and aging, and perform extended design optimizations. It is ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
An alternative syntax would be:
With this proposal, the following query:
Would simplify to:
Which is much better.