* module/mes/guile.mes (with-input-from-string): Return actual tell.
* tests/guile.test ("with-input-from-string peek"): Test it.
(let ((tell 0)
(end (string-length string)))
(set! peek-char
- (lambda () (if (= tell end) (integer->char -1)
- (string-ref string (- tell 1)))))
+ (lambda ()
+ (if (= tell end) (integer->char -1)
+ (string-ref string tell))))
(set! read-char
(lambda () (if (= tell end) (integer->char -1)
(begin
(push-input sp)
(and (pop-input) (not (pop-input)))))
+(pass-if-equal "with-input-from-string peek"
+ #\X
+ (with-input-from-string "X"
+ (lambda () (peek-char))))
+
(result 'report)