question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extended/revised condition syntax?

See original GitHub issue

Should we revision/extend the syntax for conditons? The current syntax is based on the principle that the attribute name represents the condition, the content represents the variable to be tested. This works fine in many cases and it’s concise, but it may be not ideal for cases that require more complex testing logic. Here I imagine using two attributes for one condition could be easier. Like :

variable="issued" date-range="../1900"
variable="author" equal-with="publisher"
variable="publisher" contained-in="author"

Opinions?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
fbennettcommented, Jun 30, 2020

As a further self-sourced response to my own skepticism, the CSL-M parallel-citation mechanism also depends on comparison of raw input values.

1reaction
fbennettcommented, Jun 30, 2020

@fbennett How are these handled for editortranslator?

  1. Is the match case-sensitive?

Yes.

  1. Will variant whitespace in the input (thinspace, non-breaking space) affect the match?

Yes.

  1. Is there to be provision for wildcarding (match-from-front, match-from-back)?

No such provision.

  1. Will the Unicode form (composed vs. decomposed) affect the match? Will processors be expected to normalize Unicode input for the match? Should normalization affect processor output?

The processor doesn’t normalize input itself, it’s left up to the calling application (Zotero does this), so the match would fail.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extend S3240: The simplest possible condition syntax should ...
The current rule states: In the interests of keeping code clean, the simplest possible conditional syntax should be used. That means […]
Read more >
Conditional branching: if, '?' - The Modern JavaScript Tutorial
The syntax is: let result = condition ? value1 : value2;.
Read more >
Making decisions in your code — conditionals - MDN Web Docs
In this article, we'll explore how so-called conditional statements ... This syntax is perfectly valid, but it is much easier to understand ...
Read more >
Most readable way to format long if conditions? [closed]
Often, a long if condition is the sign of code that needs refactoring, but sometimes you can't avoid it. In those cases, I...
Read more >
IF function – nested formulas and avoiding pitfalls
The IF function allows you to make a logical comparison between a value and what you expect by testing for a condition and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found