Skip to content

Commit 022a7b5

Browse files
committed
Improve broken sections in paper.
1 parent 5a8c214 commit 022a7b5

File tree

1 file changed

+56
-16
lines changed

1 file changed

+56
-16
lines changed

paper.tex

Lines changed: 56 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
\usepackage{to-be-determined}
1212
\setlength\footskip{13pt}
1313

14+
\newcommand\broken{\tbd{This section is not valid, must be rewritten!}}
15+
1416
\title{Reducing Programs to Objects}
1517
\subtitle{
1618
Ver:
@@ -238,6 +240,8 @@ \subsubsection{Multiple Returns}
238240
\subsection{Pointers}
239241
\label{sec:pointers}
240242

243+
\broken
244+
241245
A pointer is an object in many programming languages that stores a memory address.
242246
Pointers may point to data memory or program memory.
243247

@@ -390,7 +394,9 @@ \subsection{Procedures}
390394

391395
This example also demonstrates how \ff{go.to} object can be used to simulate the behavior of the \ff{return} statement from within the body of a method.
392396

393-
\subsubsection{Impure Functions}
397+
\subsection{Impure Functions}
398+
399+
\broken
394400

395401
A function is pure when, among other qualities, it does not have side effects:
396402
no mutation of local static variables, non-local variables, mutable reference arguments,
@@ -420,6 +426,8 @@ \subsubsection{Impure Functions}
420426
\subsection{Classes}
421427
\label{sec:classes}
422428
429+
\broken
430+
423431
A class is an extensible program code template for creating objects, providing initial values for state (member variables) and implementations of behavior (member functions or methods). The following program contains a Ruby class with a single constructor, two methods, and one mutable member variable:
424432
425433
\begin{ffcode}
@@ -465,6 +473,8 @@ \subsection{Classes}
465473
\subsection{Destructors}
466474
\label{sec:destructors}
467475

476+
\broken
477+
468478
In C++ and some other languages, a destructor is a method that is called for a class object when that object passes out of scope or is explicitly deleted. The following code will print both \ff{Alive} and \ff{Dead} texts:
469479

470480
\begin{ffcode}
@@ -521,26 +531,25 @@ \subsection{Exceptions}
521531

522532
\begin{ffcode}
523533
[] > book
524-
[] > price /int
534+
[] > price ?
525535
[b] > price
526536
if. > @
527537
b.eq 0
528538
error "NPE!"
529539
b.price.times 1.1
530540
[b] > print
531541
try > @
532-
[]
542+
[] >>
533543
QQ.io.stdout > @
534-
QQ.txt.sprintf
535-
"The price: %d"
536-
price b
537-
[e]
544+
QQ.txt.sprintf *1
545+
"The price: %d"
546+
price b
547+
[e] >>
538548
QQ.io.stdout > @
539-
QQ.txt.sprintf
540-
"Error: %s"
541-
e
542-
[]
543-
nop > @
549+
QQ.txt.sprintf *1
550+
"Error: %s"
551+
e
552+
true
544553
\end{ffcode}
545554

546555
Here, the object \ff{try} expects three arguments: 1)~an abstract object to be dataized, 2)~an abstract object to be copied with one argument, in case dataization returns an encapsulated object, and 3)~an object to be dataized anyway (similar to Java \ff{finally} block).
@@ -549,6 +558,8 @@ \subsection{Exceptions}
549558

550559
\subsubsection{Many Exception Types}
551560

561+
\broken
562+
552563
A Java method may throw a number of either checked or unchecked exceptions, for example:
553564

554565
\begin{ffcode}
@@ -607,14 +618,14 @@ \subsection{Anonymous Functions}
607618
\begin{ffcode}
608619
[lines b] > scan
609620
lines.each > @
610-
[t]
621+
[t] >>
611622
if. > @
612623
t.starts-with "#"
613624
b t
614625
true
615626
scan
616627
array
617-
[x]
628+
[x] >>
618629
QQ.io.stdout x > @
619630
\end{ffcode}
620631

@@ -623,6 +634,8 @@ \subsection{Anonymous Functions}
623634
\subsection{Generators}
624635
\label{sec:generators}
625636

637+
\broken
638+
626639
A generator is a routine that can be used to control the iteration behavior of a loop.
627640
For example, this PHP program will print the first ten Fibonacci numbers:
628641

@@ -671,7 +684,11 @@ \subsection{Generators}
671684
\subsection{Types and Type Casting}
672685
\label{sec:types}
673686
674-
A type system is a logical system comprising a set of rules that assign a property called a type to various constructs of a computer program, such as variables, expressions, functions, or modules. The main purpose of a type system is to reduce possibilities for bugs in computer programs by defining interfaces between different parts of a computer program, and then checking that the parts have been connected in a consistent way. In this example, a Java method \ff{add} expects an argument of type \ff{Book} and compilation would fail if another type is provided:
687+
\broken
688+
689+
A type system is a logical system comprising a set of rules that assign a property called a type to various constructs of a computer program, such as variables, expressions, functions, or modules.
690+
The main purpose of a type system is to reduce possibilities for bugs in computer programs by defining interfaces between different parts of a computer program, and then checking that the parts have been connected in a consistent way.
691+
In this example, a Java method \ff{add} expects an argument of type \ff{Book} and compilation would fail if another type is provided:
675692
676693
\begin{ffcode}
677694
class Cart {
@@ -728,6 +745,8 @@ \subsection{Types and Type Casting}
728745
\subsection{Reflection}
729746
\label{sec:reflection}
730747
748+
\broken
749+
731750
Reflection is the ability of a process to examine, introspect, and modify its own structure and behavior.
732751
In the following Python example, the method \ff{hello} of an instance of class \ff{Foo} is not called directly on the object but is first retrieved through reflection functions \ff{globals} and \ff{getattr}, and then executed:
733752
@@ -743,6 +762,8 @@ \subsection{Reflection}
743762
744763
\subsubsection{Monkey Patching}
745764
765+
\broken
766+
746767
Monkey patching is making changes to a module or class while the program is running.
747768
This JavaScript program adds a new method \ff{print} to the object \ff{b} after the object has already been instantiated:
748769
@@ -808,6 +829,8 @@ \subsection{Static Methods}
808829
\subsection{Inheritance}
809830
\label{sec:inheritance}
810831
832+
\broken
833+
811834
Inheritance is the mechanism of basing a class upon another class while retaining similar implementation. In this Java code class \ff{Book} inherits all methods and non-private attributes from class \ff{Item}:
812835
813836
\begin{ffcode}
@@ -837,6 +860,8 @@ \subsection{Inheritance}
837860
838861
\subsubsection{Prototype-Based Inheritance}
839862
863+
\broken
864+
840865
So-called prototype-based programming uses generalized objects, which can then be cloned and extended. For example, this JavaScript program defines two objects, where \ff{Item} is the parent object and \ff{Book} is the child that inherits the parent through its prototype:
841866
842867
\begin{ffcode}
@@ -875,6 +900,8 @@ \subsubsection{Prototype-Based Inheritance}
875900
876901
\subsubsection{Multiple Inheritance}
877902
903+
\broken
904+
878905
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,
879906
the class \ff{Jack} has both \ff{bark} and \ff{listen} methods, inherited from \ff{Dog} and \ff{Friend} respectively:
880907
@@ -918,6 +945,8 @@ \subsubsection{Multiple Inheritance}
918945
\subsection{Method Overloading}
919946
\label{sec:overloading}
920947
948+
\broken
949+
921950
Method overloading is the ability to create multiple functions with the same name but different implementations. Calls to an overloaded function will run a specific implementation of that function appropriate to the context of the call, allowing one function call to perform different tasks depending on context. In this Kotlin program two functions are defined with the same name, while only one of them is called with an integer argument:
922951
923952
\begin{ffcode}
@@ -943,7 +972,10 @@ \subsection{Method Overloading}
943972
\subsection{Java Generics}
944973
\label{sec:generics}
945974
946-
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 use:
975+
\broken
976+
977+
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.
978+
For example, this Java class expects another class to be specified as \ff{T} before use:
947979
948980
\begin{ffcode}
949981
class Cart<T extends Item> {
@@ -969,6 +1001,8 @@ \subsection{Java Generics}
9691001
\subsection{C++ Templates}
9701002
\label{sec:templates}
9711003
1004+
\broken
1005+
9721006
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 with many different data types without being rewritten for each one.
9731007
9741008
\begin{ffcode}
@@ -994,6 +1028,8 @@ \subsection{C++ Templates}
9941028
\subsection{Mixins}
9951029
\label{sec:mixins}
9961030
1031+
\broken
1032+
9971033
A mixin is a class that contains methods for use by other classes without having to be the parent class of those other classes. The following code demonstrates how a Ruby module is included in a class:
9981034
9991035
\begin{ffcode}
@@ -1017,6 +1053,8 @@ \subsection{Mixins}
10171053
\subsection{Annotations}
10181054
\label{sec:annotations}
10191055
1056+
\broken
1057+
10201058
In Java, an annotation is a form of syntactic metadata that can be added to source code; classes, methods, variables, parameters, and Java packages may be annotated. Later, annotations may be retrieved through the Reflection API. For example, this program analyzes the annotation attached to the class of the provided object and changes the behavior depending on one of its attributes:
10211059
10221060
\begin{ffcode}
@@ -1060,6 +1098,8 @@ \subsection{Annotations}
10601098
10611099
\section{Traceability}
10621100
1101+
\broken
1102+
10631103
A certain amount of semantic information may be lost during the translation from a more powerful programming language to \eolang{} objects, such as, for example, names, line numbers, comments, etc. Moreover, it may be useful to have the ability to trace \eolang{} objects back to the original language constructs from which they were derived. For example, a simple C function:
10641104
10651105
\begin{ffcode}

0 commit comments

Comments
 (0)