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
Consider the following pattern: pattern can-drink = $(self > 18) .
The input 12 produce the following result :
{
"name": {
"pattern": "playground::can-drink"
},
"input": 10,
"satisfied": false,
"reason": "The expression defined in the pattern is not satisfied"
}
This makes it hard to debug, because when inspecting i don't really know what expression the input was checked against
Here it is pretty easy. but if you consider a slightly more complicated pattern :
{
"name": {
"pattern": "lang::and"
},
"bindings": {
"terms": []
},
"input": 17,
"satisfied": false,
"reason": "The input does not satisfy the function",
"rationale": [
{
"name": {
"pattern": "playground::can-drink"
},
"bindings": {
"terms": []
},
"input": 17,
"satisfied": false,
"reason": "The expression defined in the pattern is not satisfied"
},
{
"name": {
"pattern": "playground::can-drive"
},
"bindings": {
"terms": []
},
"input": 17,
"output": 17,
"satisfied": true,
"reason": "The expression defined in the pattern is satisfied"
}
]
}
this is harder to debug, although in this case, both patterns have names so it's ok.
make it harder : pattern responsible-person = $(self > 18) && $(self > 16)
Then the result is :
{
"name": {
"pattern": "lang::and"
},
"bindings": {
"terms": [
{
"Expr": {
"GreaterThan": [
{
"SelfLiteral": []
},
{
"Value": {
"Integer": 18
}
}
]
}
},
{
"Expr": {
"GreaterThan": [
{
"SelfLiteral": []
},
{
"Value": {
"Integer": 16
}
}
]
}
}
]
},
"input": 17,
"satisfied": false,
"reason": "The input does not satisfy the function",
"rationale": [
{
"input": 17,
"satisfied": false,
"reason": "The expression defined in the pattern is not satisfied"
},
{
"input": 17,
"output": 17,
"satisfied": true,
"reason": "The expression defined in the pattern is satisfied"
}
]
}
The text was updated successfully, but these errors were encountered:
Consider the following pattern:
pattern can-drink = $(self > 18)
.The input
12
produce the following result :This makes it hard to debug, because when inspecting i don't really know what expression the
input
was checked againstHere it is pretty easy. but if you consider a slightly more complicated pattern :
Giving it
17
only fails one :this is harder to debug, although in this case, both patterns have names so it's ok.
make it harder :
pattern responsible-person = $(self > 18) && $(self > 16)
Then the result is :
The text was updated successfully, but these errors were encountered: