<!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 text="#000000" bgcolor="#ffffff">
My personally opinion is to keep the language simple and instead
have the tooling inject what ever is necessary as a visulation. Be
it different colouring, hover over or graphic symbol. It keeps the
language simple and actually achieve the desired result better.<br>
<br>
Mark<br>
On 20/04/2011 14:00, Leonardo Gomes wrote:
<blockquote
cite="mid:BANLkTi=SLg=7LrcGxZMjmfnuj-iurbUjNQ@mail.gmail.com"
type="cite">+1 for Michael's suggestion.<br>
<br>
It's a bit more verbose, but makes things clear.<br>
<br>
The semicolon here:<code><br>
?</code><code>editableThings</code><code>(food : ?, </code><code>loc</code><code>;)
<br>
</code><br>
Is a typo, right? You actually meant:<br>
<br>
<code>?</code><code>editableThings</code><code>(food : ?, </code><code>loc</code><code>)<b>;</b>
</code><br>
<code>
</code><br>
- Leo.<br>
<br>
<br>
<br>
<div class="gmail_quote">On Wed, Apr 20, 2011 at 11:59 AM, Michael
Anstis <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
Hmmmmm....<br>
<br>
Personally, I don't like the use of ":" i isolation as it's
what we currently use to bind variables and I feel "cheese:"
as an output definition could just make people question
whether they've missed something. Perhaps "cheese : ?" would
be a viable alternative. This would be in keeping with (a)
current variable declaration, (b) the use of "?" to identify a
call to a query. Geoffrey's examples would then become:-
<div class="im">
<br>
<br>
<code>rule</code> <code>outputinput<br>
</code><code>when</code>
<div><code> </code><code>Here( loc : location) </code></div>
<div><code> </code><code>?</code><code>editableThings</code><code>(food
: ?, </code><code>loc</code><code>;)</code></div>
</div>
<div><code>then</code><br>
System.out.println("Food " + food + " at location " +
loc);
<div class="im"><br>
// Output:<br>
// Food crackers at location kitchen<br>
// Food apple at location kitchen</div>
</div>
<div>
<div class="im"><code>end<br>
</code><br>
<div><code>rule</code> <code>outputOutput<br>
</code><code>when</code></div>
<div><code> </code><code>?</code><code>editableThings</code><code>(food
: ?, </code><code>loc : ?</code><code>;)</code></div>
</div>
<div><code>then</code><br>
System.out.println("Food " + food + " at location " +
loc);
<div class="im"><br>
// Output:<br>
// Food crackers at location kitchen<br>
// Food apple at location kitchen<br>
// Food chocolate at location living room<br>
// Food chips at location living room </div>
</div>
<div>
<div class="im"><code>end<br>
<br>
</code>
<div><code>rule</code> <code>typo<br>
</code><code>when</code></div>
<div><code> </code><code>Here( looc : location) </code></div>
<div><code> </code><code>?</code><code>editableThings</code><code>(food
: ?, </code><code>loc : ?</code><code>;)</code></div>
</div>
<div><code>then</code><br>
System.out.println("Food " + food + " at location "
+ loc);
<div class="im"><br>
// Output:<br>
// Food crackers at location kitchen<br>
// Food apple at location kitchen<br>
// Food chocolate at location living room<br>
// Food chips at location living room<br>
</div>
// looc is just an unused bound variable<br>
</div>
<div><code>end</code></div>
</div>
</div>
<br>
<br>
<div class="gmail_quote">
<div>
<div class="h5">On 20 April 2011 10:16, Geoffrey De Smet <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:ge0ffrey.spam@gmail.com"
target="_blank">ge0ffrey.spam@gmail.com</a>></span>
wrote:<br>
</div>
</div>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<div>
<div class="h5">
<div text="#000000" bgcolor="#ffffff"> Mark and I were
discussing backwards chaining<br>
<a moz-do-not-send="true"
href="http://blog.athico.com/2011/04/backward-chaining-emerges-in-drools.html"
target="_blank">http://blog.athico.com/2011/04/backward-chaining-emerges-in-drools.html</a><br>
on IRC and we 'd like your opinion on a design
issue.<br>
<br>
The example<br>
========<br>
<br>
Let's say you have this data:<br>
Location("crackers", "kitchen")<br>
Location("apple", "kitchen")<br>
Location("chocolate", "living room")<br>
Location("chips", "living room")<br>
<br>
Let's say you have this code:<br>
<br>
<div><code>query</code> <code>editableThings(
String thing, String location ) </code></div>
<div><code> </code><code>Location(thing,
location)</code></div>
<div><code>end</code></div>
<br>
And then these 3 rules:<br>
<br>
<div><code>rule</code> <code>outputinput<br>
</code><code>when</code></div>
<div><code> </code><code>Here( loc : location) </code></div>
<div><code> </code><code>?</code><code>editableThings</code><code>(food,
</code><code>loc</code><code>;)</code></div>
<div><code>then</code><br>
System.out.println("Food " + f + " at location
" + loc);<br>
// Output:<br>
// Food crackers at location kitchen<br>
// Food apple at location kitchen</div>
<div><code>end<br>
</code><br>
<div><code>rule</code> <code>outputOutput<br>
</code><code>when</code></div>
<div><code> </code><code>?</code><code>editableThings</code><code>(food,
</code><code>loc</code><code>;)</code></div>
<div><code>then</code><br>
System.out.println("Food " + f + " at
location " + loc);<br>
// Output:<br>
// Food crackers at location kitchen<br>
// Food apple at location kitchen<br>
// Food chocolate at location living room<br>
// Food chips at location living room </div>
<div><code>end<br>
<br>
</code>
<div><code>rule</code> <code>typo<br>
</code><code>when</code></div>
<div><code> </code><code>Here( looc :
location) </code></div>
<div><code> </code><code>?</code><code>editableThings</code><code>(food,
</code><code>loc</code><code>;)</code></div>
<div><code>then</code><br>
System.out.println("Food " + f + " at
location " + loc);<br>
// Output:<br>
// Food crackers at location kitchen<br>
// Food apple at location kitchen<br>
// Food chocolate at location living room<br>
// Food chips at location living room</div>
<div><code>end</code></div>
<br>
</div>
<br>
</div>
The discussion<br>
=========<br>
<br>
Both rules have the same statement:<br>
<code>?</code><code>editableThings</code><code>(food,
</code><code>loc</code><code>;)</code><br>
<br>
<code></code>In the outputInput rule, "<code></code><code>loc</code><code></code>"
is an input variable.<br>
<code></code>In the outputOutput rule, "<code></code><code>loc</code><code></code>"
is an output variable.<br>
<br>
I am wondering if we don't need a visual demarcation
that a variable is an output variable,<br>
to make it stand out of an input variable?<br>
<br>
Proposition 1: Suffix output variables with ":"<br>
<br>
<div><code>rule</code> <code>outputinput<br>
</code><code>when</code></div>
<div><code> </code><code>Here( loc : location) </code></div>
<div><code> </code><code>?</code><code>editableThings</code><code>(food:,
</code><code>loc</code><code>;)</code></div>
<div><code>then ... end<br>
<br>
</code>
<div><code>rule</code> <code>outputOutput<br>
</code><code>when</code></div>
<div><code> </code><code>?</code><code>editableThings</code><code>(food:,
</code><code>loc:</code><code>;)</code></div>
<div><code>then ... end</code><code></code></div>
<br>
<div><code>rule</code> <code>typo<br>
</code><code>when</code></div>
<div><code> </code><code>Here( looc : location)
</code></div>
<div><code> </code><code>?</code><code>editableThings</code><code>(food:,
</code><code>loc</code><code>;) // compiler
error because input variable loc is not
declared</code><code></code>
<div><code>then ... end</code></div>
</div>
</div>
<br>
<br>
-- <br>
With kind regards,<br>
<font color="#888888"> Geoffrey De Smet </font></div>
<br>
</div>
</div>
_______________________________________________<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>
</blockquote>
</div>
<br>
<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>