





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The concept of object-oriented programming (oop) in python through various sources, including one-slide summaries, exam questions, and historical context. It covers the benefits of learning new programming languages, the history of oop with simula and smalltalk, and the practical applications of python. The document also includes information about specific python features, such as interpreters and classes.
Typology: Study notes
1 / 9
This page cannot be seen from the preview
Don't miss anything!






# 2
# 7
Actual Sketchpad: # 8
In the process of making the Sketchpad system operate, a few very general functions were developed which make no reference at all to the specific types of entities on which they operate. These general functions give the Sketchpad system the ability to operate on a wide range of problems. The motivation for making the functions as general as possible came from the desire to get as much result as possible from the programming effort involved. For example, the general function for expanding instances makes it possible for Sketchpad to handle any fixed geometry subpicture. The rewards that come from implementing general functions are so great that the author has become reluctant to write any programs for specific jobs. Each of the general functions implemented in the Sketchpad system abstracts, in some sense, some common property of pictures independent of the specific subject matter of the pictures themselves. Ivan Sutherland, Sketchpad: a Man-Machine Graphical Communication System , 1963 (major influence on Alan Kay developing OOP in 1970s) # 9
class counter; integer count; begin procedure reset(); count := 0; end; procedure next(); count := count + 1; end; integer procedure current(); current := count; end; end XEROX Palo Alto Research Center (PARC)
(Just a model)
# 19 Ada, Countess of Lovelace, around 1843
By the word operation, we mean any process which alters the mutual relation of two or more things, be this relation of what kind it may. This is the most general definition, and would include all subjects in the universe. Again, it might act upon other things besides number, were objects found whose mutual fundamental relations could be expressed by those of the abstract science of operations, and which should be also susceptible of adaptations to the action of the operating notation and mechanism of the engine... Supposing, for instance, that the fundamental relations of pitched sounds in the science of harmony and of musical composition were susceptible of such expression and adaptations, the engine might compose elaborate and scientific pieces of music of any degree of complexity or extent. # 20
Python Java SQL Scheme Job listings at monster.com in Virginia (27 March 2007, postings in last 3 months):
PS5, PS8 & 9
# 25 “ Scheme” Jobs # 26
Languages change the way we think. The more languages you know, the more different ways you have of thinking about (and solving) problems. # 27 “Jamais Jamais Jamais” from Harmonice Musices Odhecaton A. Printed by Ottaviano Dei Petrucci in 1501 (first music with movable type) # 28 J S Bach, “Coffee Cantata”, BWV 211 (1732) www.npj.com/homepage/teritowe/jsbhand.html “Jamais Jamais Jamais” from Harmonice Musices Odhecaton A. (1501) Reason 3: Deepening Understanding By seeing how the same concepts we encountered in Scheme are implemented by a different language, you will understand those concepts better (especially classes/objects, assignment, data abstraction).
By learning Python (mostly) on your own, the next time you encounter a problem that is best solved using a language you don’t know, you will be confident you can learn it (rather than trying to use the wrong tool to solve the problem).
# 39
# 43
It is no exaggeration to regard this as the most fundamental idea in programming: The evaluator, which determines the meaning of expressions in the programming language, is just another program. To appreciate this point is to change our images of ourselves as programmers. We come to see ourselves as designers of languages, rather than only users of languages designed by others. (SICP, p. 360) # 45 Environmental Model of Evaluation
Eval and Apply are defined in terms of each other. def meval(expr, env): if isPrimitive(expr): return evalPrimitive(expr) elif isConditional(expr): return evalConditional(expr, env) elif isLambda(expr): return evalLambda(expr, env) elif isDefinition(expr): evalDefinition(expr, env) elif isName(expr): return evalName(expr, env) elif isApplication(expr): return evalApplication(expr, env) else : evalError ("Unknown expression type: " + str(expr))
def mapply(proc, operands): if (isPrimitiveProcedure(proc)): return proc(operands) elif isinstance (proc, Procedure): params = proc.getParams() newenv = Environment(proc.getEnvironment()) if len(params) != len(operands): evalError ("Parameter length mismatch: ...") for i in range(0, len(params)): newenv.addVariable(params[i], operands[i]) return meval(proc.getBody(), newenv) else : evalError("Application of non-procedure: %s" % (proc))