Object Oriented Programming in NeWS
Created on 2022-09-17T18:02:54-05:00
Runs PostScript with additions:
- TCP/IP sockets
- Green threads
- Multiple drawing targets (canvases)
- Event I/O pipeline
- Garbage collector
Dictionaries: read and write operates on the topmost dictionary of a stack. When no dictionary is there the default is the global dictionary and if a dictionary is pushed then read/write happens to that one.
Dictionaries have prototypes so when something is not found in the dictionary another dictionary is checked for a value.
Messenging is SmallTalk style with a sender capture: push keyword target, push object, call send. Reference to call site is pushed and method is looked up in class heirarchy.
dictbegin/dictend verbs open and close dictionary definitions.
classbegin/classend verbs open and close class definitions.
/NewObject BaseClass
dictbegin % instance variables and their defaults
/value 0 def
dictend
classbegin
/classvalue 0 def % class variables and their defaults
/methodname {
% does stuff
} def
classend def