<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Was thinking of something like this:<br>
    <br>
    declare dsl ApplicantValidity<br>
    &nbsp;&nbsp; mapTo : invalidAgeDSLRule<br>
    &nbsp;&nbsp; when : Applicant is younger than $age<br>
    &nbsp;&nbsp; then : Applicant is not valid<br>
    <br>
    &nbsp;&nbsp; mapTo: validAgeDSLRule<br>
    &nbsp;&nbsp; when : Applicant is older than $age<br>
    &nbsp;&nbsp; then : Applicant is valid<br>
    end<br>
    <br>
    rule invalidAgeDSLRule<br>
    when<br>
    &nbsp;&nbsp; $a : Applicant( $age : age &lt; ? )<br>
    then<br>
    &nbsp;&nbsp; $a.setValid( false );<br>
    end<br>
    <br>
    <br>
    rule validAgeDSLRule<br>
    when<br>
    &nbsp;&nbsp; $a : Applicant( $age : age &gt; ? )<br>
    then<br>
    &nbsp;&nbsp; $a.setValid( true );<br>
    end<br>
    <br>
    would be following declaring new facts somewhat and you can benefit
    from any attributes set on the dsl mapTo rules as well ...any
    thoughts ??<br>
    <br>
    Thanks.<br>
    <br>
    <br>
    <br>
    On 12/6/10 3:09 PM, Wolfgang Laun wrote:
    <blockquote
      cite="mid:AANLkTinKwKsPXw6w9wST4Re1nGn=si=AF8bGjoSX3gbU@mail.gmail.com"
      type="cite">Well, it won't give you a proper line number for an
      error that's somewhere within a single range of \-escaped <br>
      newlines, but I reinsert the "stolen" newlines at the earliest
      possible moment. This ensures that line numbers<br>
      in error messages are correct w.r.t. the start of a logical line.<br>
      <br>
      -W<br>
      <br>
      <br>
      <div class="gmail_quote">On 6 December 2010 21:00, Michael Neale <span
          dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:michael.neale@gmail.com">michael.neale@gmail.com</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="border-left: 1px solid
          rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
          1ex;">only objection I would have is that the error numbers in
          the expanded syntax (should there be compile errors) would not
          line up with the source (which makes it slightly more annoying
          than it already is to sort out).&nbsp;
          <div>
            <br>
          </div>
          <div>But as this thread goes on, perhaps some more holistic
            thought to what we want DSLv2 to be like is in order.&nbsp;</div>
          <div><br>
            <br>
            <div class="gmail_quote">
              <div>
                <div class="h5">On Sun, Dec 5, 2010 at 5:33 AM, Wolfgang
                  Laun <span dir="ltr">&lt;<a moz-do-not-send="true"
                      href="mailto:wolfgang.laun@gmail.com"
                      target="_blank">wolfgang.laun@gmail.com</a>&gt;</span>
                  wrote:<br>
                </div>
              </div>
              <blockquote class="gmail_quote" style="border-left: 1px
                solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex;
                padding-left: 1ex;">
                <div>
                  <div class="h5">Currently each entry must be a single
                    line of text. This results in long lines, especially
                    on the RHS.<br>
                    <br>
                    I have experimentally inserted a transformation of
                    the DSL text (in&nbsp; DSLTokenizedMappingFile)<br>
                    which converts '\'+EOL on the fly to a space. (The
                    passed-in reader is read into a buffer, '\'+EOL<br>
                    is translated to space, and EOLs are inserted later
                    to readjust the line number.) In a text editor,<br>
                    I can now write, e.g.,<br>
                    <br>
                    then][][Bb]ook the customer for the flight=\<br>
                    &nbsp; $f.setAvailable( $f.getAvailable() - 1 );\<br>
                    &nbsp; update( $f );&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \<br>
                    &nbsp; Booking booking = new Booking();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \<br>
                    &nbsp; booking.setCustomer( $r.getCustomer() ); \<br>
                    &nbsp; booking.setFlight( $f );&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \<br>
                    &nbsp; insert( booking );<br>
                    <br>
                    Of course, the DSL editor will not preserve this,
                    but future development might provide more<br>
                    convenient editing there, too.<br>
                    <br>
                    Any objections?<br>
                    <font color="#888888">-W<br>
                    </font><br>
                  </div>
                </div>
                <div class="im">_______________________________________________<br>
                  rules-dev mailing list<br>
                  <a moz-do-not-send="true"
                    href="mailto:rules-dev@lists.jboss.org"
                    target="_blank">rules-dev@lists.jboss.org</a><br>
                  <a moz-do-not-send="true"
                    href="https://lists.jboss.org/mailman/listinfo/rules-dev"
                    target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
                  <br>
                </div>
              </blockquote>
            </div>
            <br>
            <br clear="all">
            <br>
            -- <br>
            Michael D Neale<br>
            home: <a moz-do-not-send="true"
              href="http://www.michaelneale.net" target="_blank">www.michaelneale.net</a><br>
            blog: <a moz-do-not-send="true"
              href="http://michaelneale.blogspot.com" target="_blank">michaelneale.blogspot.com</a><br>
          </div>
          <br>
          _______________________________________________<br>
          rules-dev mailing list<br>
          <a moz-do-not-send="true"
            href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
          <a moz-do-not-send="true"
            href="https://lists.jboss.org/mailman/listinfo/rules-dev"
            target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
          <br>
        </blockquote>
      </div>
      <br>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>