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
It might be better to simplify things by removing the set-logic, and just rely on Boolean logic. That's a hard choice to make b/c the set-logic system was the essence of the "ah ha" moment that led to this project, and in-itself it is very cool and makes a hell of a lot of sense. The problem is, as it turns out, the degree of flexibility it provide is almost never needed.
For example, lets say we have two facts (or states, for older versions). We can write it either of two ways. Like this:
fact:need_docs?do
...
endfact:has_manpages?do
...
endruleneed_docs? & has_manpages?do
...
end
Or like this:
defneed_docs?do
...
enddefhas_manpages?do
...
endrulefact(:need_docs?) & fact(:has_manpages?)do
...
end
But we really don't need to go to all that trouble because we could just define a separate fact that combines the other two in it's definition. Like so:
Notice there is no need for the fact method at all. Moreover we can extend the rule method to at least handle simple AND conjunctions, like this:
rule:needs_docs?,:has_manpages?=>:run_ronn
We could still keep the set-logic system under the hood. It wouldn't hurt anything to have and it may still be of some use in combining file-facts. If in the end, that too proves to be unnecessary then we can remove it altogether.
The text was updated successfully, but these errors were encountered:
trans
changed the title
Simply logic system
Simplify logic system
Mar 1, 2015
It might be better to simplify things by removing the set-logic, and just rely on Boolean logic. That's a hard choice to make b/c the set-logic system was the essence of the "ah ha" moment that led to this project, and in-itself it is very cool and makes a hell of a lot of sense. The problem is, as it turns out, the degree of flexibility it provide is almost never needed.
For example, lets say we have two facts (or states, for older versions). We can write it either of two ways. Like this:
Or like this:
But we really don't need to go to all that trouble because we could just define a separate fact that combines the other two in it's definition. Like so:
Notice there is no need for the
fact
method at all. Moreover we can extend therule
method to at least handle simple AND conjunctions, like this:We could still keep the set-logic system under the hood. It wouldn't hurt anything to have and it may still be of some use in combining file-facts. If in the end, that too proves to be unnecessary then we can remove it altogether.
The text was updated successfully, but these errors were encountered: