Skip to content

Commit

Permalink
tails
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Sep 25, 2023
1 parent 327351e commit c857553
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions paper.tex
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ \section{Features}

\subsection{Goto}
\label{sec:goto}
Goto is a one-way imperative transfer of control to another line of code. There are only two possible cases of goto jumps: forward and backward.

Goto is a one-way imperative transfer of control to another line of code. There are only two possible cases of goto jumps: forward and backward.

\subsubsection{Backward Jump}

Expand Down Expand Up @@ -239,9 +239,9 @@ \subsubsection{Pointers to Data}

\begin{ffcode}
#include "string.h"
struct book {
char title[100];
long long price;
struct book {
char title[100];
long long price;
};
int f(struct book* p) {
struct book b = *(p + 7);
Expand Down Expand Up @@ -270,7 +270,7 @@ \subsubsection{Pointers to Data}
book (p.add 7) > b
b.title.write
("Object Thinking").as-bytes
b.price
b.price
\end{ffcode}

Here, \ff{p1} is an object that can be used as an argument of \ff{f}. It is a copy of an abstract object \ff{heap.pointer}, which expects two: 1)~an absolute address in memory, and 2)~the size of the memory block it points to, in bytes. Its attribute \ff{block} expects two attributes: 1) the number of bytes in the heap, and 2)~an abstract object that can encapsulate \ff{bytes} which were just read from memory.
Expand Down Expand Up @@ -775,12 +775,12 @@ \subsection{Static Methods}
A static method (or static function) is a method defined as a member of an object but is accessible directly from an API object's constructor, rather than from an object instance created via the constructor. For example, this C\# class consists of a single static method:
\begin{ffcode}
class Utils {
class Utils {
public static int max(int a, int b) {
if (a > b) return a;
return b;
}
}
}
\end{ffcode}
It may be converted to the following EO code, since a static method is nothing else but a ``global'' function:
Expand Down Expand Up @@ -829,7 +829,7 @@ \subsubsection{Prototype-Based Inheritance}
\begin{ffcode}
function Item(p) { this.price = p; }
function Book(p) {
function Book(p) {
Item.call(this, p);
this.tax = function () {
return this.price * 0.1;
Expand Down Expand Up @@ -863,23 +863,23 @@ \subsubsection{Prototype-Based Inheritance}
\subsubsection{Multiple Inheritance}
Multiple inheritance is a feature of some object-oriented computer programming languages in which an object or class can inherit features from more than one parent object or parent class. In this C++ example,
Multiple inheritance is a feature of some object-oriented computer programming languages in which an object or class can inherit features from more than one parent object or parent class. In this C++ example,
the class \ff{Jack} has both \ff{bark} and \ff{listen} methods, inherited from \ff{Dog} and \ff{Friend} respectively:
\begin{ffcode}
#include <iostream>
class Dog {
virtual void bark() {
std::cout << "Bark!";
virtual void bark() {
std::cout << "Bark!";
}
};
class Friend {
virtual void listen();
};
class Jack: Dog, Friend {
void listen() override {
void listen() override {
Dog::bark();
std::cout << "Listen!";
std::cout << "Listen!";
}
};
\end{ffcode}
Expand Down Expand Up @@ -931,15 +931,15 @@ \subsection{Method Overloading}
\subsection{Java Generics}
\label{sec:generics}
Generics extend Java's type system to allow a type or method to operate on objects of various types while providing compile-time type safety. For example, this Java class expects another class to be specified as \ff{T} before usage:
Generics extend Java's type system to allow a type or method to operate on objects of various types while providing compile-time type safety. For example, this Java class expects another class to be specified as \ff{T} before usage:
\begin{ffcode}
class Cart<T extends Item> {
private int total;
void add(T i) {
total += i.price();
}
}
}
\end{ffcode}
It may be represented in EO like this:
Expand All @@ -960,8 +960,8 @@ \subsection{C++ Templates}
Templates are a feature of the C++ programming language that allows functions and classes to operate with generic types, allowing a function or class to work on many different data types without being rewritten for each one.
\begin{ffcode}
template<typename T> T max(T a, T b) {
return a > b ? a : b;
template<typename T> T max(T a, T b) {
return a > b ? a : b;
}
int x = max(7, 42);
\end{ffcode}
Expand Down Expand Up @@ -1048,7 +1048,7 @@ \subsection{Annotations}
\section{Traceability}
Certain amount of semantic information may be lost during the translation from a more powerful programming language to EO objects, such as, for example, namings, line numbers, comments, etc. Moreover, it may be useful to have an ability to trace EO objects back to original language constructs, which they were motivated by. For example, a simple C function:
Certain amount of semantic information may be lost during the translation from a more powerful programming language to EO objects, such as, for example, namings, line numbers, comments, etc. Moreover, it may be useful to have an ability to trace EO objects back to original language constructs, which they were motivated by. For example, a simple C function:
\begin{ffcode}
int f(int x) {
Expand Down

0 comments on commit c857553

Please sign in to comment.