Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'in' infix operator #510

Closed
rakudrama opened this issue Nov 18, 2011 · 3 comments
Closed

Add 'in' infix operator #510

rakudrama opened this issue Nov 18, 2011 · 3 comments
Assignees
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-not-planned Closed as we don't intend to take action on the reported issue type-enhancement A request for a change that isn't a bug

Comments

@rakudrama
Copy link
Member

An 'in' operator would make Set membership and Map definedness tests look nicer.

'in' is slightly unusual in that the receiver would be the right hand operand.

class MySet<T> implements Set<T> {
  bool operator in(T candidate) => contains(candidate);
}

if (mySet.contains(50)) ...
-->
if (50 in mySet) ...

The subexpressions would still be evaluated left-to-right,
so
    f() in g()
calls f, calls g, and then invokes the 'in' operator of the result of g(), passing the result of f().

'in' is already a keyword from for-in

@gbracha
Copy link
Contributor

gbracha commented Dec 14, 2011

I think we want to keep the number of constructs in the language small. This does not seem particularly necessary or valuable. It just does not pass the bar in terms of utility or power to weight ratio.


Set owner to @gbracha.
Added WontFix label.

@DartBot
Copy link

DartBot commented Jan 4, 2012

This comment was originally written by [email protected]


Among other things 'in' combined with list literals is a very nice way to write clear and concise code in many circumstances. Couldn't this just be given a low priority for 'maybe' doing 'one day' instead of being rejected?

@floitschG
Copy link
Contributor

Issue #3979 has been merged into this issue.

@rakudrama rakudrama added Type-Enhancement area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels Jul 3, 2012
@kevmoo kevmoo added closed-not-planned Closed as we don't intend to take action on the reported issue type-enhancement A request for a change that isn't a bug and removed resolution-wont_fix labels Mar 1, 2016
copybara-service bot pushed a commit that referenced this issue Nov 16, 2022
…ackage_config, path, shelf, term_glyph, test_reflective_loader, webdev, webkit_inspection_protocol, yaml

Revisions updated by `dart tools/rev_sdk_deps.dart`.

cli_util (https://github.com/dart-lang/cli_util/compare/b0adbba..edcf1c3):
  edcf1c3  2022-11-15  Devon Carew  blast_repo fixes (#71)

csslib (https://github.com/dart-lang/csslib/compare/ba2eb2d..34203c0):
  34203c0  2022-11-15  Kevin Moore  blast_repo fixes (#154)

dartdoc (https://github.com/dart-lang/dartdoc/compare/08e3098..dc502d0):
  dc502d08  2022-11-15  Sam Rawlins  Move much PackageWarning logic _out_ of PackageGraph, into the enum. (#3251)
  ad651b15  2022-11-15  Sam Rawlins  Move the e2e source-link test to a unit test (#3254)
  d14c680c  2022-11-11  Sam Rawlins  Make many Strings in DocumentationComment non-nullable (#3243)
  92afb9bb  2022-11-10  dependabot[bot]  Bump github/codeql-action from 2.1.29 to 2.1.31 (#3246)

http (https://github.com/dart-lang/http/compare/6339026..d56141d):
  d56141d  2022-11-11  Brian Quinlan  Upgrade to ffigen ^7.2 and remove unnecessary casts (#820)
  d95a544  2022-11-10  Brian Quinlan  Add a more complete implementation for `URLSessionTask`. (#818)

intl (https://github.com/dart-lang/intl/compare/442193c..a127902):
  a127902  2022-11-16  Kevin Moore  blast_repo fixes (#510)

matcher (https://github.com/dart-lang/matcher/compare/6a9b83b..9051de0):
  9051de0  2022-11-15  Kevin Moore  blast_repo fixes (#197)

mockito (https://github.com/dart-lang/mockito/compare/748e88e..347d3e4):
  347d3e4  2022-11-14  Kevin Moore  blast_repo fixes (#587)

package_config (https://github.com/dart-lang/package_config/compare/cff98c9..abb4aec):
  abb4aec  2022-11-15  Kevin Moore  blast_repo fixes (#127)

path (https://github.com/dart-lang/path/compare/58ba22c..12ce876):
  12ce876  2022-11-14  hellohuanlin  Support more arguments in path.join API (#130)

shelf (https://github.com/dart-lang/shelf/compare/5fd2593..1c21047):
  1c21047  2022-11-11  Devon Carew  update the no-response.yml configuration (#308)

term_glyph (https://github.com/dart-lang/term_glyph/compare/ec7cf7b..822cd5b):
  822cd5b  2022-11-15  Kevin Moore  blast_repo fixes (#29)

test_reflective_loader (https://github.com/dart-lang/test_reflective_loader/compare/ef934b7..52b6753):
  52b6753  2022-11-15  Kevin Moore  blast_repo fixes (#42)

webdev (https://github.com/dart-lang/webdev/compare/22f6271..3ec168f):
  3ec168f  2022-11-15  Anna Gringauze  Add --enable-experience flag and pass it to the expression compiler service (#1794)
  72272dd  2022-11-10  Elliott Brooks (she/her)  Include a settings page for configuring the Dart Debug Extension (#1776)
  73839e7  2022-11-10  Elliott Brooks (she/her)  Log entire exception message instead of first line (#1782)

webkit_inspection_protocol (https://github.com/google/webkit_inspection_protocol.dart/compare/b825c8f..ddb624c):
  ddb624c  2022-11-14  Kevin Moore  blast_repo fixes (#95)

yaml (https://github.com/dart-lang/yaml/compare/fda5b15..f699275):
  f699275  2022-11-15  Devon Carew  Merge pull request #131 from dart-lang/blast_repo-2022_11_15T20_23_04
  8f6a5f7  2022-11-15  Kevin Moore  blast_repo fixes

Change-Id: I5d55d733b7f9256edf4f44229cc810e827c23f7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270240
Auto-Submit: Devon Carew <[email protected]>
Commit-Queue: Kevin Moore <[email protected]>
Reviewed-by: Kevin Moore <[email protected]>
copybara-service bot pushed a commit that referenced this issue Feb 8, 2023
dartdoc:
494a6bed  2023-02-02  Sam Rawlins  Bump markdown dep to a pre-release of 7.0.0 (#3321)
ad6f1612  2023-02-02  Devon Carew  introduce an environmentProvider abstraction (#3324)
d0b73000  2023-02-02  Sam Rawlins  Prepare testing code for some upcoming Warnings (#3322)
936a7888  2023-02-01  Sam Rawlins  Add text about front-end manual testing (#3286)
cbee812d  2023-02-01  Sam Rawlins  Avoid renaming generator params (#3316)
bcaa0349  2023-02-01  Sam Rawlins  Privatize Library.sdkLib and move getClassByName (#3317)
af32def5  2023-01-31  dependabot[bot]  Bump github/codeql-action from 2.1.39 to 2.2.1 (#3313)
528e97da  2023-01-31  dependabot[bot]  Bump actions/cache from 3.2.3 to 3.2.4 (#3312)
54020672  2023-02-01  Parker Lougheed  Begin changelog for next release after 6.1.5 (#3315)

markdown:
f51c24c  2023-02-01  Zhiguang Chen  Prepend a line ending if the p tag is removed and there is an element before it in a *tight* list (#513)
dd3e3a1  2023-01-31  dependabot[bot]  Bump dart-lang/setup-dart from 1.3 to 1.4 (#510)
5f25fc9  2023-01-31  dependabot[bot]  Bump actions/checkout from 3.2.0 to 3.3.0 (#511)
54266b2  2023-01-31  Kevin Moore  Prepare to release v7.0.0 (#509)
d6ceff9  2023-01-31  Zhiguang Chen  Add line endings before HTML blocks (#508)
ccd3c8b  2023-01-29  Zhiguang Chen  Rewrite link reference definitions (#506)
e8f84dc  2023-01-24  Kevin Moore  Update GFM to 0.29.0.gfm.7 (#507)
93f67b0  2023-01-20  Zhiguang Chen  Add an `enableTagfilter` option to `HtmlRenderer` to eanble GFM `tagfilter` extension (#447)
d110770  2023-01-13  Zhiguang Chen  Rewrite SetextHeaderSyntax (#500)
c1b9bc6  2023-01-09  Sam Rawlins  Migrate from no-implicit-casts to strict-casts (#504)
3e78c08  2023-01-01  dependabot[bot]  Bump actions/checkout from 3.0.2 to 3.2.0 (#501)
417747f  2022-12-15  Zhiguang Chen  Refactor list syntax (#499)
30ec05f  2022-11-29  Zhiguang Chen  Do not escape single quote(apostrophe) inside code (#498)
c3d1136  2022-11-29  Zhiguang Chen  introduce a Line class (#494)
Change-Id: I9d971b927b72500ab84cce461a60fe1a86818e2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281543
Reviewed-by: Samuel Rawlins <[email protected]>
Commit-Queue: Devon Carew <[email protected]>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-not-planned Closed as we don't intend to take action on the reported issue type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants