There is indeed a way to not use any condition at all, even predefined functions that use conditions like min, but if you're new to Scheme, you're not going to like it, and it may not be what you are after. The trick is to go back to bare bones lambda calculus, from which Scheme is derived.
First, redefine the primitives for true and false, as functions that return either the first or the second argument:
(define TRUE (lambda(t f) t))
(define FALSE (lambda(t f) f))
Second, define the number zero as the list containing only FALSE (we could even avoid using list primitives, but for a simple example this will do), and define two functions to increment and decrement a number:
(define zero (list FALSE))
(define (inc n) (cons TRUE n))
(define (dec n) (rest n))
Define some numbers:
(define one (inc zero))
(define two (inc one))
(define three (inc two))
So the first element of any (positive) number that is not zero is TRUE, and it is FALSE for zero. You can use this information to define a function that takes a number and two functions as argument, and applies the first function if the number is positive, and the second one otherwise:
(define (if-positive n proc-true proc-false)
(((first n)
proc-true
proc-false)))
;; TESTS
(if-positive three (lambda() 'positive) (lambda() 'zero)) ; -> 'positive
(if-positive zero (lambda() 'positive) (lambda() 'zero)) ; -> 'zero
Now, we can make a function that takes two numbers and two procedures, recursively subtract 1 from each number and if the first number reaches 0 first it applies the first procedure, but if the second number reaches 0 first it applies the second procedure:
(define (if-greater n1 n2 proc-true proc-false)
(if-positive
n1
(lambda()(if-positive
n2
(lambda()(if-greater (dec n1) (dec n2) proc-true proc-false))
proc-true))
proc-false))
;; TESTS
(if-greater three two (lambda() 0.15) (lambda() 0.1)) ; -> 0.15
(if-greater one two (lambda() 0.1) (lambda() 0.05)) ; -> 0.05
Now all you need to do is define the numbers 100 and 50 and you're good to go. Of course this is very impractical, but that's what you get by not using if. (Note that it could be made slightly more practical by using base 2 numbers instead of base 1, but for this example this is a detail.)
More information here for example, but it may be a bit harsh on a newcomer.
Price >= 50 && Price < 100andPrice >= 100? Otherwise there are "holes" at 50 and 100. - Greg Hendershott