Predicated Generic Functions

Enabling Context-Dependent Method Dispatch
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6144)


This paper presents predicated generic functions, a novel programming language abstraction that allows the expression of context-dependent behaviour in a declarative and modular manner, providing fine-grained control of method applicability and method specificity. Methods are guarded by predicates with user-defined orderings, thereby increasing the expressiveness of existing method dispatching approaches. We have prototyped our proposal in Lambic, an extension of the standard Common Lisp Object System. We illustrate and motivate our approach by discussing the implementation of a collaborative graphical editor.


Logical Implication Graphical Operation Predicate Expression Predicate Class Common Lisp 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Bardou, D., Dony, C.: Split objects: A disciplined use of delegation within objects. ACM SIGPLAN Notices 31(10), 122–137 (1996)CrossRefGoogle Scholar
  2. 2.
    Bergel, A., Ducasse, S., Nierstrasz, O., Wuyts, R.: Classboxes: Controlling visibility of class extensions. Journal of Computer Languages, Systems and Structures 31(3), 107–126 (2005)zbMATHCrossRefGoogle Scholar
  3. 3.
    Bobrow, D., DeMichiel, L., Gabriel, R., Keene, S., Kiczales, G., Moon, D.: Common Lisp Object System. specification. Lisp and Symbolic Computation 1(3/4), 245–394 (1989)Google Scholar
  4. 4.
    Chambers, C.: Predicate classes. In: Nierstrasz, O. (ed.) ECOOP 1993. LNCS, vol. 707, pp. 268–296. Springer, Heidelberg (1993)CrossRefGoogle Scholar
  5. 5.
    Chambers, C., Chen, W.: Efficient multiple and predicated dispatching. In: Proceedings of the ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pp. 238–255. ACM Press, New York (1999)CrossRefGoogle Scholar
  6. 6.
    Chandra Sekharaiah, K., Janaki Ram, D.: Object schizophrenia problem in object role system design. In: Bellahsène, Z., Patel, D., Rolland, C. (eds.) OOIS 2002. LNCS, vol. 2425, pp. 1–8. Springer, Heidelberg (2002)Google Scholar
  7. 7.
    Clifton, C., Leavens, G., Chambers, C., Millstein, T.: MultiJava: Modular open classes and symmetric multiple dispatch for Java. In: Proceedings of the ACM Conference on Object-Oriented Programming Systems, Languages, and Applications, pp. 130–145. ACM Press, New York (2000)CrossRefGoogle Scholar
  8. 8.
    Costanza, P.: Dynamically scoped functions as the essence of AOP. ACM SIGPLAN Notices 38(8), 29–36 (2003)CrossRefGoogle Scholar
  9. 9.
    Costanza, P., Herzeel, C., Vallejos, J., D’Hondt, T.: Filtered dispatch. In: Proceedings of the Dynamic Languages Symposium. ACM Press, New York (2008), co-located with ECOOP 2008Google Scholar
  10. 10.
    Costanza, P., Hirschfeld, R.: Language constructs for context-oriented programming: an overview of ContextL. In: Proceedings of the Dynamic Languages Symposium, October 2005, pp. 1–10. ACM Press, New York (2005), co-located with OOPSLA 2005Google Scholar
  11. 11.
    Ernst, M., Kaplan, C., Chambers, C.: Predicate dispatching: A unified theory of dispatch. In: Jul, E. (ed.) ECOOP 1998. LNCS, vol. 1445, pp. 186–211. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  12. 12.
    Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Professional Computing Series. Addison-Wesley, Reading (1995)Google Scholar
  13. 13.
    González, S., Mens, K., Heymans, P.: Highly dynamic behaviour adaptability through prototypes with subjective multimethods. In: Proceedings of the Dynamic Languages Symposium, October 2007, pp. 77–88. ACM Press, New York (2007), co-located with OOPSLA 2007Google Scholar
  14. 14.
    Herzeel, C., Costanza, P., D’Hondt, T.: Reflection for the masses. In: Hirschfeld, R., Rose, K. (eds.) S3 2008. LNCS, vol. 5146, pp. 87–122. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  15. 15.
    Hirschfeld, R., Costanza, P., Nierstrasz, O.: Context-oriented programming. Journal of Object Technology 7(3), 125–151 (2008)Google Scholar
  16. 16.
    Kiczales, G., Lamping, J., Menhdhekar, A., Maeda, C., Lopes, C., Loingtier, J.M., Irwin, J.: Aspect-oriented programming. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  17. 17.
    Lieberman, H.: Using prototypical objects to implement shared behavior in object-oriented systems. ACM SIGPLAN Notices 21, 214–223 (1986)CrossRefMathSciNetGoogle Scholar
  18. 18.
    Malenfant, J., Dony, C., Cointe, P.: A semantics of introspection in a reflective prototype-based language. In: LISP and Symbolic Computation, May 1996, vol. 9, pp. 153–179. Springer, Netherlands (1996)Google Scholar
  19. 19.
    Newton, J., Rhodes, C.: Custom specializers in object-oriented Lisp. Journal of Universal Computer Science 14(20), 3370–3388 (2008)Google Scholar
  20. 20.
    Steele, G.: Common Lisp: The Language, 2nd edn. Digital Press (1990)Google Scholar
  21. 21.
    Taivalsaari, A.: Object-oriented programming with modes. Journal of Object-Oriented Programming 6(3), 25–32 (1993)Google Scholar
  22. 22.
    Tanter, E., Gybels, K., Denker, M., Bergel, A.: Context-aware aspects. In: Löwe, W., Südholt, M. (eds.) SC 2006. LNCS, vol. 4089, pp. 227–242. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  23. 23.
    Vallejos, J., Costanza, P., Van Cutsem, T., De Meuter, W.: Reconciling Generic Functions with Actors. In: ACM SIGPLAN International Lisp Conference, Cambridge, Massachusetts (2009)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  1. 1.Software Languages LabVrije Universiteit BrusselBrusselsBelgium
  2. 2.Département d’ingénierie informatiqueUniversité catholique de LouvainLouvain-la-NeuveBelgium

Personalised recommendations