Why not give an implementation for neoteric-read in terms of read,
with the assumption that the built-in read treats {} as delimiter?

(define (neoteric-read . port)
  (if (null? port)
    (neoteric-read-real (current-input-port))
    (neoteric-read-real (car port))))

(define (neoteric-read-real port)
  (let ((c (peek-char port)))
    (cond
      ((eof-object? c)
        c)
      ((char=? c #\{)
        (process-curly (my-read-delimited-list #\} port)))
      (else
        (let ((prefix
                 (read ; assuming read treats { } as delimiter
                   port)))
          (neoteric-process-tail port prefix))))))

On 9/2/12, David A. Wheeler <dwhee...@dwheeler.com> wrote:
> Any suggestions on how to improve the guidance at the end of the draft
> SRFI-105 (in the "develop" branch)?  After the code we need some guidance on
> how to hook it in.  Providing the entire reader implementation would
> probably overwhelm the reader... but I'm sure the comments at the end could
> be improved.
>
>   ; To implement neoteric-expressions, modify the reader so
>   ; that [] and {} are also delimiters.
>   ; When #\{ is detected, read using my-read-delimiated-list any list from
> that port
>   ; until its matching #\}, then process that list with "process-curly".
>   ; Then after reading each datum, call neoteric-process-tail to process any
> suffixes
>   ; (...), [...], or {...} that might be present, like this:
>   ; (let* ((prefix
>   ;           read-expression-as-usual
>   ;       ))
>   ;   (if (eof-object? prefix)
>   ;     prefix
>   ;     (neoteric-process-tail port prefix)))
>
>
>
>
> --- David A. Wheeler
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Readable-discuss mailing list
> Readable-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/readable-discuss
>

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to