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

Last change on this file since 13360 was 13360, checked in by sjamaan, 11 years ago

Add txpath and sxpath libraries, that are built on top of sxpath-lolevel

File size: 745 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
9(define string-rindex string-index-right)
10
11(define nl (string #\newline))
12(define -- sub1)
13(define inc add1)
14
15; like cout << arguments << args
16; where argument can be any Scheme object. If it's a procedure
17; (without args) it's executed rather than printed (like newline)
18(define (cout . args)
19  (for-each (lambda (x)
20              (if (procedure? x) (x) (display x)))
21            args))
22
23(define (cerr . args)
24  (for-each (lambda (x)
25              (if (procedure? x) (x (current-error-port)) (display x (current-error-port))))
26            args))
Note: See TracBrowser for help on using the repository browser.