Philip Rego
Philip Rego

Reputation: 648

Is there an && equivalent in Scheme?

The title pretty much says it all. Having a function that could AND or OR statements would be useful in scheme rather than writing nested IFs.

Upvotes: 0

Views: 95

Answers (1)

DaoWen
DaoWen

Reputation: 33019

I think you're looking for and and or. You don't specify which flavor of Scheme you're using, but I think those are standard macros. (Note that they're implemented as recursive macros—not functions—otherwise you couldn't get the desired short-circuiting behavior.)

Upvotes: 2

Related Questions