From 5773631f063cdbe16e0880ce21c73cb0b911789c Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Thu, 6 Feb 2014 08:11:59 +0000 Subject: [PATCH] comments and figure from Jan --- els-specializers.org | 67 ++++- figures/dispatch-comparison.pdf | Bin 0 -> 9053 bytes figures/dispatch-comparison.svg | 515 ++++++++++++++++++++++++++++++++ 3 files changed, 574 insertions(+), 8 deletions(-) create mode 100644 figures/dispatch-comparison.pdf create mode 100644 figures/dispatch-comparison.svg diff --git a/els-specializers.org b/els-specializers.org index 6af1392..d9b66cf 100644 --- a/els-specializers.org +++ b/els-specializers.org @@ -48,6 +48,10 @@ Paepke; AMOP?]. XXX include typical examples of MOP: object persistence; maybe ref. Kizcales "MOPs: why we want them and what else they can do"? (Fig. 2 in that is good) ORMs; sparse slots. + jmoringe: + + introspection, e.g. documentation generation + + programmatic construction of classes and generic functions + e.g. for IDL compilers, model transformations One area of functionality where there is scope for customization by the metaprogrammer is in the mechanics and semantics of method @@ -59,6 +63,8 @@ practice implementation support for this was weak until relatively recently (ref. closer, also check how ContextL and filtered dispatch are implemented). + jmoringe: filtered dispatch uses a custom method combination, i + think Another potential mechanism for customizing dispatch is implicit in the class structure defined by AMOP: standard specializer objects @@ -78,7 +84,12 @@ (ahem) the return value of =class-of=, and allows the metaprogrammer to hook into cacheing schemes to avoid needless recomputation of effective methods for sufficiently similar generic function - arguments. + arguments (See Figure\nbsp\ref{fig:dispatch}). + + #+CAPTION: Dispatch Comparison + #+LABEL: fig:dispatch + #+ATTR_LATEX: width=0.9\linewidth float + [[file:figures/dispatch-comparison.pdf]] The remaining sections in this paper can be read in any order. We give some motivating examples in section XX, including @@ -127,7 +138,7 @@ (defmethod specializer-accepts-p ((s cons-specializer) o) (and (consp o) (eql (car o) (%car s)))) -#| less interesting methods elided |# +#| less interesting methods elided: jmoringe: (un)parsing, specializer + + ))) + `(list ,@(mapcar #'make-parse-form specializer-names))) + #+end_src + for each generic function class. + #+end_quote - [ ] =make-method-lambda= revision (use environment arg?) + + jmoringe: would only be relevant for pattern dispatch, right? I + think, we didn't finish the discussion regarding special + variables vs. environment vs. new protocol function * Related Work - [ ] Newton/Rhodes - [ ] filtered dispatch diff --git a/figures/dispatch-comparison.pdf b/figures/dispatch-comparison.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9a29d1d09cd6acceacc4d358e1d00bd59df73433 GIT binary patch literal 9053 zcma)C1z40#*ERs@5)om=r5kpaU0AxiLqc-tu3Z{IL`pzXN;@pJjKRx#ygjGv~}4u50dLQkRzH0&~OgnW{HRPw{zyAfU6E9lo$I zkVo0l$r@z?grXr$d>|0WBWvq`vUEe24hWQ`w57STg(beIC_WP9W{Ggb_ey)GJLyC% zMDZ}QY?}dKYv?>VnbcL2U!+~Q8dY0F5=NSe?}IyEpxNBiOFPJP^*w1dkzxx?^x?$q zvTCFOTdZ-zb1yz!v+6SAK6bb9kXou7FrORgygoIAJ#0MB$HSXEf#Zi4AY2TC6;lw5yPVz94 z4Ni1hpm8rSJO1+n^R#k}N@fof3QW{c;F<=A{=Y*idj zGZqe>HD8AOwA5)pBDfnn^>;EwSZE30z`Gs8L9ZV4Qd6=pm{upwM|PVM9eVMs;fLT{zM3)H3Cph{ z8*eX==Sf+V&tZ(!)lYwznm+1)y%zWEvy0f>Wz|OYl^bt-IP5;I1l{|xE_%{&{SbDB zQy{tK&R{1CFF{Bc31ELTh}2Fa|55F;qgJF5=<$x#_Xz7HajT$G(-h_~uS?0aw z(%0vf!5oPZwaa{OYUd2yo-tlM^Zn`tXg1s2F$gwzUis;B4J;Yx+I7u}eagUf%kQ9NG&%4~#4R$EWzOL&Y?;ob4&SS5bYkH4?2F=|xzu24x~ zlIFUdofjUvlw##jUF~B5jneN@niKPM*C@CtQy@Eq8J{1hTr>DOy z;QZwWGjN&1beH}@<2o*ey7WXvxhCUG zf)U_bI$8X+)zNR5B!S5cm=c{E1Oy8ZureIV}`AVE~1NF#!7EL4eQ| zAdi#;5DeroN1%VvX$0Ny>z7B?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RiN{OZBo4E2+O(nj+=7*G8~B@swVOn3jQXKdY&C@C9++iwRbBmSy` zA^-Bozub*B|Ie0^aYA$OwocYS9$i}}2`8lOZ{X+1y0#W58zh?T;ss-7@!vnZe4zic z{qI_Qa17(eCjbZX^P@{%j3NB|80_~4&WB;I_~HCOJ`jdG!$|$T{kPojk`IiLhd~8? z%JHEC%?pG4dPkFS5dL3wV@d(^IDBY~4?TTMpO`Nc{SHH~5MBX{&ad$>J;NZ-U&{nd z$T{D4vc+6f0AiBU-vjy2WsPADf2~#}TMLZeFyx}m-}h@@1-Dxz5;>X z3qV$Lgsq!15X=pRa6^EsHYk*fAP<`2M1$6D2p1b$b0oL3n>E|7g|F`BY~gN>zEbi3 zSNj+B3I6+Cjb9s63W44h&elJp|8q8fv7i4^@^Z7Z!bk5UC_d=V1LT9jcws;*;9nRV z3Pn2y^8lTGV_+}{?TvrOKp=Fy{sRMpFl*%B<@g2uiGd;iMHdQ1uZI87g+Tsc3qJ(< z&oTG}(2@TSU4D#<{vCtE{y7i$&o%m64&{bGZ+y3(H(<1EeJnA)!Z50u&d%ugV|@PW h- + + + + + + + + + + + + + image/svg+xml + + + + + + + AMOP Dispatch + Generalized Dispatch + + + + Argument + + + + Specializer + + + + Generalizer + + + + Gen. Spec. + + + + Class + + + + + Eql-Spec. + + + + + + + + + + match class-of + match + s-a-g-p + generalizer-of + + + + + Argument + + + + Specializer + + + + Class + + + + + Eql-Spec. + + + + + + + match class-of + match + + specializer-accepts-generalizer-p + + + -- 2.39.5