Am 25.11.2013 15:14, schrieb David A. Wheeler:
> On Mon, 25 Nov 2013 12:24:23 +0100, "Jörg F. Wittenberger"
>       <joerg.wittenber...@softeyes.net> wrote:
>> Hi all,
>>
>> I'm just making my first experiences in actually using srfi-110.
>>
>> At this point I find myself forced to make serious changes to the
>> program logic. Beyond what's supported by simply configuring the source
>> code.
>>
>> The worst thing I found that it will complain on the error port when
>> reading badly formatted code and then continue to read.  I really,
>> really need it to do what other Scheme readers usually do: error out.
> Easily done, and there are many ways to do it.
> The ONLY procedure that throws an exception is "read-error":

>    (define (read-error message)

I changed it's signature to match srfi-23 (for know)

(: read-error (string &rest * -> *)

This allows me to do as better job at error reporting.

But I tend to prefer a more restrictive, though compatible, syntax in 
this case

(: read-error (string input-port string &rest * -> *)

Whereby I'd require all calls to read-error to pass the port and the 
last successfully read token in an effort to further improve error messages.

But I'm unsure about this. Any comments?

>      (display "Error: " (current-error-port))
>      (display message (current-error-port))
>      (newline (current-error-port))
>      (flush-output-port (current-error-port))
>      (raise 'readable)
>      '())
>
> The ONLY procedure that catches an exception is t-expr-catch:
>    (define (t-expr-catch port)
>      (init-sweet)
>      (guard
>        (exception
>          ((eq? exception 'readable)
>           (read-to-unindented-line port) (t-expr-catch port)))
>        (t-expr port)))
>

Is there actually any scheme implementation which benefits from this 
catching?  I can't image.

I'd feel it might be good to provide a "clean up read" like 
`read-to-unindented-line` to help the implementor of a repl.  But for 
the default it just does not feel right to me.

/Jörg

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to