Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

How do you...

Name: Anonymous 2011-03-18 3:57

read hebrew texts? Letters look messy and completely unreadable, compared to latin. And right-to-left order reminds me of Haskell.

Name: Anonymous 2011-03-18 8:53

>>6

(define (read-postfix (in (current-input-port)) (read read))
  (let loop ((r '())
             (ch (peek-char in)))
    (cond ((eof-object? ch) (error "unexpected eof"))
          ((char=? ch #\}) (read-char in) r)
          (else (loop (cons (read in) r)
                      (peek-char in))))))

(current-readtable
 (make-readtable
  #f #\{ 'terminating-macro
  (case-lambda
    ((ch in)
     (read-postfix in read/recursive))
    ((ch in src line col pos)
     (datum->syntax
      #f
      (read-postfix in (λ (in) (read-syntax/recursive src in)))
      (let-values (((l c p) (port-next-location in)))
        (list src line col pos (and pos (- p pos)))))))))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List