90 likes | 195 Views
This document presents an overview of advanced programming concepts as applied to functional programming paradigms. It details architectural elements, input processing techniques, and algorithms used in evaluating expressions and managing environments. Key topics include command patterns, recursion, and type matching. It explores the construction of a main loop, expression parsers, and how to handle various commands and self-evaluating expressions. Additionally, it discusses the development of a robust environment notion for managing states and exceptions in programming.
E N D
MScheme Advanced Programming 2009/2010 – Group 23 Rui Sebastião56939 José Duarte Lourenço 58515 Sofia Teixeira 58600
Agenda • Architecture • Input Processing • Algorithm • Environment Notion • Extensions • Glossário
Architecture • Functional Programming • Command pattern • Recursion
Input Processing • Main loop Expression Parser • If-else structure • String matching with the language glossary… • … Or Type Matching with Language Types
Input Processing – Algorithm 1/2 • Check the car of incoming cons • If it is a known command, execute it with our eval nodes • Inside each eval node: • Evaluate recursively with Expression Parser the car of the expression received until it is of a known type
Input Processing – Algorithm 2/2 • If it is of a known type, perform adequate evaluation • Self evaluating expressions • Cons expressions • Symbols that are Functions and must evaluate again on Expression Parser
EnvironmentNotion • At the beginning of the program, an initial environment is set with the known types • On each let, let* instruction & lambda a new internal environment is pushed into our List of Environments • At the end of its execution, the stack pointer returns to the global environment
Extensions • Exception handling