I am not sure about the &quot;danger&quot;, but I do like anything that avoids extra binding.<br>So lets not throw the baby out with the bathwater.<br><br>I really like:<br>$p : Person()<br>Cheese( name == $p.favouriteCheese )
<br><br>I think that should definately be allowed. <br><br><br><div><span class="gmail_quote">On 3/21/07, <b class="gmail_sendername">Edson Tirelli</b> &lt;<a href="mailto:tirelli@post.com">tirelli@post.com</a>&gt; wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>&nbsp;&nbsp; I think it is a dangerous move.<br>&nbsp;&nbsp; It is easy for users to understand that each pattern matches a fact:
<br><br>A( ... )<br>B( ... )<br>C( ... )<br><br>&nbsp;&nbsp; If you start moving patterns to inside other patterns, you risk to<br>lose the legibility:<br><br>A( b == B( ... ), c == C(...) )<br><br>&nbsp;&nbsp; Main problem I see is with cross product abuses:
<br><br>A( oneb == B(...), thesameb == B(...) )<br><br>&nbsp;&nbsp; The above may match the same B as intended, but may also match other<br>Bs, leading to errors and bugs that will be hard to track.<br>&nbsp;&nbsp; I would continue making patterns explicit and not nested.
<br><br>&nbsp;&nbsp; Although, the object navigability is desired and much waited I think:<br><br>$b : B(...)<br>A( c == $b.c )<br><br>&nbsp;&nbsp; Also, there are some cases that we would do good allowing nesting:<br><br>$c : Cheesery( ... )
<br>$s : List( size &lt; 3 ) from collect( Cheese( type == &quot;stilton&quot; ) from<br>$c.getCheeses() )<br><br>&nbsp;&nbsp; Just my .02 c.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;[]s<br>&nbsp;&nbsp;&nbsp;&nbsp;Edson<br><br>Olenin, Vladimir (MOH) wrote:<br><br>&gt;Don&#39;t have any antlr experience, but I&#39;d say that would be a very valuable
<br>&gt;addition - probably more BAs would be able to pick it up this way (without<br>&gt;having to fallback on custom DSL)<br>&gt;<br>&gt;Vlad<br>&gt;<br>&gt;-----Original Message-----<br>&gt;From: <a href="mailto:rules-dev-bounces@lists.jboss.org">
rules-dev-bounces@lists.jboss.org</a><br>&gt;[mailto:<a href="mailto:rules-dev-bounces@lists.jboss.org">rules-dev-bounces@lists.jboss.org</a>] On Behalf Of Mark Proctor<br>&gt;Sent: 20 March 2007 15:54<br>&gt;To: Rules Dev List
<br>&gt;Subject: Re: [rules-dev] sugar<br>&gt;<br>&gt;Could also allow:<br>&gt;Cheese( name = Person( location == &quot;london&quot;).favourCheese )<br>&gt;<br>&gt;Can also use this to constrain on the fact itself, instead of just a field:
<br>&gt;Person( cheese = Cheese( type == &quot;stilton ) )<br>&gt;<br>&gt;This could be use in config options:<br>&gt;Call( duration &lt; CallConf().minDuration )<br>&gt;<br>&gt;But as Edson pointed out it is open to abuse and misunderstanding, how
<br>&gt;long till people do:<br>&gt;Call( duration &lt; CallConf().maxDuration, duration &gt; CallConf().maxDuration )<br>&gt;<br>&gt;Which is more like doing the following which has cross product issues:<br>&gt;CallConf( $maxDuration1 : maxDuration )
<br>&gt;CallConf( $maxDuration2 : maxDuration )<br>&gt;Call( duration &lt; ,$maxDuration1 duration &gt; $maxDuration2 )<br>&gt;<br>&gt;Mark<br>&gt;Mark Proctor wrote:<br>&gt;<br>&gt;<br>&gt;&gt;I&#39;ve been thinking of an idea to make rules more expressive, its just
<br>&gt;&gt;syntax sugar at the parser level, but thought i&#39;d ask feedback - if<br>&gt;&gt;anyone with antlr skills wants to make this work, let us know :)<br>&gt;&gt;<br>&gt;&gt;Instead of doing:<br>&gt;&gt;$p : Person($favouriteCheese : favouriteCheese )
<br>&gt;&gt;Cheese( name == $favouriteCheese )<br>&gt;&gt;<br>&gt;&gt;We should allow the following:<br>&gt;&gt;$p : Person()<br>&gt;&gt;Cheese( name == $p.favouriteCheese )<br>&gt;&gt;<br>&gt;&gt;We could take this further and in places where a pattern is not used
<br>&gt;&gt;elsewhere allow:<br>&gt;&gt;Cheese( name == Person().favouriteCheese )<br>&gt;&gt;<br>&gt;&gt;Mark<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;_______________________________________________<br>&gt;&gt;rules-dev mailing list
<br>&gt;&gt;<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>&gt;&gt;<a href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>&gt;&gt;
<br>&gt;&gt;<br>&gt;&gt;<br>&gt;<br>&gt;_______________________________________________<br>&gt;rules-dev mailing list<br>&gt;<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>&gt;<a href="https://lists.jboss.org/mailman/listinfo/rules-dev">
https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>&gt;_______________________________________________<br>&gt;rules-dev mailing list<br>&gt;<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
&gt;<a href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>&gt;<br>&gt;<br>&gt;<br><br><br>--<br> Edson Tirelli<br> Software Engineer - JBoss Rules Core Developer
<br> Office: +55 11 3124-6000<br> Mobile: +55 11 9218-4151<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br><br><br>_______________________________________________<br>rules-dev mailing list
<br><a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br></blockquote></div><br>