Skip to content

Commit 5a9a971

Browse files
authored
Merge pull request #382 from kochigami/add-map-mapcar-sample
[sequences.tex] add small sample of map and mapcar
2 parents 93529ea + 9a43b66 commit 5a9a971

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

doc/jlatex/jsequences.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ \subsection{一般列}
7171
\funcdesc{map}{result-type function seq \&rest more-seqs}{
7272
{\em function}は、{\em seq}と{\em more-seqs}のそれぞれのN番目($N=0,1,\cdots$)の要素
7373
からなるリストに
74-
対して適用され、その結果は{\em result-type}の型の列に蓄積される。}
74+
対して適用され、その結果は{\em result-type}の型の列に蓄積される。例えば、{\tt (map float-vector \#'(lambda (x) (* x x)) (float-vector 1 2 3))}のように書く。}
7575

7676
\funcdesc{fill}{sequence item \&key (start 0) (end (length sequence))}{
7777
{\em sequence}の{\em start}番目から({\em end}$-$1)番目まで、{\em item}で満たす。}
@@ -405,7 +405,7 @@ \subsection{リスト}
405405

406406
\funcdesc{mapcar}{func \&rest arg-list}{
407407
{\em arg-list}のそれぞれの要素に{\em func}を{\bf map}し、
408-
その全ての結果のリストを作る。
408+
その全ての結果のリストを作る。例えば、{\tt (mapcar \#'(lambda (x) (* x x)) '(1 2 3))}のように書く。
409409
{\bf mapcar}を使う前に、{\bf dolist}を試すこと。}
410410

411411
\funcdesc{mapcan}{func arg-list \&rest more-arg-lists}{

doc/latex/sequences.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ \subsection{General Sequences}
7272
\funcdesc{map}{result-type function seq \&rest more-seqs}{
7373
{\em function} is applied to a list of arguments taken from {\em seq}
7474
and {\em more-seqs} orderly, and the result is accumulated in a sequence
75-
of type {\em result-type}.}
75+
of type {\em result-type}. For example, you can write as follows: {\tt (map float-vector \#'(lambda (x) (* x x)) (float-vector 1 2 3))}}
7676

7777
\funcdesc{fill}{sequence item \&key (start 0) (end (length sequence))}{
7878
fills {\em item} from {\em start}th through ({\em end}-1)th in {\em sequence}.}
@@ -402,7 +402,7 @@ \subsection{Lists}
402402

403403
\funcdesc{mapcar}{func \&rest arg-list}{
404404
maps {\em func} to each element of {\em arg-list},
405-
and makes a list from all the results.
405+
and makes a list from all the results. For example, you can write as follows: {\tt (mapcar \#'(lambda (x) (* x x)) '(1 2 3))}.
406406
Before using {\bf mapcar}, try {\bf dolist}.}
407407

408408
\funcdesc{mapcan}{func arg-list \&rest more-arg-lists}{

0 commit comments

Comments
 (0)