Re: pl/pgsql: END verbosity

Поиск
Список
Период
Сортировка
От Jan Wieck
Тема Re: pl/pgsql: END verbosity
Дата
Msg-id 42BAEC22.1040609@Yahoo.com
обсуждение исходный текст
Ответ на Re: pl/pgsql: END verbosity  (Neil Conway <neilc@samurai.com>)
Ответы Re: pl/pgsql: END verbosity  (Neil Conway <neilc@samurai.com>)
Список pgsql-hackers
On 6/22/2005 1:29 AM, Neil Conway wrote:

> Tom Lane wrote:
>> The long-term point in my mind is that removing syntactical
>> redundancy always reduces the ability to detect errors or report
>> errors acccurately
> 
> Lexical scoping is unambiguous in a language like PL/PgSQL. Since it is 
> simple to determine whether a given END matches an IF, LOOP, or BEGIN, I 
> don't see how it would reduce our "ability to detect errors or report 
> errors accurately".
> 
>> Consider for example the possibility that Oracle's next release adds
>> some new frammish that can't be duplicated because we chose not to
>> distinguish various forms of "END xxx" ...
> 
> As lexical scoping is still unambiguous, we could actually add a K_LOOP 
> / K_IF token to the input stream, if that would make you happier :) (Of 
> course I'm not suggesting this -- the point is that as far as the parser 
> is concerned, we should have precisely the same information for 
> disambiguating the input as we used to have.)
> 
> BTW, I notice that Oracle actually allows:
> 
> <<label>>
> LOOP
>      -- ...
> END LOOP label;

But what if they decide to allow

LOOP    -- ...    IF condition THEN        EXIT;
END LOOP;

at some point? There you'd get ambiguity.


Jan


> 
> whereas we don't allow the optional label following END LOOP. Which goes 
> to my general point: this frammish has existed in PL/SQL for a while, 
> but it's not as if people are clamoring for us to implement it. I would 
> wager that most people care about having *equivalent* features to 
> PL/SQL, not exactly identical syntax. For example, the lack of 
> autonomous transactions is something people have asked for in the past, 
> because it *does* make porting PL/SQL applications more difficult. I 
> can't see anyone losing any sleep because we are slightly more relaxed 
> about the input we accept.
> 
> -Neil
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
>                http://archives.postgresql.org


-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: The contrib hit list
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: [PATCHES] O_DIRECT for WAL writes