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.

Change Expressive.Expressions.Binary.BinaryExpressionBase scope from internal to public

See original GitHub issue

Loving this library! It is making my life SO much easier for a big project - except for one small keyword.

I’m setting up a custom Context subclass for our project so that it automatically registers some new custom functions and replaces some other built-in functions on construction. Creating the custom functions was was a breeze to do, just by making implementations of FunctionBase. The constructor also unregisters the bitwise operators, paving the way to use ‘^’ as an exponent operator so we can respect the expression syntax defined in our user interface spec.

  • First step: make an implementation of OperatorBase - no problem.
  • Next step: make an implementation of BinaryExpressionBase - problem.

Overriding EvaluateImp was straightforward, but unlike FunctionBase and OperatorBase which are declared public, BinaryExpressionBase is declared internal.

Can BinaryExpressionBase be made public instead of internal?

I really don’t want to fork and modify just for this keyword - I would really prefer leaving the Expressive package intact and just extend it!

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
granierocommented, Dec 23, 2020

Super! I’ll continue the conversation in those two spots, but a couple quick teasers:

  • The caret is crucial to preserve as standard bitwise XOR for people doing bit work, but for people using caret as standard exponent symbol, I’ll guess most are probably not doing bit work. Based on that assumption I have an idea that can cover this without breaking code. I’ll put details at #86.
  • Yeah, IgnoreCase is mighty tricky. The idea of a boolean argument for Contains etc. is excellent, and I can think of cases where those functions’ Ignore mode would need to be treated differently than a context-wide 'ignore case for parsing function names etc.` and ‘ignore case for equality tests’. I also have an idea how to separate options for parsing and equality without introducing a breaking change. I’ll put details at #77.
0reactions
bijingtoncommented, Jan 11, 2021

Fixed and shipped in release v2.3.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Separate compilation options from evaluation options #77
Currently ExpressiveOptions.IgnoreCase has quite an effect on results of an expression: Allows for loose matching of functions/operators ...
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