source: project/release/4/sxpath/chicken/common.scm @ 18830

Last change on this file since 18830 was 18830, checked in by Jim Ursetto, 11 years ago

sxpath: v0.1.1: use string-concatenate instead of string-append (requires source patch, unfortunately)

File size: 805 bytes
Line 
1;;;
2;;; Common cruft required to make sxml-tools happy
3;;;
4;;; These are procedures that are expected, but not provided, by sxml-tools
5;;;
6
7(import (only srfi-13 string-prefix? string-index-right
8              string-concatenate string-concatenate/shared))
9
10(define string-rindex string-index-right)
11
12(define nl (string #\newline))
13(define -- sub1)
14(define inc add1)
15
16; like cout << arguments << args
17; where argument can be any Scheme object. If it's a procedure
18; (without args) it's executed rather than printed (like newline)
19(define (cout . args)
20  (for-each (lambda (x)
21              (if (procedure? x) (x) (display x)))
22            args))
23
24(define (cerr . args)
25  (for-each (lambda (x)
26              (if (procedure? x) (x (current-error-port)) (display x (current-error-port))))
27            args))
Note: See TracBrowser for help on using the repository browser.