Previous: iklib lists queue, Up: iklib lists [Index]
The following bindings are exported by the library (vicare)
.
Return #t
if obj is a circular list; otherwise return
#f
.
Return #t
if obj is a list with a single item, otherwise
return #f
. In other words: return #t
if obj is a pair
whose cdr is null.
Build and return a new list of len elements. fill is used
to initialise the the list pairs; when not given: it defaults to the
return value of (void)
.
Return the last pair in the non–empty, finite list pair.
(last-pair '(a b c)) ⇒ (c)
Like for-each
from (rnrs base (6))
but guarantees that
proc is applied starting from the head of the lists.
Iterate in order the list arguments, applying proc to the items in
the lists, left to right. If proc returns #f
: andmap
stops the iteration and returns false. If proc returns a
non–false value for all the items from the list arguments:
andmap
returns the result of the last proc application. If
all the list arguments are null: the return value is #t
.
When applied to two arguments: proc must be a function accepting a single argument and returning a single value; ell must be proper list (possibly empty).
When applied to three arguments: proc must be a function accepting a two arguments and returning a single value; ell1 and ell2 must be proper lists of equal length (possibly empty).
(andmap (lambda (x) x) '()) ⇒ #t (andmap (lambda (x) x) '(1 2 3)) ⇒ 3 (andmap (lambda (x) x) '(1 #f 3)) ⇒ #f (andmap (lambda (x y) (and x y)) '() '()) ⇒ #t (andmap (lambda (x y) (and x y)) '(1 2) '(3 4)) ⇒ 4 (andmap (lambda (x y) (and x y)) '(1 2) '(3 #f)) ⇒ #f
Iterate in order the list arguments, applying proc to the items in
the list argument ell. If proc returns non–false:
ormap
stops the iteration and returns the non–false value. If
proc returns #f
for all the items in ell: ormap
returns #f
. If ell is null: the return value is #f
.
proc must be a function accepting a single argument and returning a single value; ell must be proper list (possibly empty).
(ormap (lambda (x) x) '()) ⇒ #f (ormap (lambda (x) x) '(#f #f #f)) ⇒ #f (ormap (lambda (x) x) '(#f 123 #f)) ⇒ 123 (ormap (lambda (x) (or x 123)) '()) ⇒ #f (ormap (lambda (x) (or x 123)) '(1 2 3)) ⇒ 1 (ormap (lambda (x) (or x 123)) '(#f #f 1)) ⇒ 123
Previous: iklib lists queue, Up: iklib lists [Index]