				Pico: A Layered Programming Approach
				------------------------------------

Introduction
	Pico,Pool,Isar
	Short History
		Pico: Tool to enhance my own productivity
		Enter G&R
		Extend Pico during development of Isar
		Pool: Add object oriented extensions
		Make Isar partially object oriented
	Why use Pico?
		Power tool for power users
			Isar: 10000 Lisp, 2500 C
			Access to all Programming layers
				Toolbox,C,Pico,Pool
			Increased productivity
		Automatic Memory Management
			Incremental gc
			Dynamos
		Interpreter Environment
			Browsing, Prototyping, Debugging
			Good for developer but bad for the product?
				Speed is ok if low level parts are in C
				Acceptable size with zap,comsex and remob
				No access to source in end user version
				No licence problems with interpreter kernel
		Developing with less stress
			Clear project design with object orientation
			Simplicity on each layer
			No need for a priori decisions (declarations)
			No fear of repeated code
		Portable to other machine or OS if
			Memory organized in bytes
			Pointers and long words 32 bit
	Why not Common Lisp or SmallTalk?
		Complicated: No easy low-level access
		End user version?
		Need lots of machine resources
		Difficult to customize for special-purpose applications
Programming philosophy
	Keep each layer simple!
	Differences to compiler-oriented programming
		Immediate access to all parts of the system
		Modify program while running
		Everything is dynamic, no declarations
	Functional programming
	Memory Management
Drawbacks
	For beginners difficult to learn
The Pico Lisp
	In many points similar to StaffLisp
	Differences to conventional Lisps
		Symbols have only value xor function
		Symbol names: A..Z,1,2,$,*,-
		Only SUBR and EXPR functions
		Variable number of arguments to functions
		LAMBDA is omitted in Lambda-definitions
		No FLOAT numbers and no BIGNUMs: Only 30-bit integers
		Strings, vectors, arrays emulated with lists
Pico internal structure
	Heap
	Data stack
		Later version: Merge into hardware stack
	Primary data types
		Number,Symbol,Cell
		Properties,Flags,Pname
		Can address full 4GByte lisp space
		Optimal space usage
			No bit in machine word is wasted
			Print names compressed
			Properties and oblist link only when needed
	Secondary data types
		Bool, pair, list
		String, file, point, rectangle, graf, array
		Class
	gc, dynamos
	File I/O
	Generation of end user version
		Zap, comsex, remob
Pico Toolbox-level programming techniques
	Toolbox i/f functions
	Lisp functions called from inside the ROM
Pico C-level programming techniques
	Pico kernel
		System dependent parts
		Addition of general-purpose functions
	Pico applications
		Pico, Isar, Fokker
	Lisp i/f functions
		Argument parsing
		Return value boxing
	Data stack <-> gc
Pico Lisp-level programming techniques
	Functional arguments
	Mapping
Pool extensions
	Objects, Classes
	Multiple Inheritance
	Message passing
		do, may, from, method
		new
PicApp
	Co-existing applications
	Boss
		Toolbox events -> application
	Idle
Memory Management
	mark&sweep gc
	incremental gc
	dynamos
Browsing
	edit,(ff),pp,fp,who,how,what,tree,roots,type,family
Debugging
	debug,trace,untrace,break,unbreak,show,track,ed,lint,findSubr,dasm,dZone
Pico editor
Isar internal structure
	Click
	Make: Undo,redo,dirty
Isar programming techniques
What's left?
	Dialogs, warning
	Out-of-memory management
	Strings into resources
Finale
	New App: A life production demo



						PICO Data Types
						---------------


		NUMBER:  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1g
		SYMBOL:  xxxxxxxxxxxxxxxxxxxxxxxxxxxxx10g
		CELL:    xxxxxxxxxxxxxxxxxxxxxxxxxxxxx00g

				x: Data bits
				g: Used by garbage collector



					Representation in memory

		NUMBER: Immediate 30 bit signed integer

				 |
				 V
		      +-------+-------+
		CELL: |  CAR .|  CDR  |
		      +-------+-------+
				  data    link

		          |                      |
		          V                      V
		         +-------+-------+      +-------+-------+
		SYMBOL:  | TAIL .|  VAL  |  or  | TAIL .| SUBR .|
		         +-------+-------+      +-------+-------+
		           data    link           data    link



					TAIL structure

		Symbols used in the following diagrams:
			N: Number
			F: Flag (symbol)
			K: Key (any)
			P: Property (any)


		PNAME (Print name):

			PNAME = N  [++ 1 .. 6 chars ++]

			         +---+---+
			PNAME -> | N | N |  [++ 7 .. 12 chars ++]
			         +---+---+

			         +---+---+   +---+---+
			PNAME -> | N | *-+-->| N | N |  [++ 13 ..18 chars ++]
			         +---+---+   +---+---+

						etc.



		TAIL with property list:

			        +---+---+   +---+---+
			TAIL -> | * | *-+-->| * | *-+--> PNAME  [++ 2 Properties ++]
			        +-+-+---+   +-+-+---+
			          |           |
			          V           V
			        +---+---+   +---+---+
			        | K | P |   | K | K |
			        +---+---+   +---+---+


			TAIL with 1 property and 1 flag:

			        +---+---+   +---+---+
			TAIL -> | * | *-+-->| F | *-+--> PNAME
			        +-+-+---+   +---+---+
			          |
			          V
			        +---+---+
			        | K | P |
			        +---+---+



					DYNAMO structure
					----------------

		          |
		          V
		         +--------+--------+     +-------+------+
		         | $$$$$$ |    *---+---->|  FUN  | DATA |
		         +--------+--------+     +-------+------+


