Chapter 2 - Vectors and Lists Flashcards

1
Q

Vector

A

an ordered list of items. []

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

Function to create a vector

A

(vector args)

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

Function to count the number of items in a vector

A

count

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

Function to get the first item of a vector

A

first

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

Function to get all items of a vector, but not the first

A

rest

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

Function to get a vector’s item by its index

A

nth

ex: (nth book-vector 3)

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

Function to add an item to the end of a vector

A

conj (conjunction)

ex: (conj books “1984”)

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

Function to add an item to the front of a vector

A

cons (constructor)

ex: (cons “Bhagavad Gita” books)

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

List

A

an ordered list of items. ‘(1 2 3)

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

Function to add an item to the front of a list

A

conj (conjunction)

ex: (conj books “1984”)

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