On Tuesday 22 November 2005 03:26, felix winkelmann wrote: > On 11/21/05, Pupeno <[EMAIL PROTECTED]> wrote: > > > You only need to handle compiler-specifiic syntax, which is mainly > > > #> ... <#- > > > > Why ? I already handle that and I already encountered cases where I'd > > have to handle <<EOF and similar. > > The standard reader should handle #<<... by default. In my case, it didn't, I even had to add support for #t and #f.
> > BTW, what should I return from my procedures that handle extensions. I > > was returning '() but that causes an error, I am now returning > > '(nevermind) since I don't care about it. > > Sorry, what kind of procedures are that? The procedure that is set by set-read-syntax![1]. Thank you. -- Pupeno <[EMAIL PROTECTED]> (http://pupeno.com) [1] In my case: (set-read-syntax! #\# (lambda (port) (let ((first-char (read-char port))) ;; (display (format "Found a reader macro starting with: ~s.~n" first-char)) (cond ((char=? first-char #\>) (let loop ((c (read-char port))) ;; (display (format "Retriving char: ~s.~n" c)) (if (and (char=? c #\<) (char=? (peek-char port) #\#)) (begin (read-char port) '(nevermind)) (loop (read-char port))))) ((or (char=? first-char #\f) (char=? first-char #\t)) '(nevermind)) (else (with-output-to-port (current-error-port) (lambda () (display "Non-supported reader macro extension found:") (newline)(newline) (display first-char) (display (read-string 50 port)) (display " ...") (newline) (exit 1))))))))
pgpSIRwb90Bhl.pgp
Description: PGP signature
_______________________________________________ Chicken-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/chicken-users
