<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <br>
    <blockquote type="cite"
      cite="mid:520772990.1745863.1600021215119.JavaMail.zimbra@u-pem.fr">
      <div id="zimbraEditorContainer" style="font-family: arial,
        helvetica, sans-serif; font-size: 12pt; color: #000000"
        class="35">
        <div data-marker="__QUOTED_TEXT__">
          <div><br data-mce-bogus="1">
          </div>
          <div><br data-mce-bogus="1">
          </div>
          <blockquote style="border-left:2px solid
#1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">
            <div>
              <div> So I’m not sure how much we can learn from this
                particular example.  Maybe you have a better one?</div>
            </div>
          </blockquote>
          <div><br>
          </div>
          <div>No a better one, just another one, you want to be able to
            declare a deconstructor abstract by example on an interface<br
              data-mce-bogus="1">
          </div>
          <div>interface Map {<br data-mce-bogus="1">
          </div>
          <div>  interface Entry<K,V> {<br data-mce-bogus="1">
          </div>
          <div>    public abstract deconstructor Entry(K key, V value);<br
              data-mce-bogus="1">
          </div>
          <div>  }<br data-mce-bogus="1">
          </div>
          <div>}<br data-mce-bogus="1">
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    Yes, valid goal, but now you're getting ahead of the story.  There
    is a plan for the "instance method analogue" of pattern
    declarations, but it's not called a "deconstructor", any more than a
    method is not called a constructor.  <br>
    <br>
    The basic story is:<br>
     - patterns are declared as members<br>
     - some patterns are static (Optional.of(var x)), some are instance
    (Map.contains(k, var value)), and some are the same weird mix that
    constructors are (deconstructors)<br>
     - Deconstructors are total (they deconstruct only), but the others
    are partial (they ask a question)<br>
    <br>
    Right now, we're looking only at the simplest kind of declared
    pattern -- deconstructors -- and building from there.  <br>
    <br>
    <blockquote type="cite"
      cite="mid:520772990.1745863.1600021215119.JavaMail.zimbra@u-pem.fr">
      <div id="zimbraEditorContainer" style="font-family: arial,
        helvetica, sans-serif; font-size: 12pt; color: #000000"
        class="35">
        <div data-marker="__QUOTED_TEXT__">
          <div>...<br data-mce-bogus="1">
          </div>
          <div>for(Map.Entry<String, String>(var key, var value) :
            entries) {<br data-mce-bogus="1">
          </div>
          <div>  ...<br data-mce-bogus="1">
          </div>
          <div>}<br data-mce-bogus="1">
          </div>
          <div><br data-mce-bogus="1">
          </div>
          <div>BTW, it's also an example where 'var' can be useful
            instead of having to specify the full type</div>
          <div>for(var(var key, var value) : entries) {<br
              data-mce-bogus="1">
          </div>
          <div>  ...<br data-mce-bogus="1">
          </div>
          <div>}</div>
        </div>
      </div>
    </blockquote>
    <br>
    <br>
    <blockquote type="cite"
      cite="mid:520772990.1745863.1600021215119.JavaMail.zimbra@u-pem.fr">
      <div id="zimbraEditorContainer" style="font-family: arial,
        helvetica, sans-serif; font-size: 12pt; color: #000000"
        class="35">
        <div data-marker="__QUOTED_TEXT__">
          <div><br data-mce-bogus="1">
          </div>
          <div><br>
          </div>
          <div>I get that you can write the code like this if baseSalary
            is declared private in Employee<br data-mce-bogus="1">
          </div>
          <div><br data-mce-bogus="1">
          </div>
          <div><span style="caret-color: #000000; font-family:
              Menlo-Regular; font-size: 11px; font-style: normal;
              font-variant-caps: normal; font-weight: normal;
              letter-spacing: normal; text-align: start; text-indent:
              0px; text-transform: none; white-space: normal;
              word-spacing: 0px; -webkit-text-stroke-width: 0px;
              text-decoration: none; float: none; display: inline
              !important;" class="" data-mce-style="caret-color:
              #000000; font-family: Menlo-Regular; font-size: 11px;
              font-style: normal; font-variant-caps: normal;
              font-weight: normal; letter-spacing: normal; text-align:
              start; text-indent: 0px; text-transform: none;
              white-space: normal; word-spacing: 0px;
              -webkit-text-stroke-width: 0px; text-decoration: none;
              float: none; display: inline !important;">class VP extends
              Employee {</span><br style="caret-color: #000000;
              font-family: Menlo-Regular; font-size: 11px; font-style:
              normal; font-variant-caps: normal; font-weight: normal;
              letter-spacing: normal; text-align: start; text-indent:
              0px; text-transform: none; white-space: normal;
              word-spacing: 0px; -webkit-text-stroke-width: 0px;
              text-decoration: none;" class=""
              data-mce-style="caret-color: #000000; font-family:
              Menlo-Regular; font-size: 11px; font-style: normal;
              font-variant-caps: normal; font-weight: normal;
              letter-spacing: normal; text-align: start; text-indent:
              0px; text-transform: none; white-space: normal;
              word-spacing: 0px; -webkit-text-stroke-width: 0px;
              text-decoration: none;">
            <span style="caret-color: #000000; font-family:
              Menlo-Regular; font-size: 11px; font-style: normal;
              font-variant-caps: normal; font-weight: normal;
              letter-spacing: normal; text-align: start; text-indent:
              0px; text-transform: none; white-space: normal;
              word-spacing: 0px; -webkit-text-stroke-width: 0px;
              text-decoration: none; float: none; display: inline
              !important;" class="" data-mce-style="caret-color:
              #000000; font-family: Menlo-Regular; font-size: 11px;
              font-style: normal; font-variant-caps: normal;
              font-weight: normal; letter-spacing: normal; text-align:
              start; text-indent: 0px; text-transform: none;
              white-space: normal; word-spacing: 0px;
              -webkit-text-stroke-width: 0px; text-decoration: none;
              float: none; display: inline !important;">   int bonus;</span><br
              style="caret-color: #000000; font-family: Menlo-Regular;
              font-size: 11px; font-style: normal; font-variant-caps:
              normal; font-weight: normal; letter-spacing: normal;
              text-align: start; text-indent: 0px; text-transform: none;
              white-space: normal; word-spacing: 0px;
              -webkit-text-stroke-width: 0px; text-decoration: none;"
              class="" data-mce-style="caret-color: #000000;
              font-family: Menlo-Regular; font-size: 11px; font-style:
              normal; font-variant-caps: normal; font-weight: normal;
              letter-spacing: normal; text-align: start; text-indent:
              0px; text-transform: none; white-space: normal;
              word-spacing: 0px; -webkit-text-stroke-width: 0px;
              text-decoration: none;">
            <br style="caret-color: #000000; font-family: Menlo-Regular;
              font-size: 11px; font-style: normal; font-variant-caps:
              normal; font-weight: normal; letter-spacing: normal;
              text-align: start; text-indent: 0px; text-transform: none;
              white-space: normal; word-spacing: 0px;
              -webkit-text-stroke-width: 0px; text-decoration: none;"
              class="" data-mce-style="caret-color: #000000;
              font-family: Menlo-Regular; font-size: 11px; font-style:
              normal; font-variant-caps: normal; font-weight: normal;
              letter-spacing: normal; text-align: start; text-indent:
              0px; text-transform: none; white-space: normal;
              word-spacing: 0px; -webkit-text-stroke-width: 0px;
              text-decoration: none;">
            <span style="caret-color: #000000; font-family:
              Menlo-Regular; font-size: 11px; font-style: normal;
              font-variant-caps: normal; font-weight: normal;
              letter-spacing: normal; text-align: start; text-indent:
              0px; text-transform: none; white-space: normal;
              word-spacing: 0px; -webkit-text-stroke-width: 0px;
              text-decoration: none; float: none; display: inline
              !important;" class="" data-mce-style="caret-color:
              #000000; font-family: Menlo-Regular; font-size: 11px;
              font-style: normal; font-variant-caps: normal;
              font-weight: normal; letter-spacing: normal; text-align:
              start; text-indent: 0px; text-transform: none;
              white-space: normal; word-spacing: 0px;
              -webkit-text-stroke-width: 0px; text-decoration: none;
              float: none; display: inline !important;">   deconstructor
              VP(int salary) {</span></div>
          <div><span style="caret-color: #000000; font-family:
              Menlo-Regular; font-size: 11px; font-style: normal;
              font-variant-caps: normal; font-weight: normal;
              letter-spacing: normal; text-align: start; text-indent:
              0px; text-transform: none; white-space: normal;
              word-spacing: 0px; -webkit-text-stroke-width: 0px;
              text-decoration: none; float: none; display: inline
              !important;" class="" data-mce-style="caret-color:
              #000000; font-family: Menlo-Regular; font-size: 11px;
              font-style: normal; font-variant-caps: normal;
              font-weight: normal; letter-spacing: normal; text-align:
              start; text-indent: 0px; text-transform: none;
              white-space: normal; word-spacing: 0px;
              -webkit-text-stroke-width: 0px; text-decoration: none;
              float: none; display: inline !important;">     super(var
              baseSalary) = this;<br data-mce-bogus="1">
            </span></div>
          <div><span style="caret-color: #000000; font-family:
              Menlo-Regular; font-size: 11px; font-style: normal;
              font-variant-caps: normal; font-weight: normal;
              letter-spacing: normal; text-align: start; text-indent:
              0px; text-transform: none; white-space: normal;
              word-spacing: 0px; -webkit-text-stroke-width: 0px;
              text-decoration: none; float: none; display: inline
              !important;" class="" data-mce-style="caret-color:
              #000000; font-family: Menlo-Regular; font-size: 11px;
              font-style: normal; font-variant-caps: normal;
              font-weight: normal; letter-spacing: normal; text-align:
              start; text-indent: 0px; text-transform: none;
              white-space: normal; word-spacing: 0px;
              -webkit-text-stroke-width: 0px; text-decoration: none;
              float: none; display: inline !important;">     return
              (baseSalary + bonus);</span></div>
          <div><span style="caret-color: #000000; font-family:
              Menlo-Regular; font-size: 11px; font-style: normal;
              font-variant-caps: normal; font-weight: normal;
              letter-spacing: normal; text-align: start; text-indent:
              0px; text-transform: none; white-space: normal;
              word-spacing: 0px; -webkit-text-stroke-width: 0px;
              text-decoration: none; float: none; display: inline
              !important;" class="" data-mce-style="caret-color:
              #000000; font-family: Menlo-Regular; font-size: 11px;
              font-style: normal; font-variant-caps: normal;
              font-weight: normal; letter-spacing: normal; text-align:
              start; text-indent: 0px; text-transform: none;
              white-space: normal; word-spacing: 0px;
              -webkit-text-stroke-width: 0px; text-decoration: none;
              float: none; display: inline !important;">  }</span><br
              style="caret-color: #000000; font-family: Menlo-Regular;
              font-size: 11px; font-style: normal; font-variant-caps:
              normal; font-weight: normal; letter-spacing: normal;
              text-align: start; text-indent: 0px; text-transform: none;
              white-space: normal; word-spacing: 0px;
              -webkit-text-stroke-width: 0px; text-decoration: none;"
              class="" data-mce-style="caret-color: #000000;
              font-family: Menlo-Regular; font-size: 11px; font-style:
              normal; font-variant-caps: normal; font-weight: normal;
              letter-spacing: normal; text-align: start; text-indent:
              0px; text-transform: none; white-space: normal;
              word-spacing: 0px; -webkit-text-stroke-width: 0px;
              text-decoration: none;">
            <span style="caret-color: #000000; font-family:
              Menlo-Regular; font-size: 11px; font-style: normal;
              font-variant-caps: normal; font-weight: normal;
              letter-spacing: normal; text-align: start; text-indent:
              0px; text-transform: none; white-space: normal;
              word-spacing: 0px; -webkit-text-stroke-width: 0px;
              text-decoration: none; float: none; display: inline
              !important;" class="" data-mce-style="caret-color:
              #000000; font-family: Menlo-Regular; font-size: 11px;
              font-style: normal; font-variant-caps: normal;
              font-weight: normal; letter-spacing: normal; text-align:
              start; text-indent: 0px; text-transform: none;
              white-space: normal; word-spacing: 0px;
              -webkit-text-stroke-width: 0px; text-decoration: none;
              float: none; display: inline !important;"> }</span>
            <div style="clear: both;" data-mce-style="clear: both;"><br
                data-mce-bogus="1">
            </div>
            <div style="clear: both;" data-mce-style="clear: both;">still,
              a deconstructor is unlike a constructor because you can
              call a constructor directly something you can not do with
              a deconstructor.<br data-mce-bogus="1">
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    You cannot call a constructor directly either!  You execute a "new"
    operation, which has multiple consequences, only one of which is
    calling the constructor to fill in the state of the object.  The
    same is true with deconstructors -- you do a pattern match, which,
    under the right circustances, causes the deconstructor to be
    called.  <br>
    <br>
    <br>
    <br>
  </body>
</html>