Unified Call Syntax: x.f(y) and f(x,y)
|
|
|
- Thomas Martin
- 10 years ago
- Views:
Transcription
1 Unified Call Syntax: x.f(y) and f(x,y) Bjarne Stroustrup Herb Sutter Abstract In Urbana, EWG discussed two proposals for generalizing/unifying the two function call notations x.f(y) and f(x,y). The papers are N4165: Herb Sutter: Unified Call Syntax N4174: Bjarne Stroustrup: Call syntax: x.f(y) vs. f(x,y) Our reading of the discussion is that the papers were seen as promising, but that there were concerns about compatibility in the case of Bjarne s paper. There were also a few questions about exactly where this call unification would be useful. This note discusses the motivation, considers a few alternatives, and presents a revised proposal. Briefly, x.f(y) will first look for members of x s class (as ever) and if no valid call is found will look for functions as if f(x,y) had been written. Conversely, f(x,y) fist looks for functions (as ever) and if no valid call is found looks for functions as if x.f(y) had been written. We handle p->f(y) and f(p,y) similarly. This proposal is backwards compatible (modulo SFINAE trickery, of course). Motivation Having two call syntaxes makes it hard to write generic code: which syntax can we assume from a template argument type? When we start writing concepts, we will either have to support both syntaxes (verbose, potentially doubling the size of concepts) or make assumptions about how objects of certain binds of types are to be invoked (and we may be wrong close to 50% of the time). Today, we already have the problem that many standard-library types are supported by two functions, such as, begin(x) and x.begin(), and swap(x,y) and x.swap(y). This is an increasing problem. The problem was solved for operators. An expression a+b may be resolved by a free-standing function operator(x,x) or a member function X::operator(X). The problem was solved for range-for by allowing both begin(x) and X::begin() to be found. The existence of two special-case solutions and a lot of duplicated functions indicate a general need. Each of the two notations has advantages (e.g., open overload sets for non-members and member access for members) but to a user the need to know which syntax is provided by a library is a bother. 1
2 Thus implementation concerns can determine the user interface. We consider that needlessly constraining. Concepts make this (well-known and long-standing) problem more acute by formalizing the requirements of generic components. Consider writing a concept for a container: template<typename C> concept bool Container = requires(c a, C b, int i) { { a[i] } -> typename C::value_type&; // [] must be member // (says the language { a==b} -> bool; // operator ==() can be a member or a // nonmember (says the language) { begin(a) } -> typename C::Iterator; // begin() can be non-member { a.begin() } -> typename C::Iterator; // begin() can be member { a.size() } -> int; // size() must be member // Consider c.size(). It must be a member function. This Container concept does not support size(c). Someone might define a size(x) for a type X, but callers of a template using a Container cannot rely on size(x) and neither can the implementers of a template function using Containers. This forces the use of x.size() even if size(x) is defined for X. If X is a type we cannot change, this is a serious problem because adding a member is an intrusive operation. This is the observation that has pushed STL-inspired libraries towards the use of free-standing functions. Consider the two requirements for begin(). We know that if we include <iterator> we can use begin(c) even for types that has only c.begin(), but the writer of Container cannot assume <iterator> for all uses, so to allow begin(c) for any type, it must require it for all types. What I wrote for size() constrains all users to use c.size() and all Container classes to implement a member size(). That is constraining on both users and implementers, and potentially intrusive on older container implementations. What I wrote for begin() gives users the freedom of choice between begin(c) and c.begin() at the cost of forcing every container writer the ensure that both are defined (somehow). As usual, a user of begin() has to make sure that the appropriate declarations are in scope. This could be difficult for pre-stl-style containers. For every function mentioned in a concept, we must either define it twice (as a member and a nonmember) or make a (semi-arbitrary) decision on which syntax is to be used. Note that this is not a problem with concepts. It has been a problem with templates since day #1. It is a problem of what users of a template can assume about the template definition and what a template implementer can require from users. We have always had concepts, but moving them from comments to a proper interface specification brings the problem out in the open. 2
3 Ideals We consider it ideal if both notations would have the same meaning. Ideally, that meaning would be the same as what we have for operators and for range-for. That way, there would be only one rule to learn and only one possible meaning of a concept. Unfortunately, this is not possible: Range-for uses the prefer x.begin() over begin(x) strategy (6.5.4 The range-based for statement [stmt.ranged]) Operator+ uses overload resolution to decide between operator+(x,y) and x.operator+(y) ( Operators in expressions [over.match.oper]) Similarly, having only one meaning for both call notations would make it impossible to achieve 100% backwards compatibility: Currently f(x,y) will not find a X::f(Y) x.f(y) will not find a f(x,y), including lambdas If we grant precedence to one resolution (e.g., prefer member over free-standing function, as done for range-for) or if we select based on overload resolution, we can easily construct examples that change meaning compared to status quo. For example: struct S { void f(int); void f(const S&, double); void f(s& s) { s.f(2.0); } f(s,2); // overload resolution would call free-standing f() // status quo will call the member // member-preference would call member // status quo will call the freestanding f() Herb s proposal addresses this problem by generalizing only x.f(y) to call f(x,y) if there is no match for x.f(y), but not generalizing f(x,y) to find a member function callable as x.f(y). This is too objectoriented for some people (including Bjarne). Many don t want to have to write x.sqrt() rather than sqrt(x), e.g., 2.sqrt(), and that s what we d all have to do in all generic code and all concepts to get the full generality that is the primary aim of these proposals. Please don t underestimate this problem: Bjarne received a fair amount of outraged mail from people who thought he had proposed that (and only that). Giving preference to x.f(y) encourages making functions members, thus increasing coupling. 3
4 A lambda passed as a template argument must be called using the f(x,y) notation. Not all opposition to x.f(y) is emotional and aesthetic. We should generalize both f(x,y) and x.f(y) and that the (possibly unachievable) ideal is that they should have the same meaning. Alternatives We see six alternatives: 1. Do nothing. That implies the complication of concepts and the continuing duplication of library functions. 2. Generalize only x.f(y) (to call f(x,y) if there is no valid resolution for x.f(y) as a member function). Herb s original proposal. That would leave us writing x.sqrt() for generality. 3. Generalize only f(x,y) (to call x.f(y) if there is no valid resolution for f(x,y) as a free-standing function). Nobody is proposing that; we mention it only for completeness. This would leave us writing draw(obj) for generality. 4. Prefer member functions over free-standing functions for x.f(y) and prefer free-standing functions over member functions for f(x,y). This is 100% compatible with current rules, but leaves operator+ as a special case. Also, from the point of view of a concept, x.f(y) and f(x,y) are not completely equivalent. Gaby mentioned this alternative in EWG in Urbana. 5. Use overload resolution to choose the best match from the set of free-standing and member functions. This is not 100% compatible with current rule, and leaves range-for as a special case (but we could possibly fix that). 6. Prefer a member function for both x.f(y) and f(x,y) notations. Bjarne s original proposal. This is the least compatible variant. [6] (two notations and one semantics) is the simplest and solves all problems with concept writing. We consider it reasonable to prefer member functions because they are the ones supplied by the designer of a type. It solves the concept writer s problem. It is not 100% compatible. [5] (overload resolution) is almost 100% compatible, and arguably the resolution is always better than what the current rules give. Some people have expressed concern about the potential size of the overload sets involved, but that s no different than for operator+, so this many not be a problem. [4] (two notations with precedence) is backwards compatible, but will make some concept writers list both alternatives to cope with rare cases. [3] (only generalize f(x,y)). would de-emphasize the OO notation and make it harder to provide online/ide support a la intellisence. [2] (only generalize x.f(y)) is too OO, encouraging increased coupling and discouraging lambdas. [1] (status quo) causes problems for programmers, notably for library writers. 4
5 Discussion points If we want 100% compatibility, we must choose [1], [2], [3], or [4]: [1] doesn t solve the problem [2] would de-emphasize the functional notation and encourage increased coupling. Concepts would be written x.f(y). [3] would de-emphasize the OO notation. We don t think anyone likes it as a C++ extension (even though it may be seen as ideal if we had no compatibility constraints). Concepts would be written f(x,y). [4] would give people a choice of notations. Since the notations would have slightly different meanings (to preserve compatibility) concepts will have to be written with a (slight) bias towards one notation or the other. [5] is a technically better solution than [4] in that it will give identical resolutions for both notations and arguably the technically best solution in all cases. It is what we currently do for operators. If we choose [5], we should consider changing the rules for range-for to get a uniform rule. [6] is (we think) a simpler solution for humans to fathom than [4]. It would lead to surprises (incompatibilities) only for people using the f(x,y) notation. And only for f(x,y) used where x.f(y) would give a different and inferior solution to f(x,y). Bjarne conjectures that this is very rare, but can t prove it. In cases [5] and [6] a compiler could warn if a function that would be invoked under current rules was not chosen. A major motivator for Herb (though not for Bjarnee) is to encourage the use of x.f(y) to make intellisence more effective. Herb points out the effectiveness of an IDE making suggestions based on x. compared to making suggestions based on f(. After x., a compiler can easily made a list of all possible member names that can appear after the dot. For f( a compiler must look through all active scopes to make a list of possible fs. To find the full set of alternatives, we need to know the full set of arguments to see if there are any candidate functions found by ADL. If no f is found after x.f( the compiler must look into the active scopes for an f (just like after a plain f(. In x.f(, x specifies an exact type, whereas in f(x,, x can be subject to conversions. Bjarne doesn t doubt that there is an advantage to intellisence nor that the advantage is most significant when using member functions. However, that also gives a bias towards an asymmetric notation specialized on the first argument ( the object is given a very special role). The implied encouragement to the use of member functions is a concern because it increases coupling. The prefix functional notation (e.g., f(x,y,z)) and suffix functional notation (e.g., (x,y,z).f) are general, but the infix object-oriented notation (e.g., x.f(y,z)) as specialized (and special purpose). We could generalize to allow f(x,y,z) and x.f(y,z) and (x,y).f(z) and (x,y,z).f) to address this (there is an example of that in D&E), but we don t propose to go that way; for starters, it would be confusing unless those 4 calls had identical meaning, but that can be achieved only by choosing an incompatible solution. 5
6 Should we get multimethods in the future, the x.f(y) notation will start to look even more special purpose. Thus deciding on x.f(y) only would close a promising evolution path. It has been conjectured that looking into a second scope would slow down compilation. It is not obvious that this slowdown would be significant (we already do it for operators). For [5] (overload resolution), the extra lookup would always happen. For [4] and [6] (relying on looking into one scope first), the cost would only be incurred when no match were found in the preferred scope. Questions 1. Do anyone have a tool that let us scan a large body of code to see whether the concern over non-compatible resolution is real? To get a real problem, we would need an x.f(y) and an f(x,y) and their meaning must be different. Most cases where I see such two functions, then have the same meaning. To do a perfect job, such a tool would need to be type sensitive and know the C++ lookup and conversion rules, but maybe a non-perfect approximation could give useful data. 2. If we consider the compatibility problem significant, is [4] (Prefer member functions over freestanding functions for x.f(y) and prefer free-standing functions over member functions for f(x,y).) sufficient for us to write concepts in terms on one call syntax only? 3. If we don t consider the compatibility problem significant, is [5] (overload resolution) or [6] (member preference) best? 4. Would it be enough to generalize only x.f(y)? Our best answers are we don t know, yes, we are not sure, and no. Suggested resolutions We consider solutions [4] (two notations with precedence), [5] (overload resolution), and [6] (two notations and one semantics) acceptable. Based on the discussions in Urbana, let us consider [4] as our initial solution: Prefer member functions over free-standing functions for x.f(y) and prefer free-standing functions over member functions for f(x,y). This is 100% compatible with current rules, but leaves operator+ as a special case. Also, from the point of view of a concept, x.f(y) and f(x,y) are not completely equivalent. Gaby mentioned this alternative in EWG in Urbana. This takes the compatibility issues off the table. Let us consider [5] (overload resolution), and [6] (two notations and one semantics) later if and only if we get evidence that the compatibility problems are negligible. Choice of function With [4] we have to look seriously at whether it solves the problem of supporting template interfaces (specified in terms of concepts). The meaning of f(x,y) and x.f(y) can differ, but will they in realistic examples differ in ways that will encourage template writers to define two functions in a concept? 6
7 Consider a general form of the problem: struct S1 { int f(int); struct S2 { int f(double); int f(s1,double); int f(s2,int); void use(s1 s1, S2 s2) { S1.f(2.8); f(s1,2.8); s1.f(2); f(s1,2); // prefer member: truncate // prefer nonmember // prefer member // prefer nonmember: promote to double } s2.f(2.8); f(s2,2.8); s2.f(2); f(s2,2); // prefer member // prefer nonmember: truncate // prefer member: promote to double // prefer nonmember This is obviously the exact behavior we have today. Hopefully, the truncations will yield warnings. The difference given uniform call syntax is simply that if we removed a member or a nonmember f(), the example would still compile and the meaning would be that of the now one and only f(). struct S1 { int f(int); struct S2 { // int f(double); // int f(s1,double); int f(s2,int); void use(s1 s1, S2 s2) { S1.f(2.8); f(s1,2.8); s1.f(2); // truncate // truncate 7
8 f(s1,2); } s2.f(2.8); f(s2,2.8); s2.f(2); f(s2,2); // truncate // truncate // promote to double // promote to double Again, we can hope for warnings against the truncations. So far, so good. We gained a bit of flexibility at no real cost. But how about templates? Consider: struct S1 { int f(int); struct S2 { int f(double); int f(s1,double); int f(s2,int); template<typename T> void use(t t) { t.f(2.8); // prefer member f(t,2.8); // prefer nonmember t.f(2); // prefer member f(t,2); // prefer nonmember } use(s1{}); use(s2{}); // exactly as S1 before // exactly as S2 before There are three ways the constrain T in use(t): Favor members Favor nonmembers Explicitly cater for both By commenting out a line or not, we can choose an alternative: template<typename F> concept bool Fmem = requires(f a, int i, double d) { { f(a,d); } -> int; // begin() can be non-member { a.f(i); } -> int; // begin() can be member 8
9 Picking one line (constraint) or the other will be sufficient for the realistic examples we can think of. If you feel otherwise, push for one of the less compatible alternatives: [5] (overload resolution) or [6] (two notations and one semantics). Inaccessible and uncallable members What if a call x.f(y) finds a members that cannot be called? Consider: class X { private: void f(int); public: int g; void f(x&,double); void g(x&,double); void use(x& x) { x.f(2.9); x.g(2.9); } // calls ::f(double) or error? // calls ::g(double) or error? Equivalent examples can be constructed for uncallable global names hiding perfectly valid member functions (or callable objects). The solution is the same in both cases: Consider failure to find a function to call and finding something that cannot be called equivalent. In that case, try the other notation. In particular, the two calls in the example are valid. Pointers Calls using pointers can be handled in a way similar to the way object are handled For p->f(y), see if p->f(y) is valid and if so do that call; otherwise if f(p,y) is valid do that call. For f(p,y), see if f(p,y) is valid and if so do that call; otherwise if p->f(y) is valid do that call. The main design choice here is whether to accept a smart pointer (an object of a class with -> defined) as a pointer. We propose to accept smart pointers they are common and useful, so they should not become second class citizens. If a p->f(y) call fails, we look at p to see whether it is a pointer or of a class with an operator->(). If so we try f(p,y). Similarly, if a f(p,y) fails, we look at p to see whether it is a pointer or of a class with an operator->(). If so we try p->f(y). This implies a bit of extra work for the compiler, but only in the case where a call currently fails. 9
10 Wording The intent of the wording is: For x.f(y), see if x.f(y) is valid and if so do that call; otherwise, if f(x,y) is valid, do that call. For p->f(y), see if p->f(y) is valid and if so do that call; otherwise, if f(p,y) is valid, do that call. For f(x,y), see if f(x,y) is valid and if so do that call; otherwise if -> is defined for x, try x->f(y), otherwise try x.f(y). 10
Object Oriented Software Design II
Object Oriented Software Design II Introduction to C++ Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa February 20, 2012 G. Lipari (Scuola Superiore Sant Anna) C++ Intro February
Moving from CS 61A Scheme to CS 61B Java
Moving from CS 61A Scheme to CS 61B Java Introduction Java is an object-oriented language. This document describes some of the differences between object-oriented programming in Scheme (which we hope you
Chapter 7: Functional Programming Languages
Chapter 7: Functional Programming Languages Aarne Ranta Slides for the book Implementing Programming Languages. An Introduction to Compilers and Interpreters, College Publications, 2012. Fun: a language
Friendship and Encapsulation in C++
Friendship and Encapsulation in C++ Adrian P Robson Department of Computing University of Northumbria at Newcastle 23rd October 1995 Abstract There is much confusion and debate about friendship and encapsulation
C++ INTERVIEW QUESTIONS
C++ INTERVIEW QUESTIONS http://www.tutorialspoint.com/cplusplus/cpp_interview_questions.htm Copyright tutorialspoint.com Dear readers, these C++ Interview Questions have been designed specially to get
Introduction to Scientific Computing Part II: C and C++ C. David Sherrill School of Chemistry and Biochemistry Georgia Institute of Technology
Introduction to Scientific Computing Part II: C and C++ C. David Sherrill School of Chemistry and Biochemistry Georgia Institute of Technology The C Programming Language: Low-level operators Created by
The Rules 1. One level of indentation per method 2. Don t use the ELSE keyword 3. Wrap all primitives and Strings
Object Calisthenics 9 steps to better software design today, by Jeff Bay http://www.xpteam.com/jeff/writings/objectcalisthenics.rtf http://www.pragprog.com/titles/twa/thoughtworks-anthology We ve all seen
Static vs. Dynamic. Lecture 10: Static Semantics Overview 1. Typical Semantic Errors: Java, C++ Typical Tasks of the Semantic Analyzer
Lecture 10: Static Semantics Overview 1 Lexical analysis Produces tokens Detects & eliminates illegal tokens Parsing Produces trees Detects & eliminates ill-formed parse trees Static semantic analysis
Generalizing Overloading for C++2000
Generalizing Overloading for C++2000 Bjarne Stroustrup AT&T Labs, Florham Park, NJ, USA Abstract This paper outlines the proposal for generalizing the overloading rules for Standard C++ that is expected
N3458: Simple Database Integration in C++11
N3458: Simple Database Integration in C++11 Thomas Neumann Technische Univeristät München [email protected] 2012-10-22 Many applications make use of relational database to store and query their data. However,
MPLAB TM C30 Managed PSV Pointers. Beta support included with MPLAB C30 V3.00
MPLAB TM C30 Managed PSV Pointers Beta support included with MPLAB C30 V3.00 Contents 1 Overview 2 1.1 Why Beta?.............................. 2 1.2 Other Sources of Reference..................... 2 2
Object Oriented Software Design II
Object Oriented Software Design II C++ intro Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa February 26, 2012 G. Lipari (Scuola Superiore Sant Anna) C++ Intro February 26,
We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share.
LING115 Lecture Note Session #4 Python (1) 1. Introduction As we have seen in previous sessions, we can use Linux shell commands to do simple text processing. We now know, for example, how to count words.
Singletons. The Singleton Design Pattern using Rhapsody in,c
Singletons Techletter Nr 3 Content What are Design Patterns? What is a Singleton? Singletons in Rhapsody in,c Singleton Classes Singleton Objects Class Functions Class Variables Extra Functions More Information
Comp 411 Principles of Programming Languages Lecture 34 Semantics of OO Languages. Corky Cartwright Swarat Chaudhuri November 30, 20111
Comp 411 Principles of Programming Languages Lecture 34 Semantics of OO Languages Corky Cartwright Swarat Chaudhuri November 30, 20111 Overview I In OO languages, data values (except for designated non-oo
6.088 Intro to C/C++ Day 4: Object-oriented programming in C++ Eunsuk Kang and Jean Yang
6.088 Intro to C/C++ Day 4: Object-oriented programming in C++ Eunsuk Kang and Jean Yang Today s topics Why objects? Object-oriented programming (OOP) in C++ classes fields & methods objects representation
Configuration Management
83 Chapter 6 Configuration Management Published as: Configuration Management in Component Based Product Populations, Rob van Ommering, 10th International Workshop on Software Configuration Management,
Why you shouldn't use set (and what you should use instead) Matt Austern
Why you shouldn't use set (and what you should use instead) Matt Austern Everything in the standard C++ library is there for a reason, but it isn't always obvious what that reason is. The standard isn't
Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas
CS 110B - Rule Storage Classes Page 18-1 Attributes are distinctive features of a variable. Data type, int or double for example, is an attribute. Storage class is another attribute. There are four storage
C and C++: Case Studies in Compatibility
C and C++: Case Studies in Compatibility Bjarne Stroustrup AT&T Labs Florham Park, NJ, USA ABSTRACT This article gives examples of how one might go about increasing the degree of compatibility of C and
Elemental functions: Writing data-parallel code in C/C++ using Intel Cilk Plus
Elemental functions: Writing data-parallel code in C/C++ using Intel Cilk Plus A simple C/C++ language extension construct for data parallel operations Robert Geva [email protected] Introduction Intel
Konzepte objektorientierter Programmierung
Konzepte objektorientierter Programmierung Prof. Dr. Peter Müller Werner Dietl Software Component Technology Exercises 3: Some More OO Languages Wintersemester 04/05 Agenda for Today 2 Homework Finish
Operator Overloading. Lecture 8. Operator Overloading. Running Example: Complex Numbers. Syntax. What can be overloaded. Syntax -- First Example
Operator Overloading Lecture 8 Operator Overloading C++ feature that allows implementer-defined classes to specify class-specific function for operators Benefits allows classes to provide natural semantics
A deeper look at Inline functions
A deeper look at Inline functions I think it s safe to say that all Overload readers know what C++ inline functions are. When we declare a function or member function as inline we are trying to avoid the
Integrating the C++ Standard Template Library Into the Undergraduate Computer Science Curriculum
Integrating the C++ Standard Template Library Into the Undergraduate Computer Science Curriculum James P. Kelsh [email protected] Roger Y. Lee [email protected] Department of Computer Science Central
A Standardized Representation of Asynchronous Operations
Document number: Supersedes: Date: Reply-to: N3558 N3428=12-0118 2013-03-15 Niklas Gustafsson < [email protected]> Artur Laksberg < [email protected]> Herb Sutter < [email protected]>
Variable Base Interface
Chapter 6 Variable Base Interface 6.1 Introduction Finite element codes has been changed a lot during the evolution of the Finite Element Method, In its early times, finite element applications were developed
To Java SE 8, and Beyond (Plan B)
11-12-13 To Java SE 8, and Beyond (Plan B) Francisco Morero Peyrona EMEA Java Community Leader 8 9...2012 2020? Priorities for the Java Platforms Grow Developer Base Grow Adoption
The programming language C. sws1 1
The programming language C sws1 1 The programming language C invented by Dennis Ritchie in early 1970s who used it to write the first Hello World program C was used to write UNIX Standardised as K&C (Kernighan
Revised Version of Chapter 23. We learned long ago how to solve linear congruences. ax c (mod m)
Chapter 23 Squares Modulo p Revised Version of Chapter 23 We learned long ago how to solve linear congruences ax c (mod m) (see Chapter 8). It s now time to take the plunge and move on to quadratic equations.
1 Abstract Data Types Information Hiding
1 1 Abstract Data Types Information Hiding 1.1 Data Types Data types are an integral part of every programming language. ANSI-C has int, double and char to name just a few. Programmers are rarely content
Managing XML Documents Versions and Upgrades with XSLT
Managing XML Documents Versions and Upgrades with XSLT Vadim Zaliva, [email protected] 2001 Abstract This paper describes mechanism for versioning and upgrding XML configuration files used in FWBuilder
CS193j, Stanford Handout #10 OOP 3
CS193j, Stanford Handout #10 Summer, 2003 Manu Kumar OOP 3 Abstract Superclass Factor Common Code Up Several related classes with overlapping code Factor common code up into a common superclass Examples
Coding conventions and C++-style
Chapter 1 Coding conventions and C++-style This document provides an overview of the general coding conventions that are used throughout oomph-lib. Knowledge of these conventions will greatly facilitate
An Innocent Investigation
An Innocent Investigation D. Joyce, Clark University January 2006 The beginning. Have you ever wondered why every number is either even or odd? I don t mean to ask if you ever wondered whether every number
C Compiler Targeting the Java Virtual Machine
C Compiler Targeting the Java Virtual Machine Jack Pien Senior Honors Thesis (Advisor: Javed A. Aslam) Dartmouth College Computer Science Technical Report PCS-TR98-334 May 30, 1998 Abstract One of the
Support for Embedded Programming in C++11 and C++14
Support for Embedded Programming in C++11 and C++14 Scott Meyers, Ph.D. Photo: Craig Wyzlk @ flickr Copyrighted material, all rights reserved. Last Revised: 10/24/14 Features New in C++11 (Incomplete List)
Describing, manipulating and pricing financial contracts: The MLFi language
Describing, manipulating and pricing financial contracts: The MLFi language Centre for Financial Research, Judge Institute of Management Cambridge, 14 March 2003 (revised January 2005) Jean-Marc Eber LexiFi,
Functional Decomposition Top-Down Development
Functional Decomposition Top-Down Development The top-down approach builds a system by stepwise refinement, starting with a definition of its abstract function. You start the process by expressing a topmost
Probability and Expected Value
Probability and Expected Value This handout provides an introduction to probability and expected value. Some of you may already be familiar with some of these topics. Probability and expected value are
Concepts and terminology in the Simula Programming Language
Concepts and terminology in the Simula Programming Language An introduction for new readers of Simula literature Stein Krogdahl Department of Informatics University of Oslo, Norway April 2010 Introduction
Factoring & Primality
Factoring & Primality Lecturer: Dimitris Papadopoulos In this lecture we will discuss the problem of integer factorization and primality testing, two problems that have been the focus of a great amount
THE DO S AND DON TS OF WEB CHAT. with Johan Jacobs
THE DO S AND DON TS OF WEB CHAT with Johan Jacobs TABLE OF CONTENTS Introduction. 3 Best Practice #1: Commit or Skip..4 Best Practice #2: Run Multiple Sessions from Day One 6 Best Practice #3: Never Make
Python 2 and 3 compatibility testing via optional run-time type checking
Python 2 and 3 compatibility testing via optional run-time type checking Raoul-Gabriel Urma Work carried out during a Google internship & PhD https://github.com/google/pytypedecl Python 2 vs. Python 3
Two Papers on Internet Connectivity and Quality. Abstract
Two Papers on Internet Connectivity and Quality ROBERTO ROSON Dipartimento di Scienze Economiche, Università Ca Foscari di Venezia, Venice, Italy. Abstract I review two papers, addressing the issue of
The equivalence of logistic regression and maximum entropy models
The equivalence of logistic regression and maximum entropy models John Mount September 23, 20 Abstract As our colleague so aptly demonstrated ( http://www.win-vector.com/blog/20/09/the-simplerderivation-of-logistic-regression/
Dataset Management with Microsoft Access
The Institute for Economic Development Boston University Introduction Dataset Management with Microsoft Access The purpose of this document is to familiarize users with ways to import datasets and construct
Computer Systems Architecture
Computer Systems Architecture http://cs.nott.ac.uk/ txa/g51csa/ Thorsten Altenkirch and Liyang Hu School of Computer Science University of Nottingham Lecture 10: MIPS Procedure Calling Convention and Recursion
Enterprise Mobile Application Development: Native or Hybrid?
Enterprise Mobile Application Development: Native or Hybrid? Enterprise Mobile Application Development: Native or Hybrid? SevenTablets 855-285-2322 [email protected] http://www.seventablets.com
Overview. Elements of Programming Languages. Advanced constructs. Motivating inner class example
Overview Elements of Programming Languages Lecture 12: Object-oriented functional programming James Cheney University of Edinburgh November 6, 2015 We ve now covered: basics of functional and imperative
Persistent Binary Search Trees
Persistent Binary Search Trees Datastructures, UvA. May 30, 2008 0440949, Andreas van Cranenburgh Abstract A persistent binary tree allows access to all previous versions of the tree. This paper presents
Exercise 4 Learning Python language fundamentals
Exercise 4 Learning Python language fundamentals Work with numbers Python can be used as a powerful calculator. Practicing math calculations in Python will help you not only perform these tasks, but also
(Refer Slide Time: 02:17)
Internet Technology Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture No #06 IP Subnetting and Addressing (Not audible: (00:46)) Now,
A Beginner s Guide to Financial Freedom through the Stock-market. Includes The 6 Steps to Successful Investing
A Beginner s Guide to Financial Freedom through the Stock-market Includes The 6 Steps to Successful Investing By Marcus de Maria The experts at teaching beginners how to make money in stocks Web-site:
Semantic Analysis: Types and Type Checking
Semantic Analysis Semantic Analysis: Types and Type Checking CS 471 October 10, 2007 Source code Lexical Analysis tokens Syntactic Analysis AST Semantic Analysis AST Intermediate Code Gen lexical errors
Checking Access to Protected Members in the Java Virtual Machine
Checking Access to Protected Members in the Java Virtual Machine Alessandro Coglio Kestrel Institute 3260 Hillview Avenue, Palo Alto, CA 94304, USA Ph. +1-650-493-6871 Fax +1-650-424-1807 http://www.kestrel.edu/
COMPARISON OF OBJECT-ORIENTED AND PROCEDURE-BASED COMPUTER LANGUAGES: CASE STUDY OF C++ PROGRAMMING
COMPARISON OF OBJECT-ORIENTED AND PROCEDURE-BASED COMPUTER LANGUAGES: CASE STUDY OF C++ PROGRAMMING Kuan C. Chen, Ph.D. Assistant Professor Management Information Systems School of Management Purdue University
Paper 3F6: Software Engineering and Systems Distributed Systems Design Solutions to Examples Paper 3
Engineering Tripos Part IIA THIRD YEAR Paper 3F: Software Engineering and Systems Distributed Systems Design Solutions to Examples Paper 3 CORBA 1. (a) A typical IDL file for this application is as follows:
IP Subnetting: Practical Subnet Design and Address Determination Example
IP Subnetting: Practical Subnet Design and Address Determination Example When educators ask students what they consider to be the most confusing aspect in learning about networking, many say that it is
Department of Electrical and Computer Engineering. EEL 3160 Embedded C++ and Data Structures. Tuesday & Thursday 3:00 5:00 pm
Department of Electrical and Computer Engineering EEL 3160 Embedded C++ and Data Structures Instructor : Dr. Herman Watson Office Hours : by appointment Monday 9:30-11:00 AM Tuesday & Thursday 3:00 5:00
Using Object And Object-Oriented Technologies for XML-native Database Systems
Using Object And Object-Oriented Technologies for XML-native Database Systems David Toth and Michal Valenta David Toth and Michal Valenta Dept. of Computer Science and Engineering Dept. FEE, of Computer
Last time we had arrived at the following provisional interpretation of Aquinas second way:
Aquinas Third Way Last time we had arrived at the following provisional interpretation of Aquinas second way: 1. 2. 3. 4. At least one thing has an efficient cause. Every causal chain must either be circular,
Coding Rules. Encoding the type of a function into the name (so-called Hungarian notation) is forbidden - it only confuses the programmer.
Coding Rules Section A: Linux kernel style based coding for C programs Coding style for C is based on Linux Kernel coding style. The following excerpts in this section are mostly taken as is from articles
Cryptography: Authentication, Blind Signatures, and Digital Cash
Cryptography: Authentication, Blind Signatures, and Digital Cash Rebecca Bellovin 1 Introduction One of the most exciting ideas in cryptography in the past few decades, with the widest array of applications,
The Trip Scheduling Problem
The Trip Scheduling Problem Claudia Archetti Department of Quantitative Methods, University of Brescia Contrada Santa Chiara 50, 25122 Brescia, Italy Martin Savelsbergh School of Industrial and Systems
Do general-purpose programming languages have a future?
Do general-purpose programming languages have a future? Bjarne Stroustrup Texas A&M University (and AT&T Research) http://www.research.att.com/~bs Abstract As the computing world matures, the roles of
1.1 WHAT IS A PROGRAMMING LANGUAGE?
1 INTRODUCTION 1.1 What is a Programming Language? 1.2 Abstractions in Programming Languages 1.3 Computational Paradigms 1.4 Language Definition 1.5 Language Translation 1.6 Language Design How we communicate
The C Programming Language course syllabus associate level
TECHNOLOGIES The C Programming Language course syllabus associate level Course description The course fully covers the basics of programming in the C programming language and demonstrates fundamental programming
Recruitment and Selection
Recruitment and Selection The recruitment and selection belongs to value added HR Processes. The recruitment is about: the ability of the organization to source new employees, to keep the organization
How to start research and how to present it?
How to start research and how to present it? Peter Kondor Budapest, CEU, 2010 Introduction What is research? How to start? How to present it? How to make it a paper? The main purpose of workshop to provide
Compiling Object Oriented Languages. What is an Object-Oriented Programming Language? Implementation: Dynamic Binding
Compiling Object Oriented Languages What is an Object-Oriented Programming Language? Last time Dynamic compilation Today Introduction to compiling object oriented languages What are the issues? Objects
2) Write in detail the issues in the design of code generator.
COMPUTER SCIENCE AND ENGINEERING VI SEM CSE Principles of Compiler Design Unit-IV Question and answers UNIT IV CODE GENERATION 9 Issues in the design of code generator The target machine Runtime Storage
6.1. Example: A Tip Calculator 6-1
Chapter 6. Transition to Java Not all programming languages are created equal. Each is designed by its creator to achieve a particular purpose, which can range from highly focused languages designed for
Your Personal Guide To Your Personal Injury Lawsuit
Your Personal Guide To Your Personal Injury Lawsuit Know How To Do Things Right When You ve Been Wronged You have questions. And most likely, you have a lot of them. The good news is that this is completely
Lecture 10: Dynamic Memory Allocation 1: Into the jaws of malloc()
CS61: Systems Programming and Machine Organization Harvard University, Fall 2009 Lecture 10: Dynamic Memory Allocation 1: Into the jaws of malloc() Prof. Matt Welsh October 6, 2009 Topics for today Dynamic
Introduction to Software Paradigms & Procedural Programming Paradigm
Introduction & Procedural Programming Sample Courseware Introduction to Software Paradigms & Procedural Programming Paradigm This Lesson introduces main terminology to be used in the whole course. Thus,
Evolution of the Major Programming Languages
142 Evolution of the Major Programming Languages Object Oriented Programming: Smalltalk Object-Oriented: It s fundamental characteristics are: Data abstraction, Inheritance and Dynamic Binding. The essence
Managing Variability in Software Architectures 1 Felix Bachmann*
Managing Variability in Software Architectures Felix Bachmann* Carnegie Bosch Institute Carnegie Mellon University Pittsburgh, Pa 523, USA [email protected] Len Bass Software Engineering Institute Carnegie
What You Don t Know Will Haunt You.
Comprehensive Consulting Solutions, Inc. Business Savvy. IT Smart. Joint Application Design (JAD) A Case Study White Paper Published: June 2002 (with revisions) What You Don t Know Will Haunt You. Contents
Software Process for QA
Software Process for QA Basic approaches & alternatives CIS 610, W98 / M Young 1/7/98 1 This introduction and overview is intended to provide some basic background on software process (sometimes called
The ROI of Test Automation
The ROI of Test Automation by Michael Kelly www.michaeldkelly.com Introduction With the exception of my first project team out of college, in every project team since, I ve had to explain either what automated
Embedded Software Development with MPS
Embedded Software Development with MPS Markus Voelter independent/itemis The Limitations of C and Modeling Tools Embedded software is usually implemented in C. The language is relatively close to the hardware,
Lecture 9. Semantic Analysis Scoping and Symbol Table
Lecture 9. Semantic Analysis Scoping and Symbol Table Wei Le 2015.10 Outline Semantic analysis Scoping The Role of Symbol Table Implementing a Symbol Table Semantic Analysis Parser builds abstract syntax
INTRODUCTION TO OBJECTIVE-C CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 12 09/29/2011
INTRODUCTION TO OBJECTIVE-C CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 12 09/29/2011 1 Goals of the Lecture Present an introduction to Objective-C 2.0 Coverage of the language will be INCOMPLETE
How To Teach Object Oriented Programming At An Introductory Level Course
149 TEACHING OBJECT ORIENTED PROGRAMMING AT THE INTRODUCTORY LEVEL Mehmet C. OKUR * ABSTRACT Teaching object oriented programming has become a rapidly expanding preference at various educational environments.
Getting Started with the Internet Communications Engine
Getting Started with the Internet Communications Engine David Vriezen April 7, 2014 Contents 1 Introduction 2 2 About Ice 2 2.1 Proxies................................. 2 3 Setting Up ICE 2 4 Slices 2
Syntax Check of Embedded SQL in C++ with Proto
Proceedings of the 8 th International Conference on Applied Informatics Eger, Hungary, January 27 30, 2010. Vol. 2. pp. 383 390. Syntax Check of Embedded SQL in C++ with Proto Zalán Szűgyi, Zoltán Porkoláb
UML for C# Modeling Basics
UML for C# C# is a modern object-oriented language for application development. In addition to object-oriented constructs, C# supports component-oriented programming with properties, methods and events.
How To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint)
TN203 Porting a Program to Dynamic C Introduction Dynamic C has a number of improvements and differences compared to many other C compiler systems. This application note gives instructions and suggestions
Two-State Options. John Norstad. [email protected] http://www.norstad.org. January 12, 1999 Updated: November 3, 2011.
Two-State Options John Norstad [email protected] http://www.norstad.org January 12, 1999 Updated: November 3, 2011 Abstract How options are priced when the underlying asset has only two possible
