You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a half formed thought as I'm headed to bed, putting it out for people to poke at.
One very common manipulation for js is to add and remove classes - and many status changes are best indicated that way.
Say I have an input field that's given a class when it's input isn't valid, something that has to be tested on the server.
which means 'if you see invalid in the source html classes, make a pengine call and if it succeeds,
add the class invalid. The arguments to the call are the javascript expressions in the strings
lots of questions - is the class initially present? How does it decide to render?
But the core of the idea is that classes are predicates for html. Why not treat them as prolog predicates?
The text was updated successfully, but these errors were encountered:
We can logically describe a part of the DOM as being conditional using implication and deontic logic.
% the myattribute attribute of everything with myclass must be myvalue when some_prolog_on_server
% is true.
.myclass["myattribute"] = X :-
some_prolog_on_server.
// set the contents of mywarning
#mywarning.innerhtml = "<p>dont do that!</p>" :- other_prolog_pred.
// set the contents of UL.mytodos to a list of the proofs of nondet_pred.
// if X is a solution to nondet_pred, tthen there exists an element of the dom whose
// innerhtml is X within UL.mytodos LI.atodo
UL.mytodos LI.atodo = { innerhtml: X, margin: 0; } :- nondet_pred(X).
I wonder if this can be done with a quasiquote and the usual surrounding with deontic.
ok, may have worked out a way to make this computationally tractable over dinner tonight, but need to sleep on it. The napkin's in my purse.
Gist of it is codewalking and bumping the generation # of stateful things.
This is a half formed thought as I'm headed to bed, putting it out for people to poke at.
One very common manipulation for js is to add and remove classes - and many status changes are best indicated that way.
Say I have an input field that's given a class when it's input isn't valid, something that has to be tested on the server.
The server pengine exposes invalid/1
option 1:
option 2:
Or, even sneakier -
a declarative
which means 'if you see invalid in the source html classes, make a pengine call and if it succeeds,
add the class invalid. The arguments to the call are the javascript expressions in the strings
lots of questions - is the class initially present? How does it decide to render?
But the core of the idea is that classes are predicates for html. Why not treat them as prolog predicates?
The text was updated successfully, but these errors were encountered: