发明申请
US20070028212A1 Extending expression-based syntax for creating object instances
有权
扩展用于创建对象实例的基于表达式的语法
- 专利标题: Extending expression-based syntax for creating object instances
- 专利标题(中): 扩展用于创建对象实例的基于表达式的语法
-
申请号: US11193584申请日: 2005-07-29
-
公开(公告)号: US20070028212A1公开(公告)日: 2007-02-01
- 发明人: Henricus Meijer , Anders Hejlsberg , Matthew Warren , Luca Bolognese , Peter Hallam , Gary Katzenberger , Dinesh Kulkarni
- 申请人: Henricus Meijer , Anders Hejlsberg , Matthew Warren , Luca Bolognese , Peter Hallam , Gary Katzenberger , Dinesh Kulkarni
- 申请人地址: US WA Redmond 98052
- 专利权人: Microsoft Corporation
- 当前专利权人: Microsoft Corporation
- 当前专利权人地址: US WA Redmond 98052
- 主分类号: G06F9/44
- IPC分类号: G06F9/44
摘要:
Syntax for creating object instances utilizing expressions instead of statements. A syntax component facilitates extension of conventional object-creation-expression syntax. An initializer component provides for initialization of a newly-created entity via object and collection initializers. The initializer component provides initialization of the newly-created entity utilizing an object initializer where the object initializer specifies values for one or more fields or properties of the newly-created entity which is an object, and consists of a sequence of member initializers enclosed by tokens and separated by commas. The initializer component can also provides initialization of the newly-created entity utilizing a collection initializer when the underlying object implements a certain interface or implements a certain pattern. An overloading constructor can be called as part of the initialization process. In another aspect, code inferencing is disclosed whereby given a type, the corresponding code can be inferred by the compiler and inserted for compiling by a compiler.