PasteRack.org
Paste # 32071
2018-09-30 10:07:18

Forked from paste # 57013.

Fork as a new paste.

Paste viewed 1162 times.


Embed:

  1. #lang scheme
  2.  
  3. (define (fred me) (if
  4.                    (< me 0) 0)
  5.                    (if
  6.                     (and
  7.                      (>= me 0)
  8.                      (=
  9.                       (modulo me 5)
  10.                       0))
  11.                     5)
  12.                     (else 23)
  13.   )
  14.  
  15. (fred -2)
  16. (fred 5)
  17. (fred 10)
  18. (fred 12)

=>

eval:2:0: else: not allowed as an expression

  in: (else 23)

fred: undefined;

 cannot reference an identifier before its definition

  in module: 'm

fred: undefined;

 cannot reference an identifier before its definition

  in module: 'm

fred: undefined;

 cannot reference an identifier before its definition

  in module: 'm

fred: undefined;

 cannot reference an identifier before its definition

  in module: 'm