1; SketchyLISP Library 2; Copyright (C) 2005,2006,2007 Nils M Holm. All rights reserved. 3; See the file LICENSE of the SketchyLISP distribution 4; for conditions of use. 5 6; ---name--- 7; negative? 8 9; ---conformance--- 10; R5RS 11 12; ---purpose--- 13; Check whether a number is negative. 14 15; ---args--- 16; X - number 17 18; ---keywords--- 19; NEGATIVE? function, negative value, sign, predicate 20 21; ---see-also--- 22; digits, positive?, zero?, abs 23 24; ---example--- 25; (negative? -567) => #t 26 27(define negativep #t) 28 29(require "digits.scm") 30 31; ---code--- 32(define (negative? x) 33 (eq? '- (car (integer->list x)))) 34