CSC151.02 2010S Functional Problem Solving : Reference
Primary: [Front Door] [Schedule] - [Academic Honesty] [Instructions]
Current: [Outline] [EBoard] [Reading] [Lab] - [Assignment] [Quiz]
Groupings: [Assignments] [EBoards] [Examples] [Exams] [Handouts] [Labs] [Outlines] [Projects] [Quizzes] [Readings]
References: [A-Z] [By Topic] - [Scheme Report (R5RS)] [R6RS] [TSPL4]
Related Courses: [CSC151.01 2010S (Weinman)] [CSC151 2009F (Rebelsky)]
Misc: [SamR] [MediaScript] [GIMP]
(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
.
Primary: [Front Door] [Schedule] - [Academic Honesty] [Instructions]
Current: [Outline] [EBoard] [Reading] [Lab] - [Assignment] [Quiz]
Groupings: [Assignments] [EBoards] [Examples] [Exams] [Handouts] [Labs] [Outlines] [Projects] [Quizzes] [Readings]
References: [A-Z] [By Topic] - [Scheme Report (R5RS)] [R6RS] [TSPL4]
Related Courses: [CSC151.01 2010S (Weinman)] [CSC151 2009F (Rebelsky)]
Misc: [SamR] [MediaScript] [GIMP]
Copyright (c) 2007-10 Janet Davis, Matthew Kluber, Samuel A. Rebelsky, and Jerod Weinman. (Selected materials copyright by John David Stone and Henry Walker and used by permission.)
This material is based upon work partially supported by the National Science Foundation under Grant No. CCLI-0633090. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.
This work is licensed under a Creative Commons
Attribution-NonCommercial 2.5 License. To view a copy of this
license, visit http://creativecommons.org/licenses/by-nc/2.5/
or send a letter to Creative Commons, 543 Howard Street, 5th Floor,
San Francisco, California, 94105, USA.