<!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">
<pre wrap="">Cheese ( name == $p.favouriteFoods.favouriteCheese )        
That is a different thing, because a rule engine can only understand the asserted facts and their direct properties, so where as one is a short cut for a standard variable constraint, the other in the expression above, would have to be swapped out for a return value constraint with the expression executed by MVEL. That is also planned. However be aware that excessive use of deep nested graphs will really just turn drools into a standard scripting engine.

Mark
</pre>
<br>
Anstis, Michael (M.) wrote:
<blockquote
 cite="mid:6CE83AFC8500B641AE00AC1674A3B4AC0164BC5F@eu1wam08.warley.ford.com"
 type="cite">
  <pre wrap="">For what it's worth I like the thought of:-

$p : Person()
Cheese ( name == $p.favouriteCheese )

I like even more:-

$p : Person()
Cheese ( name == $p.favouriteFoods.favouriteCheese )        &lt;-- i.e. object
model navigation

And possibly (subject to constrains such as "must be a Map" - I think
there's a similar requirement for extension of "contains"):-

$p : Person()
Cheese ( name == $p.favouriteFoods["cheese"] ) 

I'm with Edson (given my limited use) regarding pattern matches - it's
easier for me (as a user) to understand.

I can't say I understand what the cross-product issue is though (I know
"cross-product==bad").

Cheers,

Mike

-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:rules-dev-bounces@lists.jboss.org">rules-dev-bounces@lists.jboss.org</a>
[<a class="moz-txt-link-freetext" href="mailto:rules-dev-bounces@lists.jboss.org">mailto:rules-dev-bounces@lists.jboss.org</a>] On Behalf Of Edson Tirelli
Sent: 20 March 2007 23:22
To: Rules Dev List
Subject: Re: [rules-dev] sugar


   Yes, that is the part that I agreed.... :)
    I just would NOT want:

Cheese( name == Person().favouriteCheese )

   []s
   Edson

Michael Neale wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">I am not sure about the "danger", but I do like anything that avoids 
extra binding.
So lets not throw the baby out with the bathwater.

I really like:
$p : Person()
Cheese( name == $p.favouriteCheese )

I think that should definately be allowed.


On 3/21/07, *Edson Tirelli* &lt;<a class="moz-txt-link-abbreviated" href="mailto:tirelli@post.com">tirelli@post.com</a> 
<a class="moz-txt-link-rfc2396E" href="mailto:tirelli@post.com">&lt;mailto:tirelli@post.com&gt;</a>&gt; wrote:


       I think it is a dangerous move.
       It is easy for users to understand that each pattern matches a
    fact:

    A( ... )
    B( ... )
    C( ... )

       If you start moving patterns to inside other patterns, you risk
    </pre>
  </blockquote>
  <pre wrap=""><!---->to
  </pre>
  <blockquote type="cite">
    <pre wrap="">    lose the legibility:

    A( b == B( ... ), c == C(...) )

       Main problem I see is with cross product abuses:

    A( oneb == B(...), thesameb == B(...) )

       The above may match the same B as intended, but may also match
    other
    Bs, leading to errors and bugs that will be hard to track.
       I would continue making patterns explicit and not nested.

       Although, the object navigability is desired and much waited I
    think:

    $b : B(...)
    A( c == $b.c )

       Also, there are some cases that we would do good allowing
    </pre>
  </blockquote>
  <pre wrap=""><!---->nesting:
  </pre>
  <blockquote type="cite">
    <pre wrap="">    $c : Cheesery( ... )
    $s : List( size &lt; 3 ) from collect( Cheese( type == "stilton" )
    </pre>
  </blockquote>
  <pre wrap=""><!---->from
  </pre>
  <blockquote type="cite">
    <pre wrap="">    $c.getCheeses() )

       Just my .02 c.

        []s
        Edson

    Olenin, Vladimir (MOH) wrote:

    &gt;Don't have any antlr experience, but I'd say that would be a very
    valuable
    &gt;addition - probably more BAs would be able to pick it up this way
    (without
    &gt;having to fallback on custom DSL)
    &gt;
    &gt;Vlad
    &gt;
    &gt;-----Original Message-----
    &gt;From: <a class="moz-txt-link-abbreviated" href="mailto:rules-dev-bounces@lists.jboss.org">rules-dev-bounces@lists.jboss.org</a>
    <a class="moz-txt-link-rfc2396E" href="mailto:rules-dev-bounces@lists.jboss.org">&lt;mailto:rules-dev-bounces@lists.jboss.org&gt;</a>
    &gt;[<a class="moz-txt-link-freetext" href="mailto:rules-dev-bounces@lists.jboss.org">mailto:rules-dev-bounces@lists.jboss.org</a>
    <a class="moz-txt-link-rfc2396E" href="mailto:rules-dev-bounces@lists.jboss.org">&lt;mailto:rules-dev-bounces@lists.jboss.org&gt;</a>] On Behalf Of Mark
    </pre>
  </blockquote>
  <pre wrap=""><!---->Proctor
  </pre>
  <blockquote type="cite">
    <pre wrap="">    &gt;Sent: 20 March 2007 15:54
    &gt;To: Rules Dev List
    &gt;Subject: Re: [rules-dev] sugar
    &gt;
    &gt;Could also allow:
    &gt;Cheese( name = Person( location == "london").favourCheese )
    &gt;
    &gt;Can also use this to constrain on the fact itself, instead of
    just a field:
    &gt;Person( cheese = Cheese( type == "stilton ) )
    &gt;
    &gt;This could be use in config options:
    &gt;Call( duration &lt; CallConf().minDuration )
    &gt;
    &gt;But as Edson pointed out it is open to abuse and
    misunderstanding, how
    &gt;long till people do:
    &gt;Call( duration &lt; CallConf().maxDuration, duration &gt;
    CallConf().maxDuration )
    &gt;
    &gt;Which is more like doing the following which has cross product
    issues:
    &gt;CallConf( $maxDuration1 : maxDuration )
    &gt;CallConf( $maxDuration2 : maxDuration )
    &gt;Call( duration &lt; ,$maxDuration1 duration &gt; $maxDuration2 )
    &gt;
    &gt;Mark
    &gt;Mark Proctor wrote:
    &gt;
    &gt;
    &gt;&gt;I've been thinking of an idea to make rules more expressive, its
    just
    &gt;&gt;syntax sugar at the parser level, but thought i'd ask feedback -
    </pre>
  </blockquote>
  <pre wrap=""><!---->if
  </pre>
  <blockquote type="cite">
    <pre wrap="">    &gt;&gt;anyone with antlr skills wants to make this work, let us know :)
    &gt;&gt;
    &gt;&gt;Instead of doing:
    &gt;&gt;$p : Person($favouriteCheese : favouriteCheese )
    &gt;&gt;Cheese( name == $favouriteCheese )
    &gt;&gt;
    &gt;&gt;We should allow the following:
    &gt;&gt;$p : Person()
    &gt;&gt;Cheese( name == $p.favouriteCheese )
    &gt;&gt;
    &gt;&gt;We could take this further and in places where a pattern is not
    used
    &gt;&gt;elsewhere allow:
    &gt;&gt;Cheese( name == Person().favouriteCheese )
    &gt;&gt;
    &gt;&gt;Mark
    &gt;&gt;
    &gt;&gt;
    &gt;&gt;
    &gt;&gt;_______________________________________________
    &gt;&gt;rules-dev mailing list
    &gt;&gt;<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a> <a class="moz-txt-link-rfc2396E" href="mailto:rules-dev@lists.jboss.org">&lt;mailto:rules-dev@lists.jboss.org&gt;</a>
    &gt;&gt;<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
    &gt;&gt;
    &gt;&gt;
    &gt;&gt;
    &gt;
    &gt;_______________________________________________
    &gt;rules-dev mailing list
    &gt;<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a> <a class="moz-txt-link-rfc2396E" href="mailto:rules-dev@lists.jboss.org">&lt;mailto:rules-dev@lists.jboss.org&gt;</a>
    &gt; <a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
    &gt;_______________________________________________
    &gt;rules-dev mailing list
    &gt;<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a> <a class="moz-txt-link-rfc2396E" href="mailto:rules-dev@lists.jboss.org">&lt;mailto:rules-dev@lists.jboss.org&gt;</a>
    &gt;<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
    &gt;
    &gt;
    &gt;


    --
    Edson Tirelli
    Software Engineer - JBoss Rules Core Developer
    Office: +55 11 3124-6000
    Mobile: +55 11 9218-4151
    JBoss, a division of Red Hat @ <a class="moz-txt-link-abbreviated" href="http://www.jboss.com">www.jboss.com</a>
    </pre>
  </blockquote>
  <pre wrap=""><!----><a class="moz-txt-link-rfc2396E" href="http://www.jboss.com">&lt;http://www.jboss.com&gt;</a>
  </pre>
  <blockquote type="cite">
    <pre wrap="">
    _______________________________________________
    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-rfc2396E" href="mailto:rules-dev@lists.jboss.org">&lt;mailto:rules-dev@lists.jboss.org&gt;</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>
  <pre wrap=""><!---->-
  </pre>
  <blockquote type="cite">
    <pre wrap="">_______________________________________________
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>
  <pre wrap=""><!---->

  </pre>
</blockquote>
<br>
</body>
</html>