What is the concept of binding in programming?
The process of associating attributes (e.g., type, location) with a name in a program.
What are the differences between simple types and complex types?
Simple types are predefined (e.g., integers), while complex types are constructed using type constructors (e.g., arrays).
What is a cons cell in Common Lisp?
A basic data structure consisting of two components: the car (first element) and the cdr (rest of the list).
What is the difference between syntax and semantics?
Syntax is the structure of code, while semantics is its meaning.
What is a recursive descent parser?
A top-down parser that uses a set of recursive procedures to process grammar rules.
What is a symbol table in the context of binding?
A data structure used by a translator to maintain bindings between names and attributes.
What is type equivalence?
A rule to determine if two types are the same; it can be structural or name equivalence.
What is referential transparency?
A property where a function’s output depends only on its input, with no side effects.
Why are EBNF grammars preferred for syntax definition?
They allow for more compact and readable grammar definitions.
What are single-symbol lookahead and predictive parsing?
Techniques for deciding which production rule to apply using one token of lookahead.
How does static scoping differ from dynamic scoping?
Static scoping determines scope based on program structure, while dynamic scoping depends on runtime call stack.
How does implicit conversion differ from explicit conversion?
Implicit conversion is automatic, while explicit conversion (casting) requires programmer intervention.
How is tail recursion different from standard recursion?
Tail recursion has no additional computations after the recursive call, optimizing memory usage.
What does it mean for a grammar to be context-free?
The grammar rules can be applied regardless of the surrounding context in the language.
What is the difference between static and dynamic semantics?
Static semantics are enforced at compile time, while dynamic semantics are validated at runtime.
What is overload resolution?
The process of determining which overloaded function or operator to invoke based on argument types.
What is the purpose of type constructors?
To build complex data types from simpler ones, such as arrays or records.
How does Common Lisp treat functions as data?
Functions are first-class values and can be passed as parameters or returned as results.
What is the principle of longest substring?
The rule to match the longest sequence of characters as a single lexeme during lexical analysis.
What is an attribute grammar?
A formal way to define syntax and semantics using attributes associated with grammar symbols.
What is a lexical address?
A reference consisting of a level number and offset used to locate variables in static scoping.
Can casting serve a purpose in dynamically typed languages?
No, because types are determined at runtime, and casting typically applies to statically typed languages.
What is the purpose of the cond macro in Lisp?
To simplify multi-branch conditional expressions as an alternative to nested if statements.
What is the relationship between a lexical analyzer and a parser?
The lexical analyzer generates tokens for the parser, which builds a syntax tree.
What are the two types of attributes in attribute grammars?
Synthesized attributes (computed from child nodes) and inherited attributes (passed from parent nodes).