racket - Why consulting the readtable for skip-withespace -


i reading documentation readtable , in example there function skip-witespace forward read next intressting character.

(define (skip-whitespace port) ; skips whitespace characters, sensitive current ; readtable's definition of whitespace (let ([ch (peek-char port)])   (unless (eof-object? ch)     ; consult current readtable:     (let-values ([(like-ch/sym proc dispatch-proc)                   (readtable-mapping (current-readtable) ch)])       ; if like-ch/sym whitespace, ch whitespace       (when (and (char? like-ch/sym)                  (char-whitespace? like-ch/sym))         (read-char port)         (skip-whitespace port)))))) 

the question why need read mapping readtable prior of testing white-space? in example not see mapping clobber character whitesapce.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -