Menu

#17 alert/1 for JScriptLog

open
nobody
None
5
2012-09-16
2006-05-21
No

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;
}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.