(for-all cond list1 [... listn])

Notices and updates
Locked
John_Small
Posts: 12
Joined: Thu May 10, 2007 9:09 pm

(for-all cond list1 [... listn])

Post by John_Small »

It would be nice if (for-all ..) allowed for additional,
optional list arguments.

(for-all (fn (item) ...) list1 ... listn)

It may not always be efficient to use append to
concatenate the lists since the for-all may be in
a loop itself.

It would also be nice to have a disjunction complement to
for-all called for-any

(for-any cond list1 ... listn)

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

isn't 'for-any' what we have in 'exists' (at the moment for just one list)?

Or do you mean:

Code: Select all

(or (for-all cnd list1) (for-all cnd list2) ...)
If not can you give a specific example for 'for-any'.

Lutz

John_Small
Posts: 12
Joined: Thu May 10, 2007 9:09 pm

You're right exists does what I was asking for in for-any

Post by John_Small »

I didn't see that before.

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

I remember spending days of pondering if to name this 'exists' or 'for-any'. 'for-any' connects better to 'for-all' but it seems that math/logicians and the Scheme standard R6RS spec prefer 'exists'.

Was do you think?

Lutz

John_Small
Posts: 12
Joined: Thu May 10, 2007 9:09 pm

exists is fine

Post by John_Small »

my eye sight isn't the greatest any more.

I didn't see the hyperlink to exists in the manual
at the bottom of the example.

Locked