There's More Than One Way To Dispatch It
Par Martin Berends (mberends) de Amsterdam.pm
Date : vendredi 11 juin 2010 17h30
Durée : 20 minutes
Cible : Intermedaire
Langue : English
Tags : multidispatch perl6 rakudo
Vous pouvez trouver plus d'information sur le site du présentateur :
- Présentation : http://jnthn.net/papers/2009-npw-tmtowtdi-slides.pdf
Multiple dispatch allows you to write many subroutines or methods with the same name, but taking a different number of or different types of parameters. In this talk I will look at multiple dispatch in Perl 6, including:
* How to write multi dispatch subs
* Arity based dispatch
* Basic type-based dispatch
* Candidate sorting - how the winner is chosen in a more complex type hierarchy
* Using subset types to do multiple dispatch on values
* Handling ambiguity: the 'is default' trait and using a proto as a fallback
* The .?, .+ and .* operators
All illustrated with example code, which runs today in Rakudo.
Présentation suivie par: Laurent GAUTROT (lg), Emmanuel Di Pretoro (saorge),