FP foundations & Scheme Flashcards

1
Q

examples of imperative langurs

A

C, C++, Java and pascal

Von Neumann

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is functional programming based on

A

Mathematical functions

LISP ML Haskell

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How is the evaluation order of mapping expressions controlled within mathematical foundations

A

Recursion and conditional expressions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the apply-to-all denoted by

A

Alpha

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Lambda express is

A

A function specifies the params of a mapping expression

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A term with no free variables is said to be

A

Closed

Also know. As combinators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Lambda calc does not provide built in support for what type of functions?

A

Multi-argument

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the transformation for multi-arguments functions into higher order functions called?

A

Currying

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Lists in LISP are stored a what type of data structure?

A

Linked list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Scheme is a dialect of…

A

LISP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are four characteristics of scheme?

A

(1) simple syntax
(2) small size
(3) exclusive use of static scoping
(4) treating functions as first class entities

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does most scheme implementations employ?

A

An interpreter that runs a “Read Evan print” loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How many parameters can the primitive functions of * and + have?

A

Zero or more

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

If * is given no param what does it return?

A

1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

If + is given no param what does it return

A

0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How many parameters can - and / have?

A

Two or more

17
Q

What’s is the keyword “define” used as?

A

Bind a name to the value of a variable

18
Q

What does car return?

A

The first ELEMENT of a given list

19
Q

What does cdr return?

A

Returns remains if the given list after a car is removed

20
Q

What does cons do?

A

Concatenate the list

21
Q

What does a dotted pair indicate?

A

This cell contains two atoms

22
Q

What is the difference between eq? And equal?

A

Eq? True if two objects are equal through pointer comparison

Equal? Recursively compares two objects to determine if they are equal