문제

I'm trying to use Chicken Scheme's abort procedure as shown in the code below:

(module change-calculator (export calculate-change)
  (import scheme)

  (define (calculate-change coin-values amount)
    (cond ((null? coin-values) (abort '"coin-values should contain at least one value."))
          ((= 0 amount) '() )))
)

but get the following warning:

Warning: reference to possibly unbound identifier `abort' in:
Warning:    calculate-change

The documentation does not mention any additional module that needs to be imported. I've tried importing extras,utils,srfi-12 without any success. Can anyone show me the correct way to use the abort procedure? Or am I missing something else?

도움이 되었습니까?

해결책

Ah, an easy mistake to make. The line (import scheme) should be (import scheme chicken). Good luck with your module!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top