ebooksgratis.com

See also ebooksgratis.com: no banners, no cookies, totally FREE.

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
Common Lisp Object System - Wikipedia, the free encyclopedia

Common Lisp Object System

From Wikipedia, the free encyclopedia

The Common Lisp Object System (CLOS) is the facility for object-oriented programming which is part of ANSI Common Lisp. CLOS is a dynamic object system which differs radically from the OOP facilities found in more static languages such as C++ or Java. CLOS was inspired by earlier Lisp object systems such as MIT Flavors and CommonLOOPS, although it is more general than either. Originally proposed as an add-on, CLOS was adopted as part of the ANSI standard for Common Lisp and has been adapted into other Lisp dialects like EuLisp or Emacs Lisp.[1]

Contents

[edit] Features

CLOS is a multiple dispatch system. This means that methods can be specialized upon the types of all of their arguments. Most OO languages are single-dispatch, meaning that methods are only specialized on the first argument. Methods in CLOS are grouped into generic functions; a generic function is a collection of methods with the same name and argument structure, but with differently-typed arguments.

Like the OO systems in most dynamic languages (such as Python), CLOS does not enforce encapsulation. Any data member (or slot) can be accessed using the slot-value function or via (optionally auto-generated) accessor methods. But you have to know the name for the slot to access it via slot-value. CL programmers use the language's package facility to declare which functions or data structures are intended for export.

Apart from normal ("primary") methods, there also are :before, :after, and :around methods. These modify the order in which methods are executed on a derived class. An :around method can specify whether the primary method is executed at all. Additionally, the programmer can adjust if all possible primary methods along the class hierarchy should be called or just the one providing the closest match.

The Standard Method-Combination provides above primary, before, after and around methods. There are other Method-Combinations with other method types. New (simple and complex) Method-Combinations and method types can be defined.

CLOS allows multiple inheritance. When the default order in which methods are executed in multiple inheritance is not correct, the programmer may resolve the diamond inheritance problems by specifying the order of method combinations.

CLOS is dynamic, meaning that not only the contents, but also the structure of its objects can be modified at runtime. CLOS supports changing class definitions on-the-fly (even when instances of the class in question already exist) as well as changing the class membership of a given instance through the change-class operator. CLOS also allows one to add, redefine and remove methods at runtime.

CLOS is not a prototype language: Classes must be defined before objects can be instantiated as a member of that class.

[edit] Meta-Object Protocol

Outside of the ANSI standard, there is a widely implemented extension to CLOS called the Meta-Object Protocol (MOP). The MOP defines a standard interface to the underpinnings of the CLOS implementation, treating classes, slot-descriptions, generic-functions and methods themselves as instances of metaclasses, and allows the definition of new metaclasses and the modification of all CLOS behavior. The flexibility of the CLOS MOP prefigures aspect-oriented programming, which was later developed by some of the same engineers, such as Gregor Kiczales. The MOP defines the behavior of the whole object system by a set of protocols. These are defined in terms of CLOS. Thus it is possible to create new object-systems by extending or changing the provided CLOS functionality. The Book The Art of the Metaobject Protocol describes the use and implementation of the CLOS MOP.

[edit] Literature

[edit] References

  1. ^ "CLOS is a standard. Multiple vendors supply CLOS. CLOS (or parts of it) is being used to add object orientation to other Lisp dialects such as EuLisp or Emacs Lisp." pg 110 of Veitch 1998
  • "CommonLoops: merging Lisp and object-oriented programming", by Daniel G. Bobrow, Kenneth Kahn, Gregor Kiczales, Larry Masinter, Mark Stefik, Frank Zdybel. 1986, Portland, Oregon, United States. Pages 17 - 29 of the Conference on Object Oriented Programming Systems Languages and Applications, ISSN 0362-1340.
  • "A History and Description of CLOS", by Jim Veitch. Pages 107-158 of Handbook of Programming Languages, Volume IV: Functional and Logic Programming Languages, ed. Peter H. Salus. 1998 (1st edition), Macmillian Technical Publishing; ISBN 1-57870-011-6

[edit] Literature


aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -