Rationale for Ada 2005: Object oriented model

RUSTOP
BACKNEXT

ENG

2. Reserved words

@ Ada 2005 has three further reserved words namely interface, overriding, and synchronized. Readers may recall that Ada 95 had six more reserved words than Ada 83 and the fact that this meant that some programs were incompatible and thus had to be rewritten loomed large in the minds of many commentators.

@ When new syntax for the introduction of interfaces was being discussed it was strongly felt that incompatibilities should be avoided and that any new syntax words should be unreserved. It was also noted that Interface was a popular identifier and that making it a reserved word would cause many programs to have to be rewritten.

@ However, it was soon realised that treating Interface as unreserved would have permitted sequences such as

  1        type T is interface;
  2        subtype Interface is T;

@ in which Interface is a subtype of the interface T. This would have been total madness. Some reviewers also had memories of PL/I in which words such as IF were not reserved so that one could write IF IF ... where the first IF is a syntax word and the second is a user identifier.

@ Accordingly it was decided that the new words would have to be reserved. No sensible alternative to interface could be thought of although it would be irritating for users who had packages called Interface – actually a brief survey revealed that most such packages had longer names such as Radar_Interface so that the problem was more apparent than real. The other new reserved words overriding and synchronized clearly present less of a problem since they are less likely to have been used as identifiers.

Rationale for Ada 2005: Object oriented model

@ENGRUSTOPBACKNEXT

2. Зарезервированные слова

@ В Аде 2005 появилось три новых зарезервированных слова: interface, overriding и synchronized. Читатели могут напомнить, что после Ады 83 в Аде 95 появилось сразу шесть новых зарезервированных слов, и фактически это означало, что некоторые старые программы оказались несовместимы с новыми синтаксическими требованиями и должны будут переписаны. Это выглядело угрожающе в умах многих комментаторов.

@ Когда обсуждался новый синтаксис для интерфейсов стремились избежать любых новых ключевых слов. Обращалось внимание, что слово Interface является довольно популярным идентификатором и принятие его в качествео зарезервированного слова заставит переписать много программ.

@ Звучали даже предложения разрешить последовательности типа:

  1        type T is interface;
  2        subtype Interface is T;

@ в котором Interface - подтип интерфейса T. Но это было бы полным безумием. Некоторые рецензенты вспоминали, что в языке PL/I вообще не было зарезервированых слов, и можно было писать: IF IF, где первый IF был словом синтаксиса, а второй является пользовательским идентификатором.

@ Тем не менее, было решено, что новые слова будут зарезервированы (в том числе и слово Interface) т.к. никакого другого подходящего слова для выражения этой сущности не было найдено, и хотя это будет раздражать некоторых пользователей у которых были пакеты под названием Interface. Предварительный анализ показал, что у большинства таких пакетов встречаются более длинные названия, например Radar_Interface, и проблема оказалась более надуманной чем реальной. Остальные новые зарезервированные слова overriding и synchronized вызывают меньше проблем, так как они менее вероятно будут использоваться как идентификаторы.

@ ENG RUS

TOP BACK NEXT

2010-10-31 11:37:57

программа такси москва . . .