1/47
These flashcards cover key concepts, terms, and definitions discussed in the programming languages review, including Lisp, Scheme, AArch64, Rust, and Lambda Calculus.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Is Lisp the second-oldest programming language?
True
Which Lisp/Scheme data structure holds exactly two items?
pair/cone cell
Which function returns the first component of a cons cell / pair?
car
Which function returns the second component of a cons cell / pair?
cdr
What is the result of evaluating the Scheme expression ((lambda (x) (+ x 1)) 41)?
42
A function that captures data in its lexical environment is called a…?
Closure
A function that accepts another function as a parameter is called a…?
Higher-order function
What special symbol in the car of an s-expression causes its cdr to be returned unevaluated?
quote
Which of the following describes Scheme’s type system?
Strong
Which of the following are characteristics of Scheme’s scoping rules?
Lexical scoping
Which register stores the address of the top of the stack in aarch64?
SP
Which register stores the address of the current instruction executing in aarch64?
PC
Which register stores the return address of the currently executing instruction in aarch64?
R30 (Link register)
Which register stores the address of the current function’s stack frame in aarch64?
R29 (Frame pointer)
How many bits wide is the stack pointer’s alignment boundary?
16
The first parameter (assuming it fits) to a function is passed in which register?
R0
A function’s return value, assuming it fits, is stored in which register?
R0
Which instruction loads a page address into a register?
ADR
Which keyword makes a Rust variable mutable?
mut
What’s the main function’s signature in Rust?
fn main()
Which of the following is not an error that Rust is designed to prevent?
File handle exhaustion
In Rust, a macro is…?
A function that runs at compile time to transform the program’s syntax tree
Which of the following lifetime declarations indicates that the reference is valid for the entire program execution?
&'static str
Which of the following creates a slice of v that doesn’t contain its first element?
B) &v[1..]
Which character appears at the end of macro names?
!
Which of the following is the syntax of a Rust for-each loop?
for t in &a { … }
In C, if a program contains a statement with undefined behavior, then…?
It has no meaningful behavior before and after executing the statement
Rust’s type system…
is static, with inference to allow the programmer to leave out some types
Which of the following is not a memory allocation strategy/location?
Bin
In Rust, a named collection of methods defined for a type is called a…?
Trait
This Rust feature allows us to write code that uses variables where we would usually use actual types.
Generics
Which of the following operators allows us to propagate None / Err variants of the Option and Result data types?
?
In Rust, the compiler uses this construct directly to ensure all borrows are valid.
Lifetimes
λ Calculus was developed by whom?
Alonzo Church
Which of the following programming languages was directly influenced by λ Calculus?
Haskell
Which of the following is not a kind of term in the λ calculus?
Type signatures
Two terms that are syntactically identical when bound variables appearing in them are consistently renamed are called…?
α − equivalent
Renaming bound variables in a function being applied to avoid binding free variables in the argument is called…?
α-conversion
What is an alphabet in formal language theory?
A finite set of symbols
What kind of automaton is a parser?
PDA
What does BNF stand for?
Backus-Naur Form
In a CFG, what must appear on the left-hand side of a production?
A nonterminal
What does the symbol ϵ represent in regular expressions?
The empty string
What defines the syntax of a language?
Rules specifying legal strings
What handles tokens in a compiler?
Scanner
What is a language in formal language theory?
A set of strings
A programming language is a formal language and…?
Semantics
Which of the following operators denotes zero or more repetitions of a regular expression?
*