Metaobjektu protokolu uzlabošana ģenerisko funkciju invokācijai

Loading...
Thumbnail Image

Date

Journal Title

Journal ISSN

Volume Title

Publisher

Latvijas Universitāte

Language

N/A

Abstract

Common Lisp Object System (CLOS) ir pilna objektorientēta programmēšanas sistēma priekš valodas Common Lisp, izstrādāta ap 1986. gadu kā daļa no ANSI Common Lisp standarta. Tajā pašā laikā parādījās uz metaobjektu protokoliem (MOP) balstīta pieeja augsta līmeņa valodu projektēšanā. Šī pieeja tika realizēta priekš CLOS un ļauj paplašināt vai pielāgot sistēmu priekš lietotāja konkrētām vajadzībām. Kopš tā parādīšanās, pašā CLOS MOP nekādas izmaiņas netika veiktas. Taču visu šo gadu laikā tika sakrāta liela pieredze MOP izmantošanā un parādījās jaunas idejas CLOS paplašināšanā, it īpaši attiecībā uz ģeneriskajām funkcijām. Tika konstatēts, ka CLOS MOP ir dažreiz neērts un ir nepietiekami izteiksmīgs, kas padara noteiktu CLOS paplašinājumu realizāciju pārāk sarežģītu vai vienkārši neiespējamu, neieviešot izmaiņas pašā MOP. Piemēram, ar šādām grūtībām saskarās nesenajos pētījumos par ģenerisko funkciju paplašinājumiem. Lai palīdzētu risināt šīs problēmas, šajā darbā tiek vispirms piedāvātas noteiktas izmaiņas CLOS MOP arhitektūrā, ieskaitot jaunu mehānismu ieviešanu protokolā, kas dod smalkāku kontroli pār CLOS uzvedību. Balstoties uz šīm izmaiņām, darbā tiek realizēti problēmātiskie ģenerisko funkciju invokācijas mehānismi - filtrēta un predikātu novirzīšana - daudz vienkāršākajā veidā. Pie tam, alternatīva protokola arhitektūra dod iespēju veidot lietotāja definētus specializatorus, kā arī risina efektivitātes problēmas, kas ir sastopamas gan standarta, gan jaunos novirzīšanas mehānismos.
The Common Lisp Object System (CLOS) is a complete object-oriented programming system for Common Lisp, designed as part of ANSI Common Lisp standard ca. 1986. The approach to high-level language design based on metaobject protocols (MOP) was developed at the same time and was implemented for CLOS to provide means for the user to modify and extend its behavior according to his or her needs. The CLOS MOP has never been revised since its appearance. The experience gained over the years and the new ideas on how to extend CLOS, especially in the area of generic functions, have revealed that the CLOS MOP is sometimes inconvenient to use and is insufficiently expressive, which makes certain extensions to CLOS unnecessarily complicated or simply impossible without modifying the MOP itself. In particular, such difficulties have been encountered in recent publications on extending generic functions. In order to address these difficulties, the thesis first proposes certain changes to the design of the CLOS MOP and introduces new features into the protocol that allow for a finer control over the CLOS behavior. The thesis then takes advantage of these changes to implement the problematic generic function invocation mechanisms, filtered and predicate dispatch, in a more straightforward way. The alternative design also provides the ability to create custom specializers and addresses efficiency issues, encountered in the standard and custom dispatch mechanisms.

Citation

Relation

Endorsement

Review

Supplemented By

Referenced By