comunica / sparqlee

⚙️ SPARQL expression evaluator library - Moved to @comunica/expression-evaluator
https://www.npmjs.com/package/sparqlee
14 stars 7 forks source link

Drops regular operator infinite arity support #142

Closed Tpt closed 2 years ago

Tpt commented 2 years ago

Not usable in practice because of implementation restrictions

coveralls commented 2 years ago

Coverage Status

Coverage increased (+0.07%) to 91.695% when pulling 28af3e87308a8ea3cb468177e1565772e7c247c8 on Tpt:arity into 246e5910bac6e135263ad3d606e99677cf58fd31 on comunica:master.

rubensworks commented 2 years ago

If I understand correctly, this check is in place for varargs expressions such as CONCAT. Do you think this check is invalid?

Tpt commented 2 years ago

If I understand correctly, this check is in place for varargs expressions such as CONCAT. Do you think this check is invalid?

The check is valid but unused because CONCAT is currently implemented a a "special" operator because regular function evaluation utilities do not support varargs at the moment.

To cover this alternative properly with a test I would need either to do a huge refactoring to add proper dependency injection or hack on the regular function map to add a fake function only for the test and remove it afterward. I prefered to completely drop this piece of code in the assumption that no code is better than dead code. But if you think differently, I am find with hacking a test for it.

rubensworks commented 2 years ago

Ah I see. Definitely makes sense in that case!