Comments (8)
This is actually an ambiguity in the spec, as it says that any single element is equal to a list with that single element and vice-versa. So:
a = [a]
[a] = a
That implies that:
[["w","x"],"y","z"] = [["w","x"],["y"],["z"]]
Having said that, I think it is a bad decision for the spec to allow it, and I agree we should simplify the tests here.
from tck.
PR #21 submitted
from tck.
I am actually concerned about this.
I agree that the spec describe something I consider to be a bad idea. But the spec is the spec, and should be unambiguous. In this area it is not ambiguous ... it clearly says that a list of one element is equal to that element, then we need a test of exactly that. If the spec says one thing, but all the implementations consistently do something else, we run the risk that someone who implements correctly is incompatible with the rest of the field. The problem with this should be obvious.
While is it OK to change this existing test to "properly nest the lists" (because that is still a valid test) we should not fail to add a test that tests "improper" nesting of lists. Our goal is to show conformance with the spec, and without such a test we fail to assure conformance.
An alternate approach is to document "deviances" from the spec -- the "vendors" correction to the spec that reflects how real implementations are done. That is a dangerous path because we have to promote and maintain this unofficial modification as an adjunct to the spec. It also has the effect of sweeping the problem under the rug -- avoiding the problem instead of addressing the problem. I think instead we should simply have tests that show up as failures until the RTF changes the official spec.
from tck.
Daniel Thanner and me discussed that in the ACTICO office the other day too. We basically agree with @agilepro s opinion. The spec is clear on that subject and we think, that the tests are valid, because they exactly reflect what the spec specifies and therefore should stay in the TCK.
I think it is very natural for business users to have that behavior: An element is equal to a list of size 1 containing that element. In reality we don't differentiate on that either: I don't care if my peach is a peach or a 'list' of peaches with 1 element containing that peach (whatever that would be) ;-)
IMHO the TCK should test exactly such cases: features and behavior the spec specifies clearly, without much room for vendor-specific interpretation.
So, if that is getting 'fixed' in the mentioned test-case, we would vote for adding another testcase, which tests the beforementioned 'list-1-element-equality' behavior, because it is part of the spec (and we even think a nice aspect of the spec for business users).
from tck.
I think some list literals have ambiguous semantics. According to the DMN standard
A list is written using square brackets to delimit the list, and commas to separate the list items (grammar rule 56). A singleton list is equal to its single item, i.e., [e]=e for all FEEL expressions e.
Let's consider the following literal
[["a"], "b"]
What is the type of the literal? If we consider ["a"] = "a" then the type is List<String>
. If we consider "b"= ["b"] then the type is List<List<String>>
AFAIK the only language with a similar feature is OCL but the implicit conversion does not apply to literals, only to navigation expression.
I think we should follow the same approach and restrict e =[e] to meaningful use cases (e.g. filters).
from tck.
As the related PR has been merged, I guess this one can be closed?
from tck.
@arthware the agreement from the call is that we will create a new set of tests to test specifically what was discussed here, i.e., a=[a] cases. Lets keep this ticket open for a few more days until it is done.
from tck.
Closing this ticket as the original tests were simplified and a new test was added to check for [a]=a.
from tck.
Related Issues (20)
- Clarify `null` handling in `FunctionInvocation` HOT 6
- Cover comparisons
- Create transitive import test cases based on snippets in DMN15-58 HOT 2
- Doubtful typing on overloaded built-in function in test HOT 2
- Report does not work under windows
- The test cases table breaks up around Compliance-Level-3
- New PRs ... but deleting them. The PRs have dragged in CL/LF differences HOT 2
- Patches to test cases HOT 4
- Confused about decision service encapsulatedDecisions - ambiguous - is ch11 example correct? HOT 5
- Task list for DMN 1.6
- Optional fn params vs null values HOT 4
- Question to test case `decision_015` in `0084-feel-for-loops.dmn` HOT 1
- Quesion to test case `nested009` in `1146-feel-context-put-function.dmn` HOT 2
- 0014-loan-comparison assumes that sorting keeps the original order HOT 2
- breaking change?: what do do with range equality? What is 'undefined'? HOT 4
- Is `[100] = 100` false or null? HOT 4
- Does @"P0D" = "P0Y" give `true` or `null` (or false?) ? HOT 3
- The new text for type conversions in "10.3.2.9.4 Type conversions" misses some use cases HOT 2
- Spec permits ranges to use new `=` and `!=` comparison operators - but it doesn't make much sense (to me) HOT 3
- TCK is using yearMonthDuration/dayTimeDuration/dateTime typeRefs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tck.