alert/1 for JScriptLog
Brought to you by:
grholst
Thanks to Jeff Thompson for the following useful debugging predicate
(like write/1, but displays a modal dialog).
// alert/1 : call Javascript alert() to display the Value.
{
addRuleSet(jslog_kb,new RuleSet('alert',1,false));
addRule(jslog_kb,
newFunctionRule(newAtom('alert',[newVariable('Value')]),alert_fn),
true);
}
function alert_fn(goal)
{var encl = getFinalEnclosure(goal.encl);
alert(jslog_toString(getFinalEnclosure(newSubtermEnclosure
(encl.enclosure,encl.term.children[0]))));
return true;
}