Functional Problem Solving (CSC 151 2014F) : Reference
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] - [FAQ] [Teaching & Learning] [Grading] [Rubric] - [Calendar]
Current: [Assignment] [EBoard] [Lab] [Outline] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Readings]
Reference: [Setup] - [Functions A-Z] [Functions By Topic] - [Racket] [Scheme Report (R5RS)] [R6RS] [TSPL4]
Related Courses: [Davis (2013F)] [Rebelsky (2014S)] [Weinman (2014F)]
Misc: [Submit Questions] - [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] - [Issue Tracker (Course)]
(make-vector
length
val
)
length
,
containing only copies of val
.
(vector
val_0
val_1
...
val_n
)
n
+1 of the form
#(val_0
val_1
... val_n
)
.
(vector-ref
vec
n
)
n
th element of
vec
. Note that elements are numbered
starting at 0.
(vector-set!
vec
k
val
)
k
th element of
vec
to val
.
(Note that vectors use 0-based indexing.)
(list->vector
lst
)
lst
to a vector so that
the ith value in the vector is the same as the ith value in the lst.
(vector->list
vec
)
vec
to a list so that
the ith value in the list is the same as the ith value in the vector.
(vector?
val
)
val
is a vector.
(vector-fill!
vec
val
)
vec
with multiple copies of
val
.
(vector-length
vec
)
vec
.